#include "CpuDxe.h" \r
#include <Library/CacheMaintenanceLib.h>\r
\r
+extern BOOLEAN gExceptionContext;\r
+\r
VOID\r
ExceptionHandlersStart (\r
VOID\r
return EFI_SUCCESS;\r
}\r
\r
-\r
+CHAR8 *gExceptionTypeString[] = {\r
+ "Reset",\r
+ "Undefined Instruction",\r
+ "SWI",\r
+ "Prefetch Abort",\r
+ "Data Abort",\r
+ "Undefined",\r
+ "IRQ",\r
+ "FIQ"\r
+};\r
\r
VOID\r
EFIAPI\r
)\r
{\r
BOOLEAN Dispatched = FALSE;\r
+ \r
+ gExceptionContext = TRUE; \r
\r
if (ExceptionType <= MAX_ARM_EXCEPTION) {\r
if (gDebuggerExceptionHandlers[ExceptionType]) {\r
gExceptionHandlers[ExceptionType] (ExceptionType, SystemContext);\r
Dispatched = TRUE;\r
}\r
+ } else {\r
+ DEBUG ((EFI_D_ERROR, "Unknown exception type %d from %08x\n", ExceptionType, SystemContext.SystemContextArm->PC));\r
+ ASSERT (FALSE);\r
}\r
\r
+ gExceptionContext = FALSE; \r
+\r
if (Dispatched) {\r
//\r
// We did work so this was an expected ExceptionType\r
//\r
// Code after here is the default exception handler...\r
//\r
- DEBUG ((EFI_D_ERROR, "Exception %d from %08x\n", ExceptionType, SystemContext.SystemContextArm->PC));\r
+ DEBUG ((EFI_D_ERROR, "%a Exception from %08x\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC));\r
ASSERT (FALSE);\r
\r
}\r
}\r
\r
//\r
- // Copy an implementation of the ARM exception vectors to 0x0.\r
+ // Copy an implementation of the ARM exception vectors to PcdCpuVectorBaseAddress.\r
//\r
Length = (UINTN)ExceptionHandlersEnd - (UINTN)ExceptionHandlersStart;\r
\r
// on embedded systems, for example, we don't want to hang up. So we'll check here for a status of \r
// EFI_NOT_FOUND, and continue in that case.\r
if (EFI_ERROR(Status) && (Status != EFI_NOT_FOUND)) {\r
- ASSERT_EFI_ERROR (Status);\r
+ ASSERT_EFI_ERROR (Status);\r
}\r
\r
CopyMem ((VOID *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress), (VOID *)ExceptionHandlersStart, Length);\r
*(UINTN *) ((UINT8 *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress) + Offset) = (UINTN)AsmCommonExceptionEntry;\r
\r
// Flush Caches since we updated executable stuff\r
- InvalidateInstructionCacheRange((VOID *)PcdGet32(PcdCpuVectorBaseAddress), Length);\r
+ InvalidateInstructionCacheRange ((VOID *)PcdGet32(PcdCpuVectorBaseAddress), Length);\r
\r
if (Enabled) {\r
// \r