summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-10 18:29:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-10 18:29:50 +0000
commit250408aa4e67fb85dcdb632734d6b1e2dd978de6 (patch)
treea48ef93f128c1a04fd115967aa3d8aca19a25102
parentbe23bcbacd08115a114fccc4f382a356ab287017 (diff)
80386 specific fix for copyoutstr crossing a page boundary; drochner@zelux6.zel.kfa-juelich.de
-rw-r--r--sys/arch/i386/i386/locore.s7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index 2bf7c543eb7..1d06b7fd615 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.42 1998/02/26 20:53:23 weingart Exp $ */
+/* $OpenBSD: locore.s,v 1.43 1998/05/10 18:29:49 deraadt Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -1018,10 +1018,11 @@ ENTRY(copyoutstr)
2: /* Copy up to end of this page. */
subl %ecx,%edx # predecrement total count
- jnc 3f
+ jnc 6f
addl %edx,%ecx # ecx += (edx - ecx) = edx
xorl %edx,%edx
+6: pushl %eax # save PT index
3: decl %ecx
js 4f
lodsb
@@ -1030,11 +1031,13 @@ ENTRY(copyoutstr)
jnz 3b
/* Success -- 0 byte reached. */
+ addl $4,%esp # discard PT index
addl %ecx,%edx # add back residual for this page
xorl %eax,%eax
jmp copystr_return
4: /* Go to next page, if any. */
+ popl %eax # restore PT index
movl $NBPG,%ecx
incl %eax
testl %edx,%edx