patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / i386 / power / pmdisk.S
1 /* Originally gcc generated, modified by hand */
2
3 #include <linux/linkage.h>
4 #include <asm/segment.h>
5 #include <asm/page.h>
6
7         .text
8
9 ENTRY(pmdisk_arch_suspend)
10         cmpl $0,4(%esp)
11         jne .L1450
12
13         movl %esp, saved_context_esp
14         movl %ebx, saved_context_ebx
15         movl %ebp, saved_context_ebp
16         movl %esi, saved_context_esi
17         movl %edi, saved_context_edi
18         pushfl ; popl saved_context_eflags
19
20         call pmdisk_suspend
21         jmp .L1449
22         .p2align 4,,7
23 .L1450:
24         movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
25         movl %ecx,%cr3
26
27         movl    pm_pagedir_nosave,%ebx
28         xorl    %eax, %eax
29         xorl    %edx, %edx
30         .p2align 4,,7
31 .L1455:
32         movl    4(%ebx,%edx),%edi
33         movl    (%ebx,%edx),%esi
34
35         movl    $1024, %ecx
36         rep
37         movsl
38
39         movl    %cr3, %ecx;
40         movl    %ecx, %cr3;  # flush TLB 
41
42         incl    %eax
43         addl    $16, %edx
44         cmpl    pmdisk_pages,%eax
45         jb .L1455
46         .p2align 4,,7
47 .L1453:
48         movl saved_context_esp, %esp
49         movl saved_context_ebp, %ebp
50         movl saved_context_ebx, %ebx
51         movl saved_context_esi, %esi
52         movl saved_context_edi, %edi
53         pushl saved_context_eflags ; popfl
54         call pmdisk_resume
55 .L1449:
56         ret