summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch/sparc
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2001-12-18 03:44:40 +0000
committermarc <marc@openbsd.org>2001-12-18 03:44:40 +0000
commita3845a5da3c867e0237c4264214efe1d74979b03 (patch)
tree8cbeb4aec60ecc86f929320db3080fd0e81ad93a /lib/libpthread/arch/sparc
parentanother errno save situation (diff)
downloadwireguard-openbsd-a3845a5da3c867e0237c4264214efe1d74979b03.tar.xz
wireguard-openbsd-a3845a5da3c867e0237c4264214efe1d74979b03.zip
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/libpthread/arch/sparc')
-rw-r--r--lib/libpthread/arch/sparc/uthread_machdep_asm.S8
1 files changed, 4 insertions, 4 deletions
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)