mcr p15, 0, r0, c1, c0, 0\r
\r
// Set CPU vectors to start of DRAM\r
- mov r0, #0x80000000\r
+ LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base\r
mcr p15, 0, r0, c12, c0, 0\r
isb // Sync changes to control registers\r
\r
- /* before we call C code, lets setup the stack pointer in internal RAM*/\r
+ // Fill vector table with branchs to current pc (jmp $)\r
+ ldr r1, ShouldNeverGetHere\r
+ movs r2, #0\r
+FillVectors:\r
+ str r1, [r0, r2]\r
+ adds r2, r2, #4\r
+ cmp r2, #32\r
+ bne FillVectors\r
+ \r
+ /* before we call C code, lets setup the stack pointer in internal RAM */\r
stack_pointer_setup:\r
\r
//\r