2 CPU Exception Handler library implementition with empty functions.
4 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/CpuExceptionHandlerLib.h>
12 Initializes all CPU exceptions entries and provides the default exception handlers.
14 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
15 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
16 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
17 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
19 @param[in] VectorInfo Pointer to reserved vector list.
21 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
22 with default exception handlers.
23 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
24 @retval EFI_UNSUPPORTED This function is not supported.
29 InitializeCpuExceptionHandlers (
30 IN EFI_VECTOR_HANDOFF_INFO
*VectorInfo OPTIONAL
37 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.
39 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
40 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
41 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
42 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
44 @param[in] VectorInfo Pointer to reserved vector list.
46 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized
47 with default interrupt/exception handlers.
48 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
49 @retval EFI_UNSUPPORTED This function is not supported.
54 InitializeCpuInterruptHandlers (
55 IN EFI_VECTOR_HANDOFF_INFO
*VectorInfo OPTIONAL
62 Registers a function to be called from the processor interrupt handler.
64 This function registers and enables the handler specified by InterruptHandler for a processor
65 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
66 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
67 The installed handler is called once for each processor interrupt or exception.
68 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
69 InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.
71 @param[in] InterruptType Defines which interrupt or exception to hook.
72 @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
73 when a processor interrupt occurs. If this parameter is NULL, then the handler
76 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
77 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
79 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
81 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
82 or this function is not supported.
86 RegisterCpuInterruptHandler (
87 IN EFI_EXCEPTION_TYPE InterruptType
,
88 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
91 return EFI_UNSUPPORTED
;
95 Display processor context.
97 @param[in] ExceptionType Exception type.
98 @param[in] SystemContext Processor context to be display.
103 IN EFI_EXCEPTION_TYPE ExceptionType
,
104 IN EFI_SYSTEM_CONTEXT SystemContext
110 Initializes all CPU exceptions entries with optional extra initializations.
112 By default, this method should include all functionalities implemented by
113 InitializeCpuExceptionHandlers(), plus extra initialization works, if any.
114 This could be done by calling InitializeCpuExceptionHandlers() directly
115 in this method besides the extra works.
117 InitData is optional and its use and content are processor arch dependent.
118 The typical usage of it is to convey resources which have to be reserved
119 elsewhere and are necessary for the extra initializations of exception.
121 @param[in] VectorInfo Pointer to reserved vector list.
122 @param[in] InitData Pointer to data optional for extra initializations
125 @retval EFI_SUCCESS The exceptions have been successfully
127 @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid
129 @retval EFI_UNSUPPORTED This function is not supported.
134 InitializeCpuExceptionHandlersEx (
135 IN EFI_VECTOR_HANDOFF_INFO
*VectorInfo OPTIONAL
,
136 IN CPU_EXCEPTION_INIT_DATA
*InitData OPTIONAL
139 return InitializeCpuExceptionHandlers (VectorInfo
);