summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2001-12-18 03:44:41 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2001-12-18 03:44:41 +0000
commit6fbd59e5a79f6f04b565a379745844c4aa62f773 (patch)
treec906d6c52328113601abeddf49bdd7275bb0e740 /lib
parent5b042f440adda7bc137437043f4d87ee3fc4bd6d (diff)
Software invoked traps should use the ST_ versions of the trap number
with the high bit of the trap number stripped per the V8 arch manual. The stack alignment code was broken. It tried to align to a 32 byte boundary (only 8 byte boundary is required) by first adding 15 bytes then masking. It could have aligned down. The minimum frame size was twice the size needed by allocating 8 bytes per saved value instead of the needed 4. This bug offset the bug in the stack alignment code.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/arch/sparc/uthread_machdep_asm.S8
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep_asm.S8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc_r/arch/sparc/uthread_machdep_asm.S b/lib/libc_r/arch/sparc/uthread_machdep_asm.S
index 52a41d472f8..4e85e368a31 100644
--- a/lib/libc_r/arch/sparc/uthread_machdep_asm.S
+++ b/lib/libc_r/arch/sparc/uthread_machdep_asm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_machdep_asm.S,v 1.2 2001/09/10 19:39:27 jason Exp $ */
+/* $OpenBSD: uthread_machdep_asm.S,v 1.3 2001/12/18 03:44:40 marc Exp $ */
/* David Leonard <d@csee.uq.edu.au>. Public domain. */
#include <machine/asm.h>
@@ -12,11 +12,11 @@
#ifdef __sparcv9__
#define flushw .word 0x81580000
#else
-#define flushw t T_FLUSHWIN
+#define flushw t ST_FLUSHWIN
#endif
-#define SA(x) (((x)+15)&(~0x1f))
-#define MINFRAME ((16+1+6)*8)
+#define SA(x) (((x)+7)&(~0x7))
+#define MINFRAME ((16+1+6)*4)
/* void _thread_switch(int newstate[2], int savestate[2], int flags); */
ENTRY(_thread_machdep_switch)
diff --git a/lib/libpthread/arch/sparc/uthread_machdep_asm.S b/lib/libpthread/arch/sparc/uthread_machdep_asm.S
index 52a41d472f8..4e85e368a31 100644
--- a/lib/libpthread/arch/sparc/uthread_machdep_asm.S
+++ b/lib/libpthread/arch/sparc/uthread_machdep_asm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_machdep_asm.S,v 1.2 2001/09/10 19:39:27 jason Exp $ */
+/* $OpenBSD: uthread_machdep_asm.S,v 1.3 2001/12/18 03:44:40 marc Exp $ */
/* David Leonard <d@csee.uq.edu.au>. Public domain. */
#include <machine/asm.h>
@@ -12,11 +12,11 @@
#ifdef __sparcv9__
#define flushw .word 0x81580000
#else
-#define flushw t T_FLUSHWIN
+#define flushw t ST_FLUSHWIN
#endif
-#define SA(x) (((x)+15)&(~0x1f))
-#define MINFRAME ((16+1+6)*8)
+#define SA(x) (((x)+7)&(~0x7))
+#define MINFRAME ((16+1+6)*4)
/* void _thread_switch(int newstate[2], int savestate[2], int flags); */
ENTRY(_thread_machdep_switch)