]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c
ArmPkg/ArmGic: Move out the EndOfInterrupt from the interrupt acknowledgement
[mirror_edk2.git] / ArmPlatformPkg / Library / DebugSecExtraActionLib / DebugSecExtraActionLib.c
index f8f91e8fcd8d483a040260c5e1becf48b74a5c1b..f42f51872240ca59b42b017856784d5001838bf9 100755 (executable)
@@ -31,6 +31,7 @@ NonSecureWaitForFirmware (
   )\r
 {\r
   VOID (*secondary_start)(VOID);\r
+  UINTN Interrupt;\r
 \r
   // The secondary cores will execute the firmware once wake from WFI.\r
   secondary_start = (VOID (*)())PcdGet32(PcdFvBaseAddress);\r
@@ -38,7 +39,12 @@ NonSecureWaitForFirmware (
   ArmCallWFI();\r
 \r
   // Acknowledge the interrupt and send End of Interrupt signal.\r
-  ArmGicAcknowledgeInterrupt (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase), NULL, NULL);\r
+  Interrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase));\r
+  // Check if it is a valid interrupt ID\r
+  if ((Interrupt & ARM_GIC_ICCIAR_ACKINTID) < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) {\r
+    // Got a valid SGI number hence signal End of Interrupt\r
+    ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), Interrupt);\r
+  }\r
 \r
   // Jump to secondary core entry point.\r
   secondary_start ();\r