35#ifndef CPU_EXCEPTION_HANDLER_TEST_H_
36#define CPU_EXCEPTION_HANDLER_TEST_H_
55#define UNIT_TEST_APP_NAME "Cpu Exception Handler Lib Unit Tests"
56#define UNIT_TEST_APP_VERSION "1.0"
58#define CPU_INTERRUPT_NUM 256
59#define SPEC_MAX_EXCEPTION_NUM 22
60#define CR4_RESERVED_BIT BIT15
63 IA32_DESCRIPTOR OriginalGdtr;
64 IA32_DESCRIPTOR OriginalIdtr;
105extern UINTN mFaultInstructionLength;
107extern UINTN mRspAddress[];
184 IN UINTN FaultParameter OPTIONAL
238 IN UNIT_TEST_FRAMEWORK_HANDLE Framework
261 IN BOOLEAN SingleThread,
262 IN UINTN TimeoutInMicroSeconds,
263 IN VOID *ProcedureArgument
285 IN UINTN TimeoutInMicroSeconds,
286 IN VOID *ProcedureArgument
320 OUT UINTN *NumberOfEnabledProcessors
EFI_STATUS MpServicesUnitTestWhoAmI(IN MP_SERVICES MpServices, OUT UINTN *ProcessorNumber)
VOID EFIAPI AdjustCpuContextHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI TriggerINTnException(IN EFI_EXCEPTION_TYPE ExceptionType)
VOID EFIAPI TriggerStackOverflow(VOID)
VOID EFIAPI AsmTestConsistencyOfCpuContext(IN EFI_EXCEPTION_TYPE ExceptionType, IN UINTN FaultParameter OPTIONAL)
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 MpServicesUnitTestGetNumberOfProcessors(IN MP_SERVICES MpServices, OUT UINTN *NumberOfProcessors, OUT UINTN *NumberOfEnabledProcessors)
VOID EFIAPI AdjustRipForFaultHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
EFI_STATUS AddCommonTestCase(IN UNIT_TEST_FRAMEWORK_HANDLE Framework)
VOID EFIAPI CpuStackGuardExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI TriggerPFException(UINTN PFAddress)
VOID EFIAPI TriggerGPException(UINTN Cr4ReservedBit)
UNIT_TEST_STATUS CompareCpuContext(VOID)
EFI_STATUS MpServicesUnitTestStartupThisAP(IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN UINTN TimeoutInMicroSeconds, IN VOID *ProcedureArgument)
VOID * InitializeBspIdt(VOID)
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)