14#define UNIT_TEST_NAME "EfiMpServiceProtocol Unit Test"
15#define UNIT_TEST_VERSION "0.1"
30 return gBS->LocateProtocol (&gEfiMpServiceProtocolGuid,
NULL, (VOID **)&MpServices->Protocol);
52 return MpServices.Protocol->GetNumberOfProcessors (MpServices.Protocol, NumberOfProcessors, NumberOfEnabledProcessors);
72 return MpServices.Protocol->GetProcessorInfo (MpServices.Protocol, ProcessorNumber, ProcessorInfoBuffer);
95 IN BOOLEAN SingleThread,
97 IN VOID *ProcedureArgument
100 return MpServices.Protocol->StartupAllAPs (MpServices.Protocol, Procedure, SingleThread,
NULL, TimeoutInMicroSeconds, ProcedureArgument,
NULL);
122 IN UINTN TimeoutInMicroSeconds,
123 IN VOID *ProcedureArgument
126 return MpServices.Protocol->StartupThisAP (MpServices.Protocol, Procedure, ProcessorNumber,
NULL, TimeoutInMicroSeconds, ProcedureArgument,
NULL);
143 IN BOOLEAN EnableOldBSP
146 return MpServices.Protocol->SwitchBSP (MpServices.Protocol, ProcessorNumber, EnableOldBSP);
165 IN UINT32 *HealthFlag
168 return MpServices.Protocol->EnableDisableAP (MpServices.Protocol, ProcessorNumber, EnableAP, HealthFlag);
186 return MpServices.Protocol->WhoAmI (MpServices.Protocol, ProcessorNumber);
203 UNIT_TEST_FRAMEWORK_HANDLE Framework;
207 Context.MpServices.Ppi =
NULL;
208 Context.CommonBuffer =
NULL;
209 Context.DisabledApNumber =
NULL;
211 DEBUG ((DEBUG_INFO,
"%a v%a\n", UNIT_TEST_NAME, UNIT_TEST_VERSION));
217 if (EFI_ERROR (Status)) {
218 DEBUG ((DEBUG_ERROR,
"Failed in InitUnitTestFramework. Status = %r\n", Status));
226 if (EFI_ERROR (Status)) {
227 DEBUG ((DEBUG_ERROR,
"Failed in AddCommonTestCase. Status = %r\n", Status));
237 if (Framework !=
NULL) {
EFI_STATUS AddCommonTestCase(IN UNIT_TEST_FRAMEWORK_HANDLE Framework)
EFI_STATUS MpServicesUnitTestWhoAmI(IN MP_SERVICES MpServices, OUT UINTN *ProcessorNumber)
EFI_STATUS MpServicesUnitTestGetProcessorInfo(IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer)
EFI_STATUS MpServicesUnitTestStartupAllAPs(IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
EFI_STATUS MpServicesUnitTestGetNumberOfProcessors(IN MP_SERVICES MpServices, OUT UINTN *NumberOfProcessors, OUT UINTN *NumberOfEnabledProcessors)
EFI_STATUS MpServicesUnitTestEnableDisableAP(IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag)
EFI_STATUS EFIAPI DxeEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS MpServicesUnitTestSwitchBSP(IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
EFI_STATUS EFIAPI EfiMpServiceProtocolUnitTest(VOID)
EFI_STATUS MpServicesUnitTestStartupThisAP(IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
EFI_STATUS MpServicesUnitTestGetMpServices(OUT MP_SERVICES *MpServices)
#define DEBUG(Expression)
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
EFI_STATUS EFIAPI RunAllTestSuites(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
EFI_STATUS EFIAPI FreeUnitTestFramework(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
EFI_STATUS EFIAPI InitUnitTestFramework(OUT UNIT_TEST_FRAMEWORK_HANDLE *FrameworkHandle, IN CHAR8 *Title, IN CHAR8 *ShortTitle, IN CHAR8 *VersionString)