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>
18 ENTRY(swsusp_arch_suspend)
20 movl %esp, saved_context_esp
21 movl %ebx, saved_context_ebx
22 movl %ebp, saved_context_ebp
23 movl %esi, saved_context_esi
24 movl %edi, saved_context_edi
25 pushfl ; popl saved_context_eflags
30 ENTRY(swsusp_arch_resume)
31 movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
34 movl pagedir_nosave, %ebx
40 movl 4(%ebx,%edx),%edi
49 cmpl nr_copy_pages,%eax
53 movl saved_context_esp, %esp
54 movl saved_context_ebp, %ebp
55 movl saved_context_ebx, %ebx
56 movl saved_context_esi, %esi
57 movl saved_context_edi, %edi
59 pushl saved_context_eflags ; popfl