summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-08-20 12:57:55 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-08-20 12:57:55 +0000
commitce3c33487a1d2c463fbb6115187c48fc316a4ab6 (patch)
tree67b5b055e8f19ad2196b7f071ebc22fa8414aa4c /sys/arch/sparc
parent2b2b78618974c0310c41157dcc989f9df589e73b (diff)
Because of reversed use of the annul bit and delay slots copyin and
copyout could underflow by one byte and write a \0 where is doesn't belong. Don't try to micro-optimize the failure case of copyin and copyout. It's not worth the bugs. miod@ ok
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/sparc/locore.s14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s
index 2da7a43bffc..82b55c609d3 100644
--- a/sys/arch/sparc/sparc/locore.s
+++ b/sys/arch/sparc/sparc/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.54 2002/08/12 00:55:01 art Exp $ */
+/* $OpenBSD: locore.s,v 1.55 2002/08/20 12:57:54 art Exp $ */
/* $NetBSD: locore.s,v 1.73 1997/09/13 20:36:48 pk Exp $ */
/*
@@ -4220,17 +4220,19 @@ Lcsdone: ! done:
Lcsfaulti:
cmp %o1, %o5 ! did we write to the string?
- be,a 1f
- deccc %o1
+ be 1f
+ nop
+ deccc %o1 ! --toaddr
1:
- stb %g0, [%o1] ! *--toaddr = '\0';
+ stb %g0, [%o1] ! *toaddr = '\0';
b Lcsdone ! error = EFAULT;
mov EFAULT, %o0 ! goto ret;
Lcsfaulto:
cmp %o1, %o5 ! did we write to the string?
- be,a 1f
- deccc %o1
+ be 1f
+ nop
+ deccc %o1
stb %g0, [%o1] ! *--toaddr = '\0';
1:
b Lcsdone ! error = EFAULT;