]>
Commit | Line | Data |
---|---|---|
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 |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1e172d6b | 6 | \r |
7 | **/\r | |
57f360f2 JF |
8 | #include <PiPei.h>\r |
9 | #include <Library/CpuExceptionHandlerLib.h>\r | |
1e172d6b | 10 | \r |
57f360f2 JF |
11 | /**\r |
12 | Initializes all CPU exceptions entries and provides the default exception handlers.\r | |
d1102dba | 13 | \r |
57f360f2 JF |
14 | Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r |
15 | persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r | |
d1102dba | 16 | If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.\r |
57f360f2 JF |
17 | If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r |
18 | \r | |
19 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
d1102dba LG |
20 | \r |
21 | @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized\r | |
57f360f2 JF |
22 | with default exception handlers.\r |
23 | @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r | |
24 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
25 | \r | |
26 | **/\r | |
27 | EFI_STATUS\r | |
28 | EFIAPI\r | |
29 | InitializeCpuExceptionHandlers (\r | |
30 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r | |
31 | )\r | |
32 | {\r | |
33 | return EFI_SUCCESS;\r | |
34 | }\r | |
1e172d6b | 35 | \r |
36 | /**\r | |
57f360f2 | 37 | Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.\r |
d1102dba | 38 | \r |
57f360f2 JF |
39 | Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r |
40 | persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r | |
d1102dba | 41 | If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.\r |
57f360f2 JF |
42 | If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r |
43 | \r | |
44 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
d1102dba LG |
45 | \r |
46 | @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized\r | |
57f360f2 JF |
47 | with default interrupt/exception handlers.\r |
48 | @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r | |
49 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
50 | \r | |
1e172d6b | 51 | **/\r |
57f360f2 JF |
52 | EFI_STATUS\r |
53 | EFIAPI\r | |
54 | InitializeCpuInterruptHandlers (\r | |
55 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r | |
56 | )\r | |
57 | {\r | |
58 | return EFI_SUCCESS;\r | |
59 | }\r | |
60 | \r | |
61 | /**\r | |
62 | Registers a function to be called from the processor interrupt handler.\r | |
63 | \r | |
d1102dba LG |
64 | This function registers and enables the handler specified by InterruptHandler for a processor\r |
65 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r | |
66 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r | |
57f360f2 JF |
67 | The installed handler is called once for each processor interrupt or exception.\r |
68 | NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or\r | |
69 | InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.\r | |
70 | \r | |
71 | @param[in] InterruptType Defines which interrupt or exception to hook.\r | |
72 | @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
73 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
74 | will be uninstalled.\r | |
75 | \r | |
76 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
77 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
78 | previously installed.\r | |
79 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
80 | previously installed.\r | |
81 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,\r | |
82 | or this function is not supported.\r | |
3f25e6ea | 83 | **/\r |
57f360f2 | 84 | EFI_STATUS\r |
1e172d6b | 85 | EFIAPI\r |
57f360f2 JF |
86 | RegisterCpuInterruptHandler (\r |
87 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
88 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
1e172d6b | 89 | )\r |
57f360f2 | 90 | {\r |
0e99d516 | 91 | return EFI_UNSUPPORTED;\r |
1e172d6b | 92 | }\r |
93 | \r | |
e2884d2c JF |
94 | /**\r |
95 | Display processor context.\r | |
96 | \r | |
97 | @param[in] ExceptionType Exception type.\r | |
98 | @param[in] SystemContext Processor context to be display.\r | |
99 | **/\r | |
100 | VOID\r | |
101 | EFIAPI\r | |
102 | DumpCpuContext (\r | |
103 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
104 | IN EFI_SYSTEM_CONTEXT SystemContext\r | |
105 | )\r | |
106 | {\r | |
107 | }\r | |
2da89195 JW |
108 | \r |
109 | /**\r | |
110 | Initializes all CPU exceptions entries with optional extra initializations.\r | |
111 | \r | |
112 | By default, this method should include all functionalities implemented by\r | |
113 | InitializeCpuExceptionHandlers(), plus extra initialization works, if any.\r | |
114 | This could be done by calling InitializeCpuExceptionHandlers() directly\r | |
115 | in this method besides the extra works.\r | |
116 | \r | |
117 | InitData is optional and its use and content are processor arch dependent.\r | |
118 | The typical usage of it is to convey resources which have to be reserved\r | |
119 | elsewhere and are necessary for the extra initializations of exception.\r | |
120 | \r | |
121 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
122 | @param[in] InitData Pointer to data optional for extra initializations\r | |
123 | of exception.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The exceptions have been successfully\r | |
126 | initialized.\r | |
127 | @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid\r | |
128 | content.\r | |
129 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
130 | \r | |
131 | **/\r | |
132 | EFI_STATUS\r | |
133 | EFIAPI\r | |
134 | InitializeCpuExceptionHandlersEx (\r | |
135 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,\r | |
136 | IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL\r | |
137 | )\r | |
138 | {\r | |
139 | return InitializeCpuExceptionHandlers (VectorInfo);\r | |
140 | }\r | |
141 | \r |