2003-03-18 Till Straumann <strauman@slac.stanford.edu>

PR 356/bsps
	* cpu.c: This patch makes RTEMS/PowerPC eabi compliant.
This commit is contained in:
Joel Sherrill
2003-03-18 19:22:55 +00:00
parent 6ac7a12b3f
commit 9cfccae23f
2 changed files with 26 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
2003-03-18 Till Straumann <strauman@slac.stanford.edu>
PR 356/bsps
* cpu.c: This patch makes RTEMS/PowerPC eabi compliant.
2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Remove AC_CONFIG_AUX_DIR.

View File

@@ -70,6 +70,9 @@ void _CPU_Context_Initialize(
unsigned32 sp;
sp = (unsigned32)stack_base + size - CPU_MINIMUM_STACK_FRAME_SIZE;
sp &= ~(CPU_STACK_ALIGNMENT-1);
*((unsigned32 *)sp) = 0;
the_context->gpr1 = sp;
@@ -109,6 +112,24 @@ void _CPU_Context_Initialize(
#endif
the_context->pc = (unsigned32)entry_point;
#if (PPC_ABI == PPC_ABI_SVR4)
{ unsigned r13 = 0;
asm volatile ("mr %0, 13" : "=r" ((r13)));
the_context->gpr13 = r13;
}
#elif (PPC_ABI == PPC_ABI_EABI)
{ unsigned32 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;
}
#else
#error unsupported PPC_ABI
#endif
}