3 /* Originally gcc generated, modified by hand
5 * This may not use any stack, nor any variable that is not "NoSave":
7 * Its rewriting one kernel image with another. What is stack in "old"
8 * image could very well be data page in "new" image, and overwriting
9 * your own stack under you is bad idea.
12 #include <linux/linkage.h>
13 #include <asm/segment.h>
22 call do_magic_suspend_1
23 call save_processor_state
25 movl %esp, saved_context_esp
26 movl %eax, saved_context_eax
27 movl %ebx, saved_context_ebx
28 movl %ecx, saved_context_ecx
29 movl %edx, saved_context_edx
30 movl %ebp, saved_context_ebp
31 movl %esi, saved_context_esi
32 movl %edi, saved_context_edi
33 pushfl ; popl saved_context_eflags
35 call do_magic_suspend_2
39 movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
42 call do_magic_resume_1
51 movl pagedir_nosave,%ecx
55 movl 4(%ecx,%eax),%ebx
60 movl %eax, %cr3; # flush TLB
72 cmpl nr_copy_pages,%eax
80 movl saved_context_esp, %esp
81 movl saved_context_ebp, %ebp
82 movl saved_context_eax, %eax
83 movl saved_context_ebx, %ebx
84 movl saved_context_ecx, %ecx
85 movl saved_context_edx, %edx
86 movl saved_context_esi, %esi
87 movl saved_context_edi, %edi
88 call restore_processor_state
89 pushl saved_context_eflags ; popfl
90 call do_magic_resume_2