// Clear Secondary cores MailBox\r
MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress, ArmCoreInfoTable[Index].MailboxClearValue);\r
\r
- SecondaryEntryAddr = 0;\r
- while (SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress), SecondaryEntryAddr == 0) {\r
+ do {\r
ArmCallWFI ();\r
+\r
+ // Read the Mailbox\r
+ SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress);\r
+\r
// Acknowledge the interrupt and send End of Interrupt signal.\r
- ArmGicAcknowledgeSgiFrom (PcdGet32(PcdGicInterruptInterfaceBase), PRIMARY_CORE_ID);\r
- }\r
+ ArmGicAcknowledgeInterrupt (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase), NULL, NULL);\r
+ } while (SecondaryEntryAddr == 0);\r
\r
// Jump to secondary core entry point.\r
SecondaryStart = (VOID (*)())SecondaryEntryAddr;\r
CreatePpiList (&PpiListSize, &PpiList);\r
\r
// Enable the GIC Distributor\r
- ArmGicEnableDistributor(PcdGet32(PcdGicDistributorBase));\r
+ ArmGicEnableDistributor (PcdGet32(PcdGicDistributorBase));\r
\r
// If ArmVe has not been built as Standalone then we need to wake up the secondary cores\r
if (FeaturePcdGet (PcdSendSgiToBringUpSecondaryCores)) {\r
SecCoreData.StackSize = (TemporaryRamBase + TemporaryRamSize) - (UINTN)SecCoreData.StackBase;\r
\r
// Jump to PEI core entry point\r
- (PeiCoreEntryPoint)(&SecCoreData, PpiList);\r
+ PeiCoreEntryPoint (&SecCoreData, PpiList);\r
}\r