2008-07-16 Till Straumann <strauman@slac.stanford.edu>

* new-exceptions/cpu.c: propagate R2 to all task contexts
	even if the ABI is SVR4. Cannot hurt...
This commit is contained in:
Till Straumann
2008-07-16 22:04:06 +00:00
parent d60239f6c8
commit 6ce3f7b7e2
2 changed files with 13 additions and 2 deletions

View File

@@ -126,9 +126,15 @@ void _CPU_Context_Initialize(
the_context->pc = (uint32_t)entry_point;
#if (PPC_ABI == PPC_ABI_SVR4)
{ unsigned r13 = 0;
asm volatile ("mr %0, 13" : "=r" ((r13)));
/*
* SVR4 says R2 is for 'system-reserved' use; it cannot hurt to
* propagate R2 to all task contexts.
*/
{ uint32_t r2 = 0;
unsigned r13 = 0;
asm volatile ("mr %0,2; mr %1,13" : "=r" ((r2)), "=r" ((r13)));
the_context->gpr2 = r2;
the_context->gpr13 = r13;
}
#elif (PPC_ABI == PPC_ABI_EABI)