mirror of https://github.com/acidanthera/audk.git
Sync with ARMASM version.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10172 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1fc17d768f
commit
97e9818a67
|
@ -39,8 +39,7 @@ ASM_PFX(_ModuleEntryPoint):
|
||||||
// Set CPU vectors to start of DRAM
|
// Set CPU vectors to start of DRAM
|
||||||
mov r0, #0x80000000
|
mov r0, #0x80000000
|
||||||
mcr p15, 0, r0, c12, c0, 0
|
mcr p15, 0, r0, c12, c0, 0
|
||||||
|
/* before we call C code, lets setup the stack pointer in internal RAM*/
|
||||||
/* before we call C code, lets setup the stack pointer */
|
|
||||||
stack_pointer_setup:
|
stack_pointer_setup:
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -51,44 +50,17 @@ stack_pointer_setup:
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) /* stack size arg3 */
|
LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) /* stack size arg3 */
|
||||||
add r4, r2, r3
|
add r4, r2, r3
|
||||||
|
|
||||||
//Enter IRQ mode and set up IRQ stack pointer
|
|
||||||
mov r0,#0x12|0x80|0x40
|
|
||||||
msr CPSR_c,r0
|
|
||||||
mov r13,r4
|
|
||||||
|
|
||||||
//Enter Abort mode and set up Abort stack pointer
|
|
||||||
mov r0,#0x17|0x80|0x40
|
|
||||||
msr CPSR_c,r0
|
|
||||||
sub r4, r4, #0x400
|
|
||||||
mov r13,r4
|
|
||||||
|
|
||||||
//Enter Undefined mode and set up Undefined stack pointer
|
|
||||||
mov r0,#0x1b|0x80|0x40
|
|
||||||
msr CPSR_c,r0
|
|
||||||
sub r4, r4, #0x400
|
|
||||||
mov r13,r4
|
|
||||||
|
|
||||||
//Enter SVC mode and set up SVC stack pointer
|
//Enter SVC mode and set up SVC stack pointer
|
||||||
mov r0,#0x13|0x80|0x40
|
mov r0,#0x13|0x80|0x40
|
||||||
msr CPSR_c,r0
|
msr CPSR_c,r0
|
||||||
sub r4, r4, #0x400
|
|
||||||
mov r13,r4
|
|
||||||
|
|
||||||
//Enter System mode and set up System stack pointer
|
|
||||||
mov r0,#0x1f|0x80|0x40
|
|
||||||
msr CPSR_c,r0
|
|
||||||
sub r4, r4, #0x400
|
|
||||||
mov r13,r4
|
mov r13,r4
|
||||||
|
|
||||||
// Call C entry point
|
// Call C entry point
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) /* memory size arg1 */
|
LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) /* memory size arg1 */
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) /* memory size arg0 */
|
LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) /* memory size arg0 */
|
||||||
|
blx ASM_PFX(CEntryPoint) /* Assume C code is thumb */
|
||||||
|
|
||||||
blx ASM_PFX(CEntryPoint) /* Assume C code is ARM */
|
|
||||||
|
|
||||||
ShouldNeverGetHere:
|
ShouldNeverGetHere:
|
||||||
/* _CEntryPoint should never return */
|
/* _CEntryPoint should never return */
|
||||||
b ShouldNeverGetHere
|
b ShouldNeverGetHere
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue