summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-03 09:18:00 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-03 09:18:00 +0000
commiteeec69c5dc62460d2b256f3dee8097fb7afb34d5 (patch)
treee87b4c9097fb66c7c8c87cd8f279190ba8b94090 /ArmPkg
parent55fad965091e831e3a4fbe84e30f35fd9d454afc (diff)
downloadedk2-platforms-eeec69c5dc62460d2b256f3dee8097fb7afb34d5.tar.xz
ArmPkg: Introduce the PCD PcdDebuggerExceptionSupport
The Exception Vector can be set before installing the CPU DXE driver to add debugger support at the early stage of the firmware initialization. If no one has touched the exception vector prior to the CPU DXE then the Vector might contain non zero data. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11733 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/ArmPkg.dec3
-rw-r--r--ArmPkg/Drivers/CpuDxe/CpuDxe.inf1
-rw-r--r--ArmPkg/Drivers/CpuDxe/Exception.c5
3 files changed, 8 insertions, 1 deletions
diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 970fb04a2f..3273f6a524 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -52,6 +52,9 @@
# point the Exception Vector Table to its location in CpuDxe.
# By default we copy the Vector Table at PcdGet32(PcdCpuVectorBaseAddress)
gArmTokenSpaceGuid.PcdRelocateVectorTable|TRUE|BOOLEAN|0x00000022
+ # Set this PCD to TRUE if the Exception Vector is changed to add debugger support before
+ # it has been configured by the CPU DXE
+ gArmTokenSpaceGuid.PcdDebuggerExceptionSupport|FALSE|BOOLEAN|0x00000032
gArmTokenSpaceGuid.PcdEfiUncachedMemoryToStronglyOrdered|FALSE|BOOLEAN|0x00000025
gArmTokenSpaceGuid.PcdSkipPeiCore|FALSE|BOOLEAN|0x00000026
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf
index 25c0b880b2..e74de5b3e0 100644
--- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf
+++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf
@@ -73,6 +73,7 @@
[FeaturePcd.common]
gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport
gArmTokenSpaceGuid.PcdRelocateVectorTable
+ gArmTokenSpaceGuid.PcdDebuggerExceptionSupport
gArmTokenSpaceGuid.PcdEfiUncachedMemoryToStronglyOrdered
[depex]
diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c
index 21a4c035a9..7c59af7fef 100644
--- a/ArmPkg/Drivers/CpuDxe/Exception.c
+++ b/ArmPkg/Drivers/CpuDxe/Exception.c
@@ -162,8 +162,10 @@ InitializeExceptions (
ASSERT_EFI_ERROR (Status);
}
+ if (FeaturePcdGet(PcdDebuggerExceptionSupport) == TRUE) {
// Save existing vector table, in case debugger is already hooked in
CopyMem ((VOID *)gDebuggerExceptionHandlers, (VOID *)VectorBase, sizeof (gDebuggerExceptionHandlers));
+ }
// Copy our assembly code into the page that contains the exception vectors.
CopyMem ((VOID *)VectorBase, (VOID *)ExceptionHandlersStart, Length);
@@ -178,7 +180,8 @@ InitializeExceptions (
// Initialize the C entry points for interrupts
//
for (Index = 0; Index <= MAX_ARM_EXCEPTION; Index++) {
- if ((gDebuggerExceptionHandlers[Index] == 0) || (gDebuggerExceptionHandlers[Index] == (VOID *)(UINTN)0xEAFFFFFE)) {
+ if (!FeaturePcdGet(PcdDebuggerExceptionSupport) ||
+ (gDebuggerExceptionHandlers[Index] == 0) || (gDebuggerExceptionHandlers[Index] == (VOID *)(UINTN)0xEAFFFFFE)) {
// Exception handler contains branch to vector location (jmp $) so no handler
// NOTE: This code assumes vectors are ARM and not Thumb code
Status = RegisterInterruptHandler (Index, NULL);