2010-08-25 Gedare Bloom <giddyup44@yahoo.com>

PR 1688/libcpu
	* shared/score/interrupt.S: Fix bug in the sun4u _ISR_Dispatch code
	that ends up cloberring the global registers. It manifests primarily
	as a memory alignment error when the globals are used to read to/from
	memory.
This commit is contained in:
Joel Sherrill
2010-08-25 20:33:25 +00:00
parent 21e3de112c
commit ce3bfb7e47
2 changed files with 14 additions and 6 deletions

View File

@@ -1,3 +1,11 @@
2010-08-25 Gedare Bloom <giddyup44@yahoo.com>
PR 1688/libcpu
* shared/score/interrupt.S: Fix bug in the sun4u _ISR_Dispatch code
that ends up cloberring the global registers. It manifests primarily
as a memory alignment error when the globals are used to read to/from
memory.
2010-08-20 Gedare Bloom <giddyup44@yahoo.com> 2010-08-20 Gedare Bloom <giddyup44@yahoo.com>
PR 1681/cpukit PR 1681/cpukit

View File

@@ -357,7 +357,7 @@ PUBLIC(_ISR_Handler)
ldub [%g7], %o5 ldub [%g7], %o5
orcc %o5, %g0, %g0 ! Is thread switch necessary? orcc %o5, %g0, %g0 ! Is thread switch necessary?
bnz SYM(_ISR_Dispatch) ! yes, then invoke the dispatcher bz simple_return ! no, then do a simple return. otherwise fallthru
nop nop
/* /*
@@ -502,16 +502,16 @@ dispatchAgain:
ldx [%sp + STACK_BIAS + ISF_G6_OFFSET], %g6 ! restore g6 ldx [%sp + STACK_BIAS + ISF_G6_OFFSET], %g6 ! restore g6
ldx [%sp + STACK_BIAS + ISF_G7_OFFSET], %g7 ! restore g7 ldx [%sp + STACK_BIAS + ISF_G7_OFFSET], %g7 ! restore g7
! Assume the interrupted context is in TL 0 with GL 0 / normal globals.
! When tstate is restored at done/retry, the interrupted context is restored.
! return to TL[1], GL[1], and restore TSTATE, TPC, and TNPC ! return to TL[1], GL[1], and restore TSTATE, TPC, and TNPC
wrpr %g0, 1, %tl wrpr %g0, 1, %tl
! return to GL=1 or AG ! return to GL=1 or AG
#if defined(SUN4U) #if defined(SUN4U)
rdpr %pstate, %g1 rdpr %pstate, %o1
andn %g1, SPARC_PSTATE_AG_MASK, %g1 or %o1, SPARC_PSTATE_AG_MASK, %o1
wrpr %g1, %g0, %pstate ! go to regular global wrpr %o1, %g0, %pstate ! go to AG.
#elif defined(SUN4V) #elif defined(SUN4V)
wrpr %g0, 1, %gl wrpr %g0, 1, %gl
#endif #endif