| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Hibernation support for x86-64 |
|---|
| 3 | | - * |
|---|
| 4 | | - * Distribute under GPLv2. |
|---|
| 5 | 4 | * |
|---|
| 6 | 5 | * Copyright 2007 Rafael J. Wysocki <rjw@sisk.pl> |
|---|
| 7 | 6 | * Copyright 2005 Andi Kleen <ak@suse.de> |
|---|
| .. | .. |
|---|
| 23 | 22 | #include <asm/processor-flags.h> |
|---|
| 24 | 23 | #include <asm/frame.h> |
|---|
| 25 | 24 | |
|---|
| 26 | | -ENTRY(swsusp_arch_suspend) |
|---|
| 25 | +SYM_FUNC_START(swsusp_arch_suspend) |
|---|
| 27 | 26 | movq $saved_context, %rax |
|---|
| 28 | 27 | movq %rsp, pt_regs_sp(%rax) |
|---|
| 29 | 28 | movq %rbp, pt_regs_bp(%rax) |
|---|
| .. | .. |
|---|
| 50 | 49 | FRAME_BEGIN |
|---|
| 51 | 50 | call swsusp_save |
|---|
| 52 | 51 | FRAME_END |
|---|
| 53 | | - ret |
|---|
| 54 | | -ENDPROC(swsusp_arch_suspend) |
|---|
| 52 | + RET |
|---|
| 53 | +SYM_FUNC_END(swsusp_arch_suspend) |
|---|
| 55 | 54 | |
|---|
| 56 | | -ENTRY(restore_image) |
|---|
| 55 | +SYM_CODE_START(restore_image) |
|---|
| 57 | 56 | /* prepare to jump to the image kernel */ |
|---|
| 58 | 57 | movq restore_jump_address(%rip), %r8 |
|---|
| 59 | 58 | movq restore_cr3(%rip), %r9 |
|---|
| 60 | 59 | |
|---|
| 61 | 60 | /* prepare to switch to temporary page tables */ |
|---|
| 62 | | - movq temp_level4_pgt(%rip), %rax |
|---|
| 61 | + movq temp_pgt(%rip), %rax |
|---|
| 63 | 62 | movq mmu_cr4_features(%rip), %rbx |
|---|
| 64 | 63 | |
|---|
| 65 | 64 | /* prepare to copy image data to their original locations */ |
|---|
| .. | .. |
|---|
| 68 | 67 | /* jump to relocated restore code */ |
|---|
| 69 | 68 | movq relocated_restore_code(%rip), %rcx |
|---|
| 70 | 69 | jmpq *%rcx |
|---|
| 70 | +SYM_CODE_END(restore_image) |
|---|
| 71 | 71 | |
|---|
| 72 | 72 | /* code below has been relocated to a safe page */ |
|---|
| 73 | | -ENTRY(core_restore_code) |
|---|
| 73 | +SYM_CODE_START(core_restore_code) |
|---|
| 74 | 74 | /* switch to temporary page tables */ |
|---|
| 75 | 75 | movq %rax, %cr3 |
|---|
| 76 | 76 | /* flush TLB */ |
|---|
| .. | .. |
|---|
| 98 | 98 | .Ldone: |
|---|
| 99 | 99 | /* jump to the restore_registers address from the image header */ |
|---|
| 100 | 100 | jmpq *%r8 |
|---|
| 101 | +SYM_CODE_END(core_restore_code) |
|---|
| 101 | 102 | |
|---|
| 102 | 103 | /* code below belongs to the image kernel */ |
|---|
| 103 | 104 | .align PAGE_SIZE |
|---|
| 104 | | -ENTRY(restore_registers) |
|---|
| 105 | +SYM_FUNC_START(restore_registers) |
|---|
| 105 | 106 | /* go back to the original page tables */ |
|---|
| 106 | 107 | movq %r9, %cr3 |
|---|
| 107 | 108 | |
|---|
| .. | .. |
|---|
| 142 | 143 | /* tell the hibernation core that we've just restored the memory */ |
|---|
| 143 | 144 | movq %rax, in_suspend(%rip) |
|---|
| 144 | 145 | |
|---|
| 145 | | - ret |
|---|
| 146 | | -ENDPROC(restore_registers) |
|---|
| 146 | + RET |
|---|
| 147 | +SYM_FUNC_END(restore_registers) |
|---|