summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Include
diff options
context:
space:
mode:
authorRay Ni <ray.ni@intel.com>2022-05-18 17:51:21 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-06-10 07:54:48 +0000
commit2a09527ebcb459b40bc3661d85aa11c3905526dc (patch)
tree8a60e286500e0406f8b2e03ead49c68c4cdc48bf /MdeModulePkg/Include
parent2fbc5ff0a517b73aecf26ece6a040f265d878f81 (diff)
downloadedk2-2a09527ebcb459b40bc3661d85aa11c3905526dc.tar.gz
edk2-2a09527ebcb459b40bc3661d85aa11c3905526dc.tar.bz2
edk2-2a09527ebcb459b40bc3661d85aa11c3905526dc.zip
CpuException: Remove InitializeCpuInterruptHandlers
InitializeCpuExceptionHandlers() expects caller allocates IDT while InitializeCpuInterruptHandlers() allocates 256 IDT entries itself. InitializeCpuExceptionHandlers() fills max 32 IDT entries allocated by caller. If caller allocates 10 entries, the API just fills 10 IDT entries. The inconsistency between the two APIs makes code hard to unerstand and hard to share. Because there is only one caller (CpuDxe) for InitializeCpuInterruptHandler(), this patch updates CpuDxe driver to allocates 256 IDT entries then call InitializeCpuExceptionHandlers(). This is also a backward compatible change. With this change, InitializeCpuInterruptHandlers() is removed completely. And InitializeCpuExceptionHandlers() fills max 32 entries for PEI and SMM instance, max 256 entries for DXE instance. Such behavior matches to the original one. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Include')
-rw-r--r--MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h28
1 files changed, 3 insertions, 25 deletions
diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
index 22a4408f9f..d4649bebe1 100644
--- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
+++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
@@ -2,7 +2,7 @@
CPU Exception library provides the default CPU interrupt/exception handler.
It also provides capability to register user interrupt/exception handler.
- Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -133,36 +133,14 @@ InitializeCpuExceptionHandlersEx (
);
/**
- Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.
-
- Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
- persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
- If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
- If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
-
- @param[in] VectorInfo Pointer to reserved vector list.
-
- @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized
- with default interrupt/exception handlers.
- @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
- @retval EFI_UNSUPPORTED This function is not supported.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeCpuInterruptHandlers (
- IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
- );
-
-/**
Registers a function to be called from the processor interrupt handler.
This function registers and enables the handler specified by InterruptHandler for a processor
interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
The installed handler is called once for each processor interrupt or exception.
- NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
- InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.
+ NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,
+ otherwise EFI_UNSUPPORTED returned.
@param[in] InterruptType Defines which interrupt or exception to hook.
@param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called