-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
stmfd SP!,{LR} @ Store the link register for the current mode\r
sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} @ Store the register state\r
- \r
+\r
mov R0,#0\r
ldr R1,ASM_PFX(CommonExceptionEntry)\r
bx R1\r
\r
ASM_PFX(AsmCommonExceptionEntry):\r
mrc p15, 0, R1, c6, c0, 2 @ Read IFAR\r
- str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 @ Read IFSR\r
str R1, [SP, #0x4c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 @ Read DFAR\r
str R1, [SP, #0x48] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 @ Read DFSR\r
str R1, [SP, #0x44] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] @ Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
and r1, r1, #0x1f @ Check to see if User or System Mode\r
cmp r1, #0x1f\r
ldmneed r2, {lr}^ @ User or System mode, use unbanked register\r
ldmneed r2, {lr} @ All other modes used banked register\r
\r
- ldr R1, [SP, #0x58] @ PC is the LR pushed by srsdb \r
+ ldr R1, [SP, #0x58] @ PC is the LR pushed by srsdb\r
str R1, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
- sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack \r
+\r
+ sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack\r
str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- @ R0 is exception type \r
+\r
+ @ R0 is exception type\r
mov R1,SP @ Prepare System Context pointer as an argument for the exception handler\r
blx ASM_PFX(CommonCExceptionHandler) @ Call exception handler\r
- \r
+\r
ldr R2,[SP,#0x40] @ EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R2,[SP,#0x5c] @ Store it back to srsdb stack slot so it can be restored \r
+ str R2,[SP,#0x5c] @ Store it back to srsdb stack slot so it can be restored\r
\r
ldr R2,[SP,#0x3c] @ EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R2,[SP,#0x58] @ Store it back to srsdb stack slot so it can be restored \r
+ str R2,[SP,#0x58] @ Store it back to srsdb stack slot so it can be restored\r
\r
ldmfd SP!,{R0-R12} @ Restore general purpose registers\r
@ Exception handler can not change SP or LR as we would blow chunks\r
- \r
+\r
add SP,SP,#0x20 @ Clear out the remaining stack space\r
ldmfd SP!,{LR} @ restore the link register for this context\r
rfefd SP! @ return from exception via srsdb stack slot\r