TianoCore EDK2 master
Loading...
Searching...
No Matches
EfiMpServicesUnitTestCommom.h File Reference

Go to the source code of this file.

Data Structures

union  MP_SERVICES
 
struct  MP_SERVICE_UT_CONTEXT
 

Macros

#define RUN_PROCEDURE_TIMEOUT_VALUE   100000
 

Functions

EFI_STATUS MpServicesUnitTestGetMpServices (OUT MP_SERVICES *MpServices)
 
EFI_STATUS MpServicesUnitTestGetNumberOfProcessors (IN MP_SERVICES MpServices, OUT UINTN *NumberOfProcessors, OUT UINTN *NumberOfEnabledProcessors)
 
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 MpServicesUnitTestStartupThisAP (IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
 
EFI_STATUS MpServicesUnitTestSwitchBSP (IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
 
EFI_STATUS MpServicesUnitTestEnableDisableAP (IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag)
 
EFI_STATUS MpServicesUnitTestWhoAmI (IN MP_SERVICES MpServices, OUT UINTN *ProcessorNumber)
 
VOID EmptyProcedure (IN OUT VOID *Buffer)
 
VOID StoreCpuNumbers (IN OUT VOID *Buffer)
 
UNIT_TEST_STATUS EFIAPI InitUTContext (IN UNIT_TEST_CONTEXT Context)
 
VOID EFIAPI CheckUTContext (IN UNIT_TEST_CONTEXT Context)
 
VOID EFIAPI FreeUTContext (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestWhoAmI1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors3 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestEnableDisableAP3 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupThisAP1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupThisAP2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupThisAP3 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupThisAP4 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs3 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs4 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestStartupAllAPs5 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSwitchBSP1 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSwitchBSP2 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSwitchBSP3 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSwitchBSP4 (IN UNIT_TEST_CONTEXT Context)
 
EFI_STATUS AddCommonTestCase (IN UNIT_TEST_FRAMEWORK_HANDLE Framework, IN MP_SERVICE_UT_CONTEXT *Context)
 

Detailed Description

Common header file for EdkiiPeiMpServices2Ppi and EfiMpServiceProtocol unit test.

Copyright (c) 2022, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EfiMpServicesUnitTestCommom.h.

Macro Definition Documentation

◆ RUN_PROCEDURE_TIMEOUT_VALUE

#define RUN_PROCEDURE_TIMEOUT_VALUE   100000

Definition at line 23 of file EfiMpServicesUnitTestCommom.h.

Function Documentation

◆ AddCommonTestCase()

EFI_STATUS AddCommonTestCase ( IN UNIT_TEST_FRAMEWORK_HANDLE  Framework,
IN MP_SERVICE_UT_CONTEXT Context 
)

Create test suite and unit tests for both EdkiiPeiMpServices2Ppi and EfiMpServiceProtocol.

Parameters
[in]FrameworkA pointer to the framework that is being persisted.
[in]ContextA pointer to the private data buffer.
Return values
EFI_SUCCESSCreate test suite and unit tests successfully.
OthersCreate test suite and unit tests unsuccessfully.

Definition at line 1661 of file EfiMpServicesUnitTestCommom.c.

◆ CheckUTContext()

VOID EFIAPI CheckUTContext ( IN UNIT_TEST_CONTEXT  Context)

Cleanup routine for Unit test function. If any processor is disabled unexpectedly then reenable it.

Parameters
[in]ContextContext pointer for this test.

Definition at line 117 of file EfiMpServicesUnitTestCommom.c.

◆ EmptyProcedure()

VOID EmptyProcedure ( IN OUT VOID *  Buffer)

Empty procedure to be run on specified CPU.

Parameters
[in,out]BufferThe pointer to private data buffer.

Definition at line 311 of file EfiMpServicesUnitTestCommom.c.

◆ FreeUTContext()

VOID EFIAPI FreeUTContext ( IN UNIT_TEST_CONTEXT  Context)

Cleanup routine for Unit test function. It will be called by the last "AddTestCase" to restore AP state and free pointer.

Parameters
[in]ContextContext pointer for this test.

Definition at line 187 of file EfiMpServicesUnitTestCommom.c.

◆ InitUTContext()

UNIT_TEST_STATUS EFIAPI InitUTContext ( IN UNIT_TEST_CONTEXT  Context)

Prep routine for Unit test function. To save the ProcessorNumber of disabled AP and temporarily enable it.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDPrep routine runs successful.
UNIT_TEST_ERROR_TEST_FAILEDPrep routine runs unsuccessful.

Definition at line 23 of file EfiMpServicesUnitTestCommom.c.

◆ MpServicesUnitTestEnableDisableAP()

EFI_STATUS MpServicesUnitTestEnableDisableAP ( IN MP_SERVICES  MpServices,
IN UINTN  ProcessorNumber,
IN BOOLEAN  EnableAP,
IN UINT32 *  HealthFlag 
)

Caller enables or disables an AP from this point onward.

Parameters
[in]MpServicesMP_SERVICES structure.
[in]ProcessorNumberThe handle number of the AP.
[in]EnableAPSpecifies the new state for the processor for enabled, FALSE for disabled.
[in]HealthFlagIf not NULL, a pointer to a value that specifies the new health status of the AP.
Return values
EFI_SUCCESSCaller enables or disables an AP successfully.
OthersCaller enables or disables an AP unsuccessfully.

Definition at line 161 of file EdkiiPeiMpServices2PpiUnitTest.c.

◆ MpServicesUnitTestGetMpServices()

EFI_STATUS MpServicesUnitTestGetMpServices ( OUT MP_SERVICES MpServices)

Get EFI_MP_SERVICES_PROTOCOL pointer.

Parameters
[out]MpServicesPointer to the buffer where EFI_MP_SERVICES_PROTOCOL is stored
Return values
EFI_SUCCESSEFI_MP_SERVICES_PROTOCOL interface is returned
EFI_NOT_FOUNDEFI_MP_SERVICES_PROTOCOL interface is not found

Get EDKII_PEI_MP_SERVICES2_PPI pointer.

Parameters
[out]MpServicesPointer to the buffer where EDKII_PEI_MP_SERVICES2_PPI is stored.
Return values
EFI_SUCCESSEDKII_PEI_MP_SERVICES2_PPI interface is returned
EFI_NOT_FOUNDEDKII_PEI_MP_SERVICES2_PPI interface is not found

Definition at line 26 of file EdkiiPeiMpServices2PpiUnitTest.c.

◆ MpServicesUnitTestGetNumberOfProcessors()

EFI_STATUS MpServicesUnitTestGetNumberOfProcessors ( IN MP_SERVICES  MpServices,
OUT UINTN NumberOfProcessors,
OUT UINTN NumberOfEnabledProcessors 
)

Retrieve the number of logical processor in the platform and the number of those logical processors that are enabled on this boot.

Parameters
[in]MpServicesMP_SERVICES structure.
[out]NumberOfProcessorsPointer to the total number of logical processors in the system, including the BSP and disabled APs.
[out]NumberOfEnabledProcessorsPointer to the number of processors in the system that are enabled.
Return values
EFI_SUCCESSRetrieve the number of logical processor successfully
OthersRetrieve the number of logical processor unsuccessfully

Definition at line 51 of file DxeCpuExceptionHandlerUnitTest.c.

◆ MpServicesUnitTestGetProcessorInfo()

EFI_STATUS MpServicesUnitTestGetProcessorInfo ( IN MP_SERVICES  MpServices,
IN UINTN  ProcessorNumber,
OUT EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer 
)

Get detailed information on the requested logical processor.

Parameters
[in]MpServicesMP_SERVICES structure.
[in]ProcessorNumberThe handle number of the processor.
[out]ProcessorInfoBufferPointer to the buffer where the processor information is stored.
Return values
EFI_SUCCESSGet information on the requested logical processor successfully
OthersGet information on the requested logical processor unsuccessfully

Definition at line 66 of file EdkiiPeiMpServices2PpiUnitTest.c.

◆ MpServicesUnitTestStartupAllAPs()

EFI_STATUS MpServicesUnitTestStartupAllAPs ( IN MP_SERVICES  MpServices,
IN EFI_AP_PROCEDURE  Procedure,
IN BOOLEAN  SingleThread,
IN UINTN  TimeoutInMicroSeconds,
IN VOID *  ProcedureArgument 
)

Execute a caller provided function on all enabled APs.

Parameters
[in]MpServicesMP_SERVICES structure.
[in]ProcedurePointer to the function to be run on enabled APs of the system.
[in]SingleThreadIf TRUE, then all the enabled APs execute the function specified by Procedure one by one, in ascending order of processor handle number. If FALSE, then all the enabled APs execute the function specified by Procedure simultaneously.
[in]TimeoutInMicroSecondsIndicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
Return values
EFI_SUCCESSExecute a caller provided function on all enabled APs successfully
OthersExecute a caller provided function on all enabled APs unsuccessfully

Definition at line 121 of file DxeCpuExceptionHandlerUnitTest.c.

◆ MpServicesUnitTestStartupThisAP()

EFI_STATUS MpServicesUnitTestStartupThisAP ( IN MP_SERVICES  MpServices,
IN EFI_AP_PROCEDURE  Procedure,
IN UINTN  ProcessorNumber,
IN UINTN  TimeoutInMicroSeconds,
IN VOID *  ProcedureArgument 
)

Caller gets one enabled AP to execute a caller-provided function.

Parameters
[in]MpServicesMP_SERVICES structure.
[in]ProcedurePointer to the function to be run on enabled APs of the system.
[in]ProcessorNumberThe handle number of the AP.
[in]TimeoutInMicroSecondsIndicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
Return values
EFI_SUCCESSCaller gets one enabled AP to execute a caller-provided function successfully
OthersCaller gets one enabled AP to execute a caller-provided function unsuccessfully

Definition at line 93 of file DxeCpuExceptionHandlerUnitTest.c.

◆ MpServicesUnitTestSwitchBSP()

EFI_STATUS MpServicesUnitTestSwitchBSP ( IN MP_SERVICES  MpServices,
IN UINTN  ProcessorNumber,
IN BOOLEAN  EnableOldBSP 
)

Switch the requested AP to be the BSP from that point onward.

Parameters
[in]MpServicesMP_SERVICES structure.
[in]ProcessorNumberThe handle number of AP that is to become the new BSP.
[in]EnableOldBSPIf TRUE, the old BSP will be listed as an enabled AP. Otherwise, it will be disabled.
Return values
EFI_SUCCESSSwitch the requested AP to be the BSP successfully
OthersSwitch the requested AP to be the BSP unsuccessfully

Definition at line 140 of file EdkiiPeiMpServices2PpiUnitTest.c.

◆ MpServicesUnitTestWhoAmI()

EFI_STATUS MpServicesUnitTestWhoAmI ( IN MP_SERVICES  MpServices,
OUT UINTN ProcessorNumber 
)

Get the handle number for the calling processor.

Parameters
[in]MpServicesMP_SERVICES structure.
[out]ProcessorNumberThe handle number for the calling processor.
Return values
EFI_SUCCESSGet the handle number for the calling processor successfully.
OthersGet the handle number for the calling processor unsuccessfully.

Definition at line 70 of file DxeCpuExceptionHandlerUnitTest.c.

◆ StoreCpuNumbers()

VOID StoreCpuNumbers ( IN OUT VOID *  Buffer)

Produce to store ProcessorNumber in CommonBuffer and be run on specified CPU.

Parameters
[in,out]BufferThe pointer to private data buffer.

Produce to store ProcessorNumber in the corresponding location of CommonBuffer.

Parameters
[in,out]BufferThe pointer to private data buffer.

Definition at line 234 of file EfiMpServicesUnitTestCommom.c.

◆ TestEnableDisableAP1()

UNIT_TEST_STATUS EFIAPI TestEnableDisableAP1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service EnableDisableAP. When called with BSP number, the return status should be EFI_INVALID_PARAMETER. When called with a nonexistent processor handle, the return status should be EFI_NOT_FOUND. The AP should be really Enable/Disabled.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 774 of file EfiMpServicesUnitTestCommom.c.

◆ TestEnableDisableAP2()

UNIT_TEST_STATUS EFIAPI TestEnableDisableAP2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service EnableDisableAP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 842 of file EfiMpServicesUnitTestCommom.c.

◆ TestEnableDisableAP3()

UNIT_TEST_STATUS EFIAPI TestEnableDisableAP3 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service EnableDisableAP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 885 of file EfiMpServicesUnitTestCommom.c.

◆ TestGetNumberOfProcessors1()

UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service GetNumberOfProcessors. NumberOfProcessors should be greater that 0 and not less than NumberOfEnabledProcessors.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 518 of file EfiMpServicesUnitTestCommom.c.

◆ TestGetNumberOfProcessors2()

UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service GetNumberOfProcessors. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 552 of file EfiMpServicesUnitTestCommom.c.

◆ TestGetNumberOfProcessors3()

UNIT_TEST_STATUS EFIAPI TestGetNumberOfProcessors3 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service GetNumberOfProcessors. Call EnableDisableAP() to change the number of enabled AP.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 595 of file EfiMpServicesUnitTestCommom.c.

◆ TestGetProcessorInfo1()

UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service GetProcessorInfo. When all the parameters are valid, all reserved bits of StatusFlag in ProcessorInfoBuffer should be set to zero. When all the parameters are valid, the StatusFlag should not have an invalid value (The BSP can never be in the disabled state.). When called with nonexistent processor handle, the return status should be EFI_NOT_FOUND.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 682 of file EfiMpServicesUnitTestCommom.c.

◆ TestGetProcessorInfo2()

UNIT_TEST_STATUS EFIAPI TestGetProcessorInfo2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service GetProcessorInfo. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 729 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupAllAPs1()

UNIT_TEST_STATUS EFIAPI TestStartupAllAPs1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupAllAPs. All APs should execute the Procedure when called by StartupAllAPs.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1157 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupAllAPs2()

UNIT_TEST_STATUS EFIAPI TestStartupAllAPs2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupAllAPs. When called in single thread, the return status should be EFI_SUCCESS and AP executes in ascending order of processor handle number.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1200 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupAllAPs3()

UNIT_TEST_STATUS EFIAPI TestStartupAllAPs3 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupAllAPs. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1246 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupAllAPs4()

UNIT_TEST_STATUS EFIAPI TestStartupAllAPs4 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupAllAPs. When called with all AP timeout, the return status should be EFI_TIMEOUT.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1289 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupAllAPs5()

UNIT_TEST_STATUS EFIAPI TestStartupAllAPs5 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupAllAPs. When called with the empty Procedure on all disabled APs, the return status should be EFI_NOT_STARTED.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1331 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupThisAP1()

UNIT_TEST_STATUS EFIAPI TestStartupThisAP1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupThisAP. When called to startup a BSP, the return status should be EFI_INVALID_PARAMETER. When called with a nonexistent processor handle, the return status should be EFI_NOT_FOUND. The requested AP should execute the Procedure when called by StartupThisAP.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 955 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupThisAP2()

UNIT_TEST_STATUS EFIAPI TestStartupThisAP2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupThisAP. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1007 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupThisAP3()

UNIT_TEST_STATUS EFIAPI TestStartupThisAP3 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupThisAP. When timeout expired before the requested AP has finished, the return status should be EFI_TIMEOUT.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1050 of file EfiMpServicesUnitTestCommom.c.

◆ TestStartupThisAP4()

UNIT_TEST_STATUS EFIAPI TestStartupThisAP4 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service StartupThisAP. When called with disabled AP, the return status should be EFI_INVALID_PARAMETER.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1091 of file EfiMpServicesUnitTestCommom.c.

◆ TestSwitchBSP1()

UNIT_TEST_STATUS EFIAPI TestSwitchBSP1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service SwitchBSP. When switch current BSP to be BSP, the return status should be EFI_INVALID_PARAMETER. When switch nonexistent processor to be BSP, the return status should be EFI_NOT_FOUND. After switch BSP, all APs(includes new AP) should execute the Procedure when called by StartupAllAP.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1397 of file EfiMpServicesUnitTestCommom.c.

◆ TestSwitchBSP2()

UNIT_TEST_STATUS EFIAPI TestSwitchBSP2 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service SwitchBSP. When run this procedure on AP, the return status should be EFI_DEVICE_ERROR.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1463 of file EfiMpServicesUnitTestCommom.c.

◆ TestSwitchBSP3()

UNIT_TEST_STATUS EFIAPI TestSwitchBSP3 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service SwitchBSP. When switch a disabled AP to be BSP, the return status should be EFI_INVALID_PARAMETER.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1506 of file EfiMpServicesUnitTestCommom.c.

◆ TestSwitchBSP4()

UNIT_TEST_STATUS EFIAPI TestSwitchBSP4 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service SwitchBSP. When SwitchBSP and EnableOldBSP is TRUE, the new BSP should be in the enabled state and the old BSP should be in the enabled state. When SwitchBSP and EnableOldBSP is False, the new BSP should be in the enabled state and the old BSP should be in the disabled state.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 1564 of file EfiMpServicesUnitTestCommom.c.

◆ TestWhoAmI1()

UNIT_TEST_STATUS EFIAPI TestWhoAmI1 ( IN UNIT_TEST_CONTEXT  Context)

Unit test of MP service WhoAmI. The range of ProcessorNumber should be from 0 to NumberOfCPUs minus 1. The ProcessorNumbers of all CPUs are unique.

Parameters
[in]ContextContext pointer for this test.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 464 of file EfiMpServicesUnitTestCommom.c.