]>
Commit | Line | Data |
---|---|---|
1e172d6b | 1 | /** @file\r |
2 | CPU Exception Handler library implementition with empty functions.\r | |
3 | \r | |
2a09527e | 4 | Copyright (c) 2012 - 2022, 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 | |
1436aea4 | 30 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r |
57f360f2 JF |
31 | )\r |
32 | {\r | |
33 | return EFI_SUCCESS;\r | |
34 | }\r | |
1e172d6b | 35 | \r |
57f360f2 JF |
36 | /**\r |
37 | Registers a function to be called from the processor interrupt handler.\r | |
38 | \r | |
d1102dba LG |
39 | This function registers and enables the handler specified by InterruptHandler for a processor\r |
40 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r | |
41 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r | |
57f360f2 | 42 | The installed handler is called once for each processor interrupt or exception.\r |
2a09527e RN |
43 | NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,\r |
44 | otherwise EFI_UNSUPPORTED returned.\r | |
57f360f2 JF |
45 | \r |
46 | @param[in] InterruptType Defines which interrupt or exception to hook.\r | |
47 | @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
48 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
49 | will be uninstalled.\r | |
50 | \r | |
51 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
52 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
53 | previously installed.\r | |
54 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
55 | previously installed.\r | |
56 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,\r | |
57 | or this function is not supported.\r | |
3f25e6ea | 58 | **/\r |
57f360f2 | 59 | EFI_STATUS\r |
1e172d6b | 60 | EFIAPI\r |
57f360f2 | 61 | RegisterCpuInterruptHandler (\r |
1436aea4 MK |
62 | IN EFI_EXCEPTION_TYPE InterruptType,\r |
63 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
1e172d6b | 64 | )\r |
57f360f2 | 65 | {\r |
0e99d516 | 66 | return EFI_UNSUPPORTED;\r |
1e172d6b | 67 | }\r |
68 | \r | |
e2884d2c JF |
69 | /**\r |
70 | Display processor context.\r | |
71 | \r | |
72 | @param[in] ExceptionType Exception type.\r | |
73 | @param[in] SystemContext Processor context to be display.\r | |
74 | **/\r | |
75 | VOID\r | |
76 | EFIAPI\r | |
77 | DumpCpuContext (\r | |
1436aea4 MK |
78 | IN EFI_EXCEPTION_TYPE ExceptionType,\r |
79 | IN EFI_SYSTEM_CONTEXT SystemContext\r | |
e2884d2c JF |
80 | )\r |
81 | {\r | |
82 | }\r | |
2da89195 JW |
83 | \r |
84 | /**\r | |
85 | Initializes all CPU exceptions entries with optional extra initializations.\r | |
86 | \r | |
87 | By default, this method should include all functionalities implemented by\r | |
88 | InitializeCpuExceptionHandlers(), plus extra initialization works, if any.\r | |
89 | This could be done by calling InitializeCpuExceptionHandlers() directly\r | |
90 | in this method besides the extra works.\r | |
91 | \r | |
92 | InitData is optional and its use and content are processor arch dependent.\r | |
93 | The typical usage of it is to convey resources which have to be reserved\r | |
94 | elsewhere and are necessary for the extra initializations of exception.\r | |
95 | \r | |
96 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
97 | @param[in] InitData Pointer to data optional for extra initializations\r | |
98 | of exception.\r | |
99 | \r | |
100 | @retval EFI_SUCCESS The exceptions have been successfully\r | |
101 | initialized.\r | |
102 | @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid\r | |
103 | content.\r | |
104 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
105 | \r | |
106 | **/\r | |
107 | EFI_STATUS\r | |
108 | EFIAPI\r | |
109 | InitializeCpuExceptionHandlersEx (\r | |
1436aea4 MK |
110 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,\r |
111 | IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL\r | |
2da89195 JW |
112 | )\r |
113 | {\r | |
114 | return InitializeCpuExceptionHandlers (VectorInfo);\r | |
115 | }\r |