From 33de2037f6007f6adf90514dbc98158a473476fc Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Thu, 17 Mar 2016 09:12:19 +0100 Subject: sparc: Fix window underflow trap handler The window underflow trap handler used %i5 which destroyed the %o5 of the calling context. Bug introduced by 0d3b5d47429effb350448d9e9123a67db722109f. Go back to the pre 0d3b5d47429effb350448d9e9123a67db722109f behaviour and use the two unused instructions in the trap vector to optimize a bit. Close #2651. --- c/src/lib/libbsp/sparc/shared/start/start.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c/src/lib/libbsp') diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S index f38fe8cb99..3d621fdcea 100644 --- a/c/src/lib/libbsp/sparc/shared/start/start.S +++ b/c/src/lib/libbsp/sparc/shared/start/start.S @@ -66,7 +66,7 @@ mov %wim, %l3 ; \ sethi %hi(_handler), %l4 ; \ jmp %l4+%lo(_handler); \ - mov %g0, %wim ! WIM = 0, so that we can restore regardless of WIM + sll %l3, 1, %l4 ! l4 = WIM << 1 /* * Software trap. Treat as BAD_TRAP for the time being... -- cgit v1.2.3