TianoCore EDK2 master
|
#include "CpuExceptionHandlerTest.h"
Go to the source code of this file.
Functions | |
VOID EFIAPI | AdjustRipForFaultHandler (IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext) |
VOID EFIAPI | AdjustCpuContextHandler (IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext) |
UNIT_TEST_STATUS | CompareCpuContext (VOID) |
VOID EFIAPI | CpuStackGuardExceptionHandler (IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext) |
Variables | |
GENERAL_REGISTER | mActualContextInHandler |
GENERAL_REGISTER | mActualContextAfterException |
GENERAL_REGISTER | mExpectedContextInHandler = { 1, 2, 3, 4, 5, 0, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe } |
GENERAL_REGISTER | mExpectedContextAfterException = { 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e } |
Unit tests of the CpuExceptionHandlerLib.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ArchExceptionHandlerTest.c.
VOID EFIAPI AdjustCpuContextHandler | ( | IN EFI_EXCEPTION_TYPE | ExceptionType, |
IN EFI_SYSTEM_CONTEXT | SystemContext | ||
) |
Special handler for ConsistencyOfCpuContext test case.
ExceptionType | Exception type. |
SystemContext | Pointer to EFI_SYSTEM_CONTEXT. |
Definition at line 48 of file ArchExceptionHandlerTest.c.
VOID EFIAPI AdjustRipForFaultHandler | ( | IN EFI_EXCEPTION_TYPE | ExceptionType, |
IN EFI_SYSTEM_CONTEXT | SystemContext | ||
) |
Special handler for fault exception. Rip/Eip in SystemContext will be modified to the instruction after the exception instruction.
ExceptionType | Exception type. |
SystemContext | Pointer to EFI_SYSTEM_CONTEXT. |
Definition at line 31 of file ArchExceptionHandlerTest.c.
UNIT_TEST_STATUS CompareCpuContext | ( | VOID | ) |
Compare cpu context in ConsistencyOfCpuContext test case. 1.Compare mActualContextInHandler with mExpectedContextInHandler. 2.Compare mActualContextAfterException with mActualContextAfterException.
UNIT_TEST_PASSED | The Unit test has completed and it was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 109 of file ArchExceptionHandlerTest.c.
VOID EFIAPI CpuStackGuardExceptionHandler | ( | IN EFI_EXCEPTION_TYPE | ExceptionType, |
IN EFI_SYSTEM_CONTEXT | SystemContext | ||
) |
Special handler for CpuStackGuard test case.
ExceptionType | Exception type. |
SystemContext | Pointer to EFI_SYSTEM_CONTEXT. |
Definition at line 154 of file ArchExceptionHandlerTest.c.
GENERAL_REGISTER mActualContextAfterException |
Definition at line 12 of file ArchExceptionHandlerTest.c.
GENERAL_REGISTER mActualContextInHandler |
Definition at line 11 of file ArchExceptionHandlerTest.c.
GENERAL_REGISTER mExpectedContextAfterException = { 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e } |
Definition at line 20 of file ArchExceptionHandlerTest.c.
GENERAL_REGISTER mExpectedContextInHandler = { 1, 2, 3, 4, 5, 0, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe } |
Definition at line 19 of file ArchExceptionHandlerTest.c.