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>
15 #include <asm/asm-offsets.h>
19 ENTRY(swsusp_arch_suspend)
21 movl %esp, saved_context_esp
22 movl %ebx, saved_context_ebx
23 movl %ebp, saved_context_ebp
24 movl %esi, saved_context_esi
25 movl %edi, saved_context_edi
26 pushfl ; popl saved_context_eflags
32 movl resume_pg_dir, %ecx
33 subl $__PAGE_OFFSET, %ecx
36 movl restore_pblist, %edx
43 movl pbe_address(%edx), %esi
44 movl pbe_orig_address(%edx), %edi
50 movl pbe_next(%edx), %edx
55 /* go back to the original page tables */
56 movl $swapper_pg_dir, %ecx
57 subl $__PAGE_OFFSET, %ecx
59 /* Flush TLB, including "global" things (vmalloc) */
60 movl mmu_cr4_features, %eax
62 andl $~(1<<7), %edx; # PGE
63 movl %edx, %cr4; # turn off PGE
64 movl %cr3, %ecx; # flush TLB
66 movl %eax, %cr4; # turn PGE back on
68 movl saved_context_esp, %esp
69 movl saved_context_ebp, %ebp
70 movl saved_context_ebx, %ebx
71 movl saved_context_esi, %esi
72 movl saved_context_edi, %edi
74 pushl saved_context_eflags ; popfl