diff options
author | AJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-08 21:12:20 +0000 |
---|---|---|
committer | AJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-08 21:12:20 +0000 |
commit | 8a4d81e693ac9b47eda7dc276f5384f35f921328 (patch) | |
tree | a060ba1f9dc965c96cf7a015c2394150d1933320 /ArmPkg/Drivers/CpuDxe/Exception.c | |
parent | 05d612fd39430f73c44c9ec8ad0aba7fc4170caa (diff) | |
download | edk2-platforms-8a4d81e693ac9b47eda7dc276f5384f35f921328.tar.xz |
Adding support for a single stack, GCC check in will follow
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9697 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Drivers/CpuDxe/Exception.c')
-rw-r--r-- | ArmPkg/Drivers/CpuDxe/Exception.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c index fa256e60f8..8859ca8667 100644 --- a/ArmPkg/Drivers/CpuDxe/Exception.c +++ b/ArmPkg/Drivers/CpuDxe/Exception.c @@ -15,6 +15,8 @@ #include "CpuDxe.h"
#include <Library/CacheMaintenanceLib.h>
+extern BOOLEAN gExceptionContext;
+
VOID
ExceptionHandlersStart (
VOID
@@ -120,7 +122,16 @@ RegisterDebuggerInterruptHandler ( return EFI_SUCCESS;
}
-
+CHAR8 *gExceptionTypeString[] = {
+ "Reset",
+ "Undefined Instruction",
+ "SWI",
+ "Prefetch Abort",
+ "Data Abort",
+ "Undefined",
+ "IRQ",
+ "FIQ"
+};
VOID
EFIAPI
@@ -130,6 +141,8 @@ CommonCExceptionHandler ( )
{
BOOLEAN Dispatched = FALSE;
+
+ gExceptionContext = TRUE;
if (ExceptionType <= MAX_ARM_EXCEPTION) {
if (gDebuggerExceptionHandlers[ExceptionType]) {
@@ -144,8 +157,13 @@ 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);
}
+ gExceptionContext = FALSE;
+
if (Dispatched) {
//
// We did work so this was an expected ExceptionType
@@ -163,7 +181,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 +218,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 +231,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 +243,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) {
//
|