]> git.hungrycats.org Git - linux/blob
2394831
[linux] /
1 .text
2
3 /* Originally gcc generated, modified by hand */
4
5 #include <linux/linkage.h>
6 #include <asm/segment.h>
7 #include <asm/page.h>
8
9         .text
10
11 ENTRY(swsusp_arch_suspend)
12         pushl %ebx
13         cmpl $0,8(%esp)
14         jne .L1450
15         call save_processor_state
16
17         movl %esp, saved_context_esp
18         movl %eax, saved_context_eax
19         movl %ebx, saved_context_ebx
20         movl %ecx, saved_context_ecx
21         movl %edx, saved_context_edx
22         movl %ebp, saved_context_ebp
23         movl %esi, saved_context_esi
24         movl %edi, saved_context_edi
25         pushfl ; popl saved_context_eflags
26
27         call swsusp_suspend
28         jmp .L1449
29         .p2align 4,,7
30 .L1450:
31         movl $swapper_pg_dir-__PAGE_OFFSET,%ecx
32         movl %ecx,%cr3
33
34         movl $0,loop
35         cmpl $0,nr_copy_pages
36         je .L1453
37         .p2align 4,,7
38 .L1455:
39         movl $0,loop2
40         .p2align 4,,7
41 .L1459:
42         movl pagedir_nosave,%ecx
43         movl loop,%eax
44         movl loop2,%edx
45         sall $4,%eax
46         movl 4(%ecx,%eax),%ebx
47         movl (%ecx,%eax),%eax
48         movb (%edx,%eax),%al
49         movb %al,(%edx,%ebx)
50         movl %cr3, %eax;              
51         movl %eax, %cr3;  # flush TLB 
52
53         movl loop2,%eax
54         leal 1(%eax),%edx
55         movl %edx,loop2
56         movl %edx,%eax
57         cmpl $4095,%eax
58         jbe .L1459
59         movl loop,%eax
60         leal 1(%eax),%edx
61         movl %edx,loop
62         movl %edx,%eax
63         cmpl nr_copy_pages,%eax
64         jb .L1455
65         .p2align 4,,7
66 .L1453:
67         movl $__USER_DS,%eax
68
69         movw %ax, %ds
70         movw %ax, %es
71         movl saved_context_esp, %esp
72         movl saved_context_ebp, %ebp
73         movl saved_context_eax, %eax
74         movl saved_context_ebx, %ebx
75         movl saved_context_ecx, %ecx
76         movl saved_context_edx, %edx
77         movl saved_context_esi, %esi
78         movl saved_context_edi, %edi
79         call restore_processor_state
80         pushl saved_context_eflags ; popfl
81         call swsusp_resume
82 .L1449:
83         popl %ebx
84         ret
85
86        .section .data.nosave
87 loop:
88        .quad 0
89 loop2:
90        .quad 0
91        .previous
92