TianoCore EDK2 master
|
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
#include "EfiMpServicesUnitTestCommom.h"
Go to the source code of this file.
Macros | |
#define | UNIT_TEST_NAME "EdkiiPeiMpServices2Ppi Unit Test" |
#define | UNIT_TEST_VERSION "0.1" |
PEI Module to test APIs defined in EdkiiPeiMpServices2Ppi.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EdkiiPeiMpServices2PpiUnitTest.c.
#define UNIT_TEST_NAME "EdkiiPeiMpServices2Ppi Unit Test" |
Definition at line 14 of file EdkiiPeiMpServices2PpiUnitTest.c.
#define UNIT_TEST_VERSION "0.1" |
Definition at line 15 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS AddTestCaseOnlyForEdkiiPeiMpServices2Ppi | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | Framework, |
IN MP_SERVICE_UT_CONTEXT * | Context | ||
) |
Create test suite and unit tests only for EdkiiPeiMpServices2Ppi.
[in] | Framework | A pointer to the framework that is being persisted. |
[in] | Context | A pointer to the private data buffer. |
EFI_SUCCESS | Create test suite and unit tests successfully. |
Others | Create test suite and unit tests unsuccessfully. |
Definition at line 387 of file EdkiiPeiMpServices2PpiUnitTest.c.
Infinite loop procedure to be run on specified AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 218 of file EdkiiPeiMpServices2PpiUnitTest.c.
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.
[in] | MpServices | MP_SERVICES structure. |
[in] | ProcessorNumber | The handle number of the AP. |
[in] | EnableAP | Specifies the new state for the processor for enabled, FALSE for disabled. |
[in] | HealthFlag | If not NULL, a pointer to a value that specifies the new health status of the AP. |
EFI_SUCCESS | Caller enables or disables an AP successfully. |
Others | Caller enables or disables an AP unsuccessfully. |
Definition at line 161 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS MpServicesUnitTestGetMpServices | ( | OUT MP_SERVICES * | MpServices | ) |
Get EDKII_PEI_MP_SERVICES2_PPI pointer.
[out] | MpServices | Pointer to the buffer where EDKII_PEI_MP_SERVICES2_PPI is stored. |
EFI_SUCCESS | EDKII_PEI_MP_SERVICES2_PPI interface is returned |
EFI_NOT_FOUND | EDKII_PEI_MP_SERVICES2_PPI interface is not found |
Definition at line 26 of file EdkiiPeiMpServices2PpiUnitTest.c.
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.
[in] | MpServices | MP_SERVICES structure. |
[out] | NumberOfProcessors | Pointer to the total number of logical processors in the system, including the BSP and disabled APs. |
[out] | NumberOfEnabledProcessors | Pointer to the number of processors in the system that are enabled. |
EFI_SUCCESS | Retrieve the number of logical processor successfully |
Others | Retrieve the number of logical processor unsuccessfully |
Definition at line 46 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS MpServicesUnitTestGetProcessorInfo | ( | IN MP_SERVICES | MpServices, |
IN UINTN | ProcessorNumber, | ||
OUT EFI_PROCESSOR_INFORMATION * | ProcessorInfoBuffer | ||
) |
Get detailed information on the requested logical processor.
[in] | MpServices | MP_SERVICES structure. |
[in] | ProcessorNumber | The handle number of the processor. |
[out] | ProcessorInfoBuffer | Pointer to the buffer where the processor information is stored. |
EFI_SUCCESS | Get information on the requested logical processor successfully |
Others | Get information on the requested logical processor unsuccessfully |
Definition at line 66 of file EdkiiPeiMpServices2PpiUnitTest.c.
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.
[in] | MpServices | MP_SERVICES structure. |
[in] | Procedure | Pointer to the function to be run on enabled APs of the system. |
[in] | SingleThread | If 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] | TimeoutInMicroSeconds | Indicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. |
[in] | ProcedureArgument | The parameter passed into Procedure for all APs. |
EFI_SUCCESS | Execute a caller provided function on all enabled APs successfully |
Others | Execute a caller provided function on all enabled APs unsuccessfully |
Definition at line 92 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS MpServicesUnitTestStartupAllCPUs | ( | IN MP_SERVICES | MpServices, |
IN EFI_AP_PROCEDURE | Procedure, | ||
IN UINTN | TimeoutInMicroSeconds, | ||
IN VOID * | ProcedureArgument | ||
) |
Execute a caller provided function on all enabled CPUs.
[in] | MpServices | MP_SERVICES structure. |
[in] | Procedure | Pointer to the function to be run on enabled CPUs of the system. |
[in] | TimeoutInMicroSeconds | Indicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. |
[in] | ProcedureArgument | The parameter passed into Procedure for all enabled CPUs. |
EFI_SUCCESS | Execute a caller provided function on all enabled CPUs successfully |
Others | Execute a caller provided function on all enabled CPUs unsuccessfully |
Definition at line 202 of file EdkiiPeiMpServices2PpiUnitTest.c.
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.
[in] | MpServices | MP_SERVICES structure. |
[in] | Procedure | Pointer to the function to be run on enabled APs of the system. |
[in] | ProcessorNumber | The handle number of the AP. |
[in] | TimeoutInMicroSeconds | Indicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. |
[in] | ProcedureArgument | The parameter passed into Procedure for all APs. |
EFI_SUCCESS | Caller gets one enabled AP to execute a caller-provided function successfully |
Others | Caller gets one enabled AP to execute a caller-provided function unsuccessfully |
Definition at line 118 of file EdkiiPeiMpServices2PpiUnitTest.c.
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.
[in] | MpServices | MP_SERVICES structure. |
[in] | ProcessorNumber | The handle number of AP that is to become the new BSP. |
[in] | EnableOldBSP | If TRUE, the old BSP will be listed as an enabled AP. Otherwise, it will be disabled. |
EFI_SUCCESS | Switch the requested AP to be the BSP successfully |
Others | Switch the requested AP to be the BSP unsuccessfully |
Definition at line 140 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS MpServicesUnitTestWhoAmI | ( | IN MP_SERVICES | MpServices, |
OUT UINTN * | ProcessorNumber | ||
) |
Get the handle number for the calling processor.
[in] | MpServices | MP_SERVICES structure. |
[out] | ProcessorNumber | The handle number for the calling processor. |
EFI_SUCCESS | Get the handle number for the calling processor successfully. |
Others | Get the handle number for the calling processor unsuccessfully. |
Definition at line 181 of file EdkiiPeiMpServices2PpiUnitTest.c.
EFI_STATUS EFIAPI PeiEntryPoint | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
Standard PEIM entry point for unit test execution from PEI. Initialize the unit test framework, suite, and unit tests for the EdkiiPeiMpServices2Ppi and run the unit test.
[in] | FileHandle | Handle of the file being invoked. |
[in] | PeiServices | Pointer to PEI Services table. |
Definition at line 423 of file EdkiiPeiMpServices2PpiUnitTest.c.
Procedure to run MP service StartupAllCPUs on AP.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 248 of file EdkiiPeiMpServices2PpiUnitTest.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllCPUs1 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of PEI MP service StartupAllCPU. All CPUs should execute the Procedure.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 276 of file EdkiiPeiMpServices2PpiUnitTest.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllCPUs2 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of PEI MP service StartupAllCPU. When this service is called from an AP, the return status should be EFI_DEVICE_ERROR.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 314 of file EdkiiPeiMpServices2PpiUnitTest.c.
UNIT_TEST_STATUS EFIAPI TestStartupAllCPUs3 | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Unit test of PEI MP service StartupAllCPU. When called with all CPUs timeout, the return status should be EFI_TIMEOUT.
[in] | Context | Context pointer for this test. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 357 of file EdkiiPeiMpServices2PpiUnitTest.c.