]>
Commit | Line | Data |
---|---|---|
e41aad15 JF |
1 | /** @file\r |
2 | CPU exception handler library implemenation for SMM modules.\r | |
3 | \r | |
2c5873fe | 4 | Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>\r |
e41aad15 JF |
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 | |
14 | \r | |
15 | #include <PiSmm.h>\r | |
16 | #include "CpuExceptionCommon.h"\r | |
17 | \r | |
18 | CONST UINTN mDoFarReturnFlag = 1; \r | |
19 | \r | |
2c5873fe | 20 | EXCEPTION_HANDLER_DATA mExceptionHandlerData;\r |
e41aad15 JF |
21 | /**\r |
22 | Initializes all CPU exceptions entries and provides the default exception handlers.\r | |
23 | \r | |
24 | Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r | |
25 | persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r | |
26 | If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. \r | |
27 | If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r | |
28 | \r | |
29 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
30 | \r | |
31 | @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized \r | |
32 | with default exception handlers.\r | |
33 | @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r | |
34 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
35 | \r | |
36 | **/\r | |
37 | EFI_STATUS\r | |
38 | EFIAPI\r | |
39 | InitializeCpuExceptionHandlers (\r | |
40 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r | |
41 | )\r | |
42 | {\r | |
43 | return InitializeCpuExceptionHandlersWorker (VectorInfo);\r | |
44 | }\r | |
45 | \r | |
46 | /**\r | |
47 | Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.\r | |
48 | \r | |
49 | Caller should try to get an array of interrupt and/or exception vectors that are in use and need to\r | |
50 | persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.\r | |
51 | If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. \r | |
52 | If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.\r | |
53 | \r | |
54 | @param[in] VectorInfo Pointer to reserved vector list.\r | |
55 | \r | |
56 | @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized \r | |
57 | with default interrupt/exception handlers.\r | |
58 | @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r | |
59 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
60 | \r | |
61 | **/\r | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | InitializeCpuInterruptHandlers (\r | |
65 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL\r | |
66 | )\r | |
67 | {\r | |
68 | return EFI_UNSUPPORTED;\r | |
69 | }\r | |
70 | \r | |
71 | /**\r | |
72 | Registers a function to be called from the processor interrupt handler.\r | |
73 | \r | |
74 | This function registers and enables the handler specified by InterruptHandler for a processor \r | |
75 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r | |
76 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r | |
77 | The installed handler is called once for each processor interrupt or exception.\r | |
78 | NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or\r | |
79 | InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.\r | |
80 | \r | |
81 | @param[in] InterruptType Defines which interrupt or exception to hook.\r | |
82 | @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r | |
83 | when a processor interrupt occurs. If this parameter is NULL, then the handler\r | |
84 | will be uninstalled.\r | |
85 | \r | |
86 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r | |
87 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r | |
88 | previously installed.\r | |
89 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r | |
90 | previously installed.\r | |
91 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,\r | |
92 | or this function is not supported.\r | |
3f25e6ea | 93 | **/\r |
e41aad15 JF |
94 | EFI_STATUS\r |
95 | EFIAPI\r | |
96 | RegisterCpuInterruptHandler (\r | |
97 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
98 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
99 | )\r | |
100 | {\r | |
101 | return RegisterCpuInterruptHandlerWorker (InterruptType, InterruptHandler);\r | |
102 | } |