[PATH] swsusp update 2/3

hugang
2004-11-22T17:15:39Z

On Mon, Nov 22, 2004 at 12:02:47PM +0100, Pavel Machek wrote:
> Hi!
>
> > > Yes, I'd like to get rid of "too many continuous pages" problem
> > > before. Small problem is that it needs to update x86-64 too, but I
> > I have not x86-64, so I have no chance to do it.
>
> I have access to x86-64, so I can do it...
> Pavel
> --
> People were complaining that M$ turns users into beta-testers...
> ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

--- linux-2.6.9-ppc-g4-peval/arch/i386/power/swsusp.S 2004-10-20 15:58:34.000000000 +0800
+++ linux-2.6.9-ppc-g4-peval-hg/arch/i386/power/swsusp.S 2004-11-22 17:17:19.000000000 +0800
@@ -31,25 +31,59 @@
movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
movl %ecx,%cr3

- movl pagedir_nosave, %ebx
- xorl %eax, %eax
- xorl %edx, %edx
+ mov pagedir_nosave, %edx
+ test %edx, %edx
+ mov %edx, swsusp_pbe_pgdir
+ je copy_loop_end
+
+copy_loop_start:
+ mov swsusp_pbe_pgdir, %edx
+ mov 0xc(%edx), %eax
+ mov %eax, swsusp_pbe_next
+ xor %eax, %eax
+ mov %eax, swsusp_pbe_nums
+
+ lea 0x0(%esi,1), %esi
+ lea 0x0(%edi,1), %edi
+ mov 0x4(%edx),%eax
+ test %eax, %eax
+ je copy_loop_end
.p2align 4,,7

-copy_loop:
- movl 4(%ebx,%edx),%edi
- movl (%ebx,%edx),%esi
-
- movl $1024, %ecx
- rep
- movsl
-
- incl %eax
- addl $16, %edx
- cmpl nr_copy_pages,%eax
- jb copy_loop
+copy_one_pgdir:
+ xor %ecx, %ecx
+ lea 0x0(%esi,1), %esi
.p2align 4,,7

+copy_one_page:
+ mov 0x4(%edx), %eax
+ mov (%edx), %edx
+ mov (%edx,%ecx,4), %edx
+ mov %edx,(%eax,%ecx,4)
+ inc %ecx
+ cmp $0x3ff, %ecx
+ ja copy_one_pgdir_end
+ mov swsusp_pbe_pgdir, %edx
+ jmp copy_one_page
+ .p2align 4,,7
+
+copy_one_pgdir_end:
+ mov swsusp_pbe_nums, %eax
+ mov swsusp_pbe_pgdir, %edx
+ inc %eax
+ mov %eax, swsusp_pbe_nums
+
+ add $0x10, %edx
+ cmp $0xfe, %eax
+ mov %edx, swsusp_pbe_pgdir
+
+ jbe copy_one_pgdir
+ mov swsusp_pbe_next, %eax
+ test %eax, %eax
+ mov %eax, swsusp_pbe_pgdir
+ jne copy_loop_start
+copy_loop_end:
+
movl saved_context_esp, %esp
movl saved_context_ebp, %ebp
movl saved_context_ebx, %ebx

--
--
Hu Gang / Steve
Linux Registered User 204016
GPG Public Key: http://soulinfo.com/~hugang/hugang.asc