From 2ca815a4952ca3ef3bdb01f5dd2a1ee0a57ac319 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Fri, 4 Jul 2014 11:13:27 +0000 Subject: ArmPkg/ArmGic: Move out the EndOfInterrupt from the interrupt acknowledgement Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15619 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c | 8 +++++++- ArmPlatformPkg/PrePeiCore/MainMPCore.c | 8 +++++++- ArmPlatformPkg/PrePi/MainMPCore.c | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c b/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c index f8f91e8fcd..f42f518722 100755 --- a/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c +++ b/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.c @@ -31,6 +31,7 @@ NonSecureWaitForFirmware ( ) { VOID (*secondary_start)(VOID); + UINTN Interrupt; // The secondary cores will execute the firmware once wake from WFI. secondary_start = (VOID (*)())PcdGet32(PcdFvBaseAddress); @@ -38,7 +39,12 @@ NonSecureWaitForFirmware ( ArmCallWFI(); // Acknowledge the interrupt and send End of Interrupt signal. - ArmGicAcknowledgeInterrupt (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase), NULL, NULL); + Interrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase)); + // Check if it is a valid interrupt ID + if ((Interrupt & ARM_GIC_ICCIAR_ACKINTID) < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) { + // Got a valid SGI number hence signal End of Interrupt + ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), Interrupt); + } // Jump to secondary core entry point. secondary_start (); diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePeiCore/MainMPCore.c index 9bfc990628..69863de549 100644 --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c @@ -45,6 +45,7 @@ SecondaryMain ( UINT32 CoreId; VOID (*SecondaryStart)(VOID); UINTN SecondaryEntryAddr; + UINTN Interrupt; ClusterId = GET_CLUSTER_ID(MpId); CoreId = GET_CORE_ID(MpId); @@ -87,7 +88,12 @@ SecondaryMain ( SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress); // Acknowledge the interrupt and send End of Interrupt signal. - ArmGicAcknowledgeInterrupt (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase), NULL, NULL); + Interrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase)); + // Check if it is a valid interrupt ID + if ((Interrupt & ARM_GIC_ICCIAR_ACKINTID) < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) { + // Got a valid SGI number hence signal End of Interrupt + ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), Interrupt); + } } while (SecondaryEntryAddr == 0); // Jump to secondary core entry point. diff --git a/ArmPlatformPkg/PrePi/MainMPCore.c b/ArmPlatformPkg/PrePi/MainMPCore.c index 5868993d57..3db3ce6857 100644 --- a/ArmPlatformPkg/PrePi/MainMPCore.c +++ b/ArmPlatformPkg/PrePi/MainMPCore.c @@ -55,6 +55,7 @@ SecondaryMain ( UINT32 CoreId; VOID (*SecondaryStart)(VOID); UINTN SecondaryEntryAddr; + UINTN Interrupt; ClusterId = GET_CLUSTER_ID(MpId); CoreId = GET_CORE_ID(MpId); @@ -87,7 +88,12 @@ SecondaryMain ( SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress); // Acknowledge the interrupt and send End of Interrupt signal. - ArmGicAcknowledgeInterrupt (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase), NULL, NULL); + Interrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase)); + // Check if it is a valid interrupt ID + if ((Interrupt & ARM_GIC_ICCIAR_ACKINTID) < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) { + // Got a valid SGI number hence signal End of Interrupt + ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), Interrupt); + } } while (SecondaryEntryAddr == 0); // Jump to secondary core entry point. -- cgit v1.2.3