]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / CpuExceptionHandlerLibNull / CpuExceptionHandlerLibNull.c
CommitLineData
1e172d6b 1/** @file\r
2 CPU Exception Handler library implementition with empty functions.\r
3\r
d1102dba 4 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\r
1e172d6b 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
57f360f2
JF
14#include <PiPei.h>\r
15#include <Library/CpuExceptionHandlerLib.h>\r
1e172d6b 16\r
57f360f2
JF
17/**\r
18 Initializes all CPU exceptions entries and provides the default exception handlers.\r
d1102dba 19\r
57f360f2
JF
20 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r
21 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r
d1102dba 22 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.\r
57f360f2
JF
23 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r
24\r
25 @param[in] VectorInfo Pointer to reserved vector list.\r
d1102dba
LG
26\r
27 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized\r
57f360f2
JF
28 with default exception handlers.\r
29 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r
30 @retval EFI_UNSUPPORTED This function is not supported.\r
31\r
32**/\r
33EFI_STATUS\r
34EFIAPI\r
35InitializeCpuExceptionHandlers (\r
36 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r
37 )\r
38{\r
39 return EFI_SUCCESS;\r
40}\r
1e172d6b 41\r
42/**\r
57f360f2 43 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.\r
d1102dba 44\r
57f360f2
JF
45 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r
46 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r
d1102dba 47 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.\r
57f360f2
JF
48 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r
49\r
50 @param[in] VectorInfo Pointer to reserved vector list.\r
d1102dba
LG
51\r
52 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized\r
57f360f2
JF
53 with default interrupt/exception handlers.\r
54 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r
55 @retval EFI_UNSUPPORTED This function is not supported.\r
56\r
1e172d6b 57**/\r
57f360f2
JF
58EFI_STATUS\r
59EFIAPI\r
60InitializeCpuInterruptHandlers (\r
61 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r
62 )\r
63{\r
64 return EFI_SUCCESS;\r
65}\r
66\r
67/**\r
68 Registers a function to be called from the processor interrupt handler.\r
69\r
d1102dba
LG
70 This function registers and enables the handler specified by InterruptHandler for a processor\r
71 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r
72 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r
57f360f2
JF
73 The installed handler is called once for each processor interrupt or exception.\r
74 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or\r
75 InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.\r
76\r
77 @param[in] InterruptType Defines which interrupt or exception to hook.\r
78 @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
79 when a processor interrupt occurs. If this parameter is NULL, then the handler\r
80 will be uninstalled.\r
81\r
82 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
83 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
84 previously installed.\r
85 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
86 previously installed.\r
87 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,\r
88 or this function is not supported.\r
3f25e6ea 89**/\r
57f360f2 90EFI_STATUS\r
1e172d6b 91EFIAPI\r
57f360f2
JF
92RegisterCpuInterruptHandler (\r
93 IN EFI_EXCEPTION_TYPE InterruptType,\r
94 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
1e172d6b 95 )\r
57f360f2 96{\r
0e99d516 97 return EFI_UNSUPPORTED;\r
1e172d6b 98}\r
99\r
e2884d2c
JF
100/**\r
101 Display processor context.\r
102\r
103 @param[in] ExceptionType Exception type.\r
104 @param[in] SystemContext Processor context to be display.\r
105**/\r
106VOID\r
107EFIAPI\r
108DumpCpuContext (\r
109 IN EFI_EXCEPTION_TYPE ExceptionType,\r
110 IN EFI_SYSTEM_CONTEXT SystemContext\r
111 )\r
112{\r
113}\r
2da89195
JW
114\r
115/**\r
116 Initializes all CPU exceptions entries with optional extra initializations.\r
117\r
118 By default, this method should include all functionalities implemented by\r
119 InitializeCpuExceptionHandlers(), plus extra initialization works, if any.\r
120 This could be done by calling InitializeCpuExceptionHandlers() directly\r
121 in this method besides the extra works.\r
122\r
123 InitData is optional and its use and content are processor arch dependent.\r
124 The typical usage of it is to convey resources which have to be reserved\r
125 elsewhere and are necessary for the extra initializations of exception.\r
126\r
127 @param[in] VectorInfo Pointer to reserved vector list.\r
128 @param[in] InitData Pointer to data optional for extra initializations\r
129 of exception.\r
130\r
131 @retval EFI_SUCCESS The exceptions have been successfully\r
132 initialized.\r
133 @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid\r
134 content.\r
135 @retval EFI_UNSUPPORTED This function is not supported.\r
136\r
137**/\r
138EFI_STATUS\r
139EFIAPI\r
140InitializeCpuExceptionHandlersEx (\r
141 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,\r
142 IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL\r
143 )\r
144{\r
145 return InitializeCpuExceptionHandlers (VectorInfo);\r
146}\r
147\r