summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/CpuDxe/Exception.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg/Drivers/CpuDxe/Exception.c')
-rw-r--r--ArmPkg/Drivers/CpuDxe/Exception.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c
index d99d3d1d01..f795c431a2 100644
--- a/ArmPkg/Drivers/CpuDxe/Exception.c
+++ b/ArmPkg/Drivers/CpuDxe/Exception.c
@@ -178,17 +178,24 @@ InitializeExceptions (
UINTN Offset;
UINTN Length;
UINTN Index;
- BOOLEAN Enabled;
+ BOOLEAN IrqEnabled;
+ BOOLEAN FiqEnabled;
EFI_PHYSICAL_ADDRESS Base;
UINT32 *VectorBase;
//
// Disable interrupts
//
- Cpu->GetInterruptState (Cpu, &Enabled);
+ Cpu->GetInterruptState (Cpu, &IrqEnabled);
Cpu->DisableInterrupt (Cpu);
-
+ //
+ // EFI does not use the FIQ, but a debugger might so we must disable
+ // as we take over the exception vectors.
+ //
+ FiqEnabled = ArmGetFiqState ();
+ ArmDisableFiq ();
+
//
// Copy an implementation of the ARM exception vectors to PcdCpuVectorBaseAddress.
//
@@ -236,7 +243,11 @@ InitializeExceptions (
// Flush Caches since we updated executable stuff
InvalidateInstructionCacheRange ((VOID *)PcdGet32(PcdCpuVectorBaseAddress), Length);
- if (Enabled) {
+ if (FiqEnabled) {
+ ArmEnableFiq ();
+ }
+
+ if (IrqEnabled) {
//
// Restore interrupt state
//