[OpenBIOS] [commit] r1025 - trunk/openbios-devel/arch/sparc32

repository service svn at openbios.org
Sat Feb 12 17:28:06 CET 2011


Author: blueswirl
Date: Sat Feb 12 17:28:06 2011
New Revision: 1025
URL: http://tracker.coreboot.org/trac/openbios/changeset/1025

Log:
sparc32: fix __context corruption in __switch_context_nosave

__switch_context_nosave shall not write to __context, only read it.

Signed-off-by: Artyom Tarasenko <atar4qemu at gmail.com>
Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/sparc32/switch.S

Modified: trunk/openbios-devel/arch/sparc32/switch.S
==============================================================================
--- trunk/openbios-devel/arch/sparc32/switch.S	Tue Feb  8 23:06:59 2011	(r1024)
+++ trunk/openbios-devel/arch/sparc32/switch.S	Sat Feb 12 17:28:06 2011	(r1025)
@@ -79,11 +79,15 @@
 	set	(PSR_PS | PSR_S | PSR_PIL | PSR_EF), %g2
 	wr	%g2, 0x0, %psr
 #endif
-
+        set     __context, %g1
+        /* Swap ctx pointer with %fp and jump*/
+        ba     __set_context
+         swap      [%g1], %fp
 __switch_context_nosave:
-	set	__context, %g1
-        /* Swap ctx pointer with %fp */
-        swap      [%g1], %fp
+        set     __context, %g1
+        /* load %fp from ctx pointer */
+        ld      [%g1], %fp
+__set_context:
 	/* Load all registers */
         /* offset 0: %g0, no need to load */
         ld      [%fp + 4], %g1



More information about the OpenBIOS mailing list