Specifications
A Minimal PowerPCª Boot Sequence for 23
Executing Compiled C Programs
Source Files
addis r1,r0,STACK_LOC@h // STACK_LOC defined in ppcinit.h
ori r1,r1,STACK_LOC@l
// make sure the word the stack pointer points to is NULL
addis r14,r0,0x0000
stw r14,0(r1)
// go to the C code
rfi
save_timebase:
// read time base, checking for rollover
mfspr r3,269
mfspr r4,268
mfspr r5,269
cmpw r5,r3
bne save_timebase
// save vals off
addis r5,0,TBUSAVE@h
ori r5,r5,TBUSAVE@l
stw r3,0(r5)
addis r5,0,TBLSAVE@h
ori r5,r5,TBLSAVE@l
stw r4,0(r5)
// done, go to an arbitrary address
done:
addis r3,0,0xfff0
ori r3,r3,0x0700
mtlr r3
blr
//
// Label: __eabi()
//
// Replaces standard __eabi(). This is a minimal __eabi, because we donÕt
// require anything to happen here other than setting up the SDA pointers.
//
__eabi:
// Get small data area locations as per PPC EABI
// See http://www.solutions.motorola.com/lit/manuals/eabispec.html
// for more information.
addis r13,r0,_SDA_BASE_@h
ori r13,r13,_SDA_BASE_@l
addis r2,r0,_SDA2_BASE_@h
ori r2,r2,_SDA2_BASE_@l
blr