From 6fbd59e5a79f6f04b565a379745844c4aa62f773 Mon Sep 17 00:00:00 2001 From: Marco S Hyman Date: Tue, 18 Dec 2001 03:44:41 +0000 Subject: 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. --- lib/libc_r/arch/sparc/uthread_machdep_asm.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libc_r/arch/sparc') 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 . Public domain. */ #include @@ -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) -- cgit v1.2.3