]>
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 | |
e7abb94d | 85 | Setup separate stacks for certain exception handlers.\r |
0f7bccf5 | 86 | If the input Buffer and BufferSize are both NULL, use global variable if possible.\r |
2da89195 | 87 | \r |
0f7bccf5 ZL |
88 | @param[in] Buffer Point to buffer used to separate exception stack.\r |
89 | @param[in, out] BufferSize On input, it indicates the byte size of Buffer.\r | |
90 | If the size is not enough, the return status will\r | |
91 | be EFI_BUFFER_TOO_SMALL, and output BufferSize\r | |
92 | will be the size it needs.\r | |
2da89195 | 93 | \r |
e7abb94d | 94 | @retval EFI_SUCCESS The stacks are assigned successfully.\r |
2da89195 | 95 | @retval EFI_UNSUPPORTED This function is not supported.\r |
0f7bccf5 | 96 | @retval EFI_BUFFER_TOO_SMALL This BufferSize is too small.\r |
2da89195 JW |
97 | **/\r |
98 | EFI_STATUS\r | |
99 | EFIAPI\r | |
e7abb94d | 100 | InitializeSeparateExceptionStacks (\r |
0f7bccf5 ZL |
101 | IN VOID *Buffer,\r |
102 | IN OUT UINTN *BufferSize\r | |
2da89195 JW |
103 | )\r |
104 | {\r | |
e7abb94d | 105 | return EFI_UNSUPPORTED;\r |
2da89195 | 106 | }\r |