X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPkg%2FDrivers%2FCpuDxe%2FException.c;h=9910bd2b881a5d730784f243cb63ed9446d70e9d;hp=fa256e60f84fd549387c9b511c3fa9c792b8b945;hb=d213712d4f858efd5cb43faa39c6d940829c9363;hpb=2ef2b01e07c02db339f34004445734a2dbdd80e1 diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c index fa256e60f8..9910bd2b88 100644 --- a/ArmPkg/Drivers/CpuDxe/Exception.c +++ b/ArmPkg/Drivers/CpuDxe/Exception.c @@ -120,7 +120,16 @@ RegisterDebuggerInterruptHandler ( return EFI_SUCCESS; } - +CHAR8 *gExceptionTypeString[] = { + "Reset", + "Undefined Instruction", + "SWI", + "Prefetch Abort", + "Data Abort", + "Undefined", + "IRQ", + "FIQ" +}; VOID EFIAPI @@ -130,7 +139,8 @@ CommonCExceptionHandler ( ) { BOOLEAN Dispatched = FALSE; - + + if (ExceptionType <= MAX_ARM_EXCEPTION) { if (gDebuggerExceptionHandlers[ExceptionType]) { // @@ -144,6 +154,9 @@ CommonCExceptionHandler ( gExceptionHandlers[ExceptionType] (ExceptionType, SystemContext); Dispatched = TRUE; } + } else { + DEBUG ((EFI_D_ERROR, "Unknown exception type %d from %08x\n", ExceptionType, SystemContext.SystemContextArm->PC)); + ASSERT (FALSE); } if (Dispatched) { @@ -163,7 +176,7 @@ CommonCExceptionHandler ( // // Code after here is the default exception handler... // - DEBUG ((EFI_D_ERROR, "Exception %d from %08x\n", ExceptionType, SystemContext.SystemContextArm->PC)); + DEBUG ((EFI_D_ERROR, "%a Exception from %08x\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC)); ASSERT (FALSE); } @@ -200,7 +213,7 @@ InitializeExceptions ( } // - // Copy an implementation of the ARM exception vectors to 0x0. + // Copy an implementation of the ARM exception vectors to PcdCpuVectorBaseAddress. // Length = (UINTN)ExceptionHandlersEnd - (UINTN)ExceptionHandlersStart; @@ -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 // EFI_NOT_FOUND, and continue in that case. if (EFI_ERROR(Status) && (Status != EFI_NOT_FOUND)) { - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR (Status); } CopyMem ((VOID *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress), (VOID *)ExceptionHandlersStart, Length); @@ -225,7 +238,7 @@ InitializeExceptions ( *(UINTN *) ((UINT8 *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress) + Offset) = (UINTN)AsmCommonExceptionEntry; // Flush Caches since we updated executable stuff - InvalidateInstructionCacheRange((VOID *)PcdGet32(PcdCpuVectorBaseAddress), Length); + InvalidateInstructionCacheRange ((VOID *)PcdGet32(PcdCpuVectorBaseAddress), Length); if (Enabled) { //