TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeCpuExceptionHandlerUnitTest.c File Reference

Go to the source code of this file.

Functions

VOID * InitializeBspIdt (VOID)
 
EFI_STATUS MpServicesUnitTestGetNumberOfProcessors (IN MP_SERVICES MpServices, OUT UINTN *NumberOfProcessors, OUT UINTN *NumberOfEnabledProcessors)
 
EFI_STATUS MpServicesUnitTestWhoAmI (IN MP_SERVICES MpServices, OUT UINTN *ProcessorNumber)
 
EFI_STATUS MpServicesUnitTestStartupThisAP (IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
 
EFI_STATUS MpServicesUnitTestStartupAllAPs (IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
 
EFI_STATUS GetMpServices (OUT MP_SERVICES *MpServices)
 
EFI_STATUS EFIAPI CpuExceptionHandlerTestEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Detailed Description

Unit tests of the CpuExceptionHandlerLib.

Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DxeCpuExceptionHandlerUnitTest.c.

Function Documentation

◆ CpuExceptionHandlerTestEntry()

EFI_STATUS EFIAPI CpuExceptionHandlerTestEntry ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Entry for CpuExceptionHandlerDxeTest driver.

Parameters
ImageHandleImage handle this driver.
SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe driver executed normally.

Definition at line 159 of file DxeCpuExceptionHandlerUnitTest.c.

◆ GetMpServices()

EFI_STATUS GetMpServices ( 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

Definition at line 141 of file DxeCpuExceptionHandlerUnitTest.c.

◆ InitializeBspIdt()

VOID * InitializeBspIdt ( VOID  )

Initialize Bsp Idt with a new Idt table and return the IA32_DESCRIPTOR buffer. In PEIM, store original PeiServicePointer before new Idt table.

Returns
Pointer to the allocated IA32_DESCRIPTOR buffer.

Definition at line 20 of file DxeCpuExceptionHandlerUnitTest.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.

◆ 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.

◆ 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.