Files
system76-edk2/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
Tan, Dun d98efb4682 UefiCpuPkg: Restore HpetTimer after CpuExceptionHandlerLib test
Disable/Restore HpetTimer before and after running the Dxe
CpuExceptionHandlerLib unit test module. During the UnitTest, a
new Idt is initialized for the test. There is no handler for timer
intrrupt in this new idt. After the test module, HpetTimer does
not work any more since the comparator value register and main
counter value register for timer does not match. To fix this issue,
disable/restore HpetTimer before and after Unit Test if HpetTimer
driver has been dispatched. We don't need to send Apic Eoi in this
unit test module.When disabling timer, after RaiseTPL(), if there
is a pending timer interrupt, bit64 of Interrupt Request Register
(IRR) will be set to 1 to indicate there is a pending timer
interrupt. After RestoreTPL(), CPU will handle the pending
interrupt in IRR.Then TimerInterruptHandler calls SendApicEoi().

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
2022-10-28 09:02:46 +00:00

60 lines
1.5 KiB
INI

## @file
# Unit tests of the DxeCpuExceptionHandlerLib instance.
#
# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = CpuExceptionHandlerDxeTest
FILE_GUID = D76BFD9C-0B6D-46BD-AD66-2BBB6FA7031A
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = CpuExceptionHandlerTestEntry
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = X64
#
[Sources.X64]
X64/ArchExceptionHandlerTestAsm.nasm
X64/ArchExceptionHandlerTest.c
[Sources.common]
CpuExceptionHandlerTest.h
CpuExceptionHandlerTestCommon.c
DxeCpuExceptionHandlerUnitTest.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
UefiCpuPkg/UefiCpuPkg.dec
[LibraryClasses]
BaseLib
BaseMemoryLib
DebugLib
UnitTestLib
MemoryAllocationLib
CpuExceptionHandlerLib
UefiDriverEntryPoint
HobLib
UefiBootServicesTableLib
CpuPageTableLib
[Guids]
gEfiHobMemoryAllocStackGuid
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize ## CONSUMES
[Protocols]
gEfiMpServiceProtocolGuid
gEfiTimerArchProtocolGuid
[Depex]
gEfiMpServiceProtocolGuid