]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/CpuDxe/Exception.c
Updating ArmLib.h to add functions needed to turn on paging in CpuDxe. Also added...
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / Exception.c
index fa256e60f84fd549387c9b511c3fa9c792b8b945..9910bd2b881a5d730784f243cb63ed9446d70e9d 100644 (file)
@@ -120,7 +120,16 @@ RegisterDebuggerInterruptHandler (
   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
@@ -130,7 +139,8 @@ CommonCExceptionHandler (
   )\r
 {\r
   BOOLEAN Dispatched = FALSE;\r
-  \r
\r
\r
   if (ExceptionType <= MAX_ARM_EXCEPTION) {\r
     if (gDebuggerExceptionHandlers[ExceptionType]) {\r
       //\r
@@ -144,6 +154,9 @@ CommonCExceptionHandler (
       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
   if (Dispatched) {\r
@@ -163,7 +176,7 @@ CommonCExceptionHandler (
   //\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
@@ -200,7 +213,7 @@ InitializeExceptions (
   }\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
@@ -213,7 +226,7 @@ InitializeExceptions (
   // 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
@@ -225,7 +238,7 @@ InitializeExceptions (
   *(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