1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <linux/linkage.h>
4 #include <asm/segment.h>
5 #include <asm/page_types.h>
7 # Copyright 2003, 2008 Pavel Machek <pavel@suse.cz
12 SYM_CODE_START(wakeup_pmode_return)
13 movw $__KERNEL_DS, %ax
22 # reload the gdt, as we need the full 32 bit address
25 ljmp $(__KERNEL_CS), $1f
31 # and restore the stack ... but you need gdt for this to work
32 movl saved_context_esp, %esp
34 movl %cs:saved_magic, %eax
35 cmpl $0x12345678, %eax
38 # jump to place where we left off
41 SYM_CODE_END(wakeup_pmode_return)
54 movl %eax, saved_context_esp
55 movl %ebx, saved_context_ebx
56 movl %ebp, saved_context_ebp
57 movl %esi, saved_context_esi
58 movl %edi, saved_context_edi
60 popl saved_context_eflags
62 movl $ret_point, saved_eip
67 movl saved_context_ebp, %ebp
68 movl saved_context_ebx, %ebx
69 movl saved_context_esi, %esi
70 movl saved_context_edi, %edi
71 pushl saved_context_eflags
75 SYM_CODE_START(do_suspend_lowlevel)
76 call save_processor_state
79 call x86_acpi_enter_sleep_state
82 # In case of S3 failure, we'll emerge here. Jump
83 # to ret_point to recover
87 call restore_registers
88 call restore_processor_state
90 SYM_CODE_END(do_suspend_lowlevel)
94 SYM_DATA(saved_magic, .long 0)