TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Library/UefiBootServicesTableLib.h>
#include "EfiMpServicesUnitTestCommom.h"
Go to the source code of this file.
Macros | |
#define | UNIT_TEST_NAME "EfiMpServiceProtocol Unit Test" |
#define | UNIT_TEST_VERSION "0.1" |
PEI Module to test EfiMpServiceProtocol.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EfiMpServiceProtocolUnitTest.c.
#define UNIT_TEST_NAME "EfiMpServiceProtocol Unit Test" |
Definition at line 14 of file EfiMpServiceProtocolUnitTest.c.
#define UNIT_TEST_VERSION "0.1" |
Definition at line 15 of file EfiMpServiceProtocolUnitTest.c.
EFI_STATUS EFIAPI DxeEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Standard DXE driver or UEFI application entry point for unit test execution from DXE or UEFI Shell. Initialize the unit test framework, suite, and unit tests for the EfiMpServiceProtocol and run the unit test.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
Definition at line 254 of file EfiMpServiceProtocolUnitTest.c.
EFI_STATUS EFIAPI EfiMpServiceProtocolUnitTest | ( | VOID | ) |
Initialize the unit test framework, suite and unit tests for the EfiMpServiceProtocol and run the unit tests.
EFI_SUCCESS | Initialize the unit test framework, suite, unit tests and run the unit tests successfully. |
Others | Initialize the unit test framework, suite, unit tests or run the unit tests unsuccessfully. |
Definition at line 198 of file EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.c.
EFI_STATUS MpServicesUnitTestGetMpServices | ( | OUT MP_SERVICES * | MpServices | ) |
Get EFI_MP_SERVICES_PROTOCOL pointer.
[out] | MpServices | Pointer to the buffer where EFI_MP_SERVICES_PROTOCOL is stored |
EFI_SUCCESS | EFI_MP_SERVICES_PROTOCOL interface is returned |
EFI_NOT_FOUND | EFI_MP_SERVICES_PROTOCOL interface is not found |
Definition at line 26 of file EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.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 EfiMpServiceProtocolUnitTest.c.