1 | /** @file
|
---|
2 | CPU Exception Handler library implementition with empty functions.
|
---|
3 |
|
---|
4 | Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>
|
---|
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 |
|
---|
7 | **/
|
---|
8 | #include <PiPei.h>
|
---|
9 | #include <Library/CpuExceptionHandlerLib.h>
|
---|
10 |
|
---|
11 | /**
|
---|
12 | Initializes all CPU exceptions entries and provides the default exception handlers.
|
---|
13 |
|
---|
14 | Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
|
---|
15 | persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
|
---|
16 | If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
|
---|
17 | If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
|
---|
18 |
|
---|
19 | @param[in] VectorInfo Pointer to reserved vector list.
|
---|
20 |
|
---|
21 | @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
|
---|
22 | with default exception handlers.
|
---|
23 | @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
|
---|
24 | @retval EFI_UNSUPPORTED This function is not supported.
|
---|
25 |
|
---|
26 | **/
|
---|
27 | EFI_STATUS
|
---|
28 | EFIAPI
|
---|
29 | InitializeCpuExceptionHandlers (
|
---|
30 | IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
|
---|
31 | )
|
---|
32 | {
|
---|
33 | return EFI_SUCCESS;
|
---|
34 | }
|
---|
35 |
|
---|
36 | /**
|
---|
37 | Registers a function to be called from the processor interrupt handler.
|
---|
38 |
|
---|
39 | This function registers and enables the handler specified by InterruptHandler for a processor
|
---|
40 | interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
|
---|
41 | handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
|
---|
42 | The installed handler is called once for each processor interrupt or exception.
|
---|
43 | NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,
|
---|
44 | otherwise EFI_UNSUPPORTED returned.
|
---|
45 |
|
---|
46 | @param[in] InterruptType Defines which interrupt or exception to hook.
|
---|
47 | @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
|
---|
48 | when a processor interrupt occurs. If this parameter is NULL, then the handler
|
---|
49 | will be uninstalled.
|
---|
50 |
|
---|
51 | @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
|
---|
52 | @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
|
---|
53 | previously installed.
|
---|
54 | @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
|
---|
55 | previously installed.
|
---|
56 | @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
|
---|
57 | or this function is not supported.
|
---|
58 | **/
|
---|
59 | EFI_STATUS
|
---|
60 | EFIAPI
|
---|
61 | RegisterCpuInterruptHandler (
|
---|
62 | IN EFI_EXCEPTION_TYPE InterruptType,
|
---|
63 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
|
---|
64 | )
|
---|
65 | {
|
---|
66 | return EFI_UNSUPPORTED;
|
---|
67 | }
|
---|
68 |
|
---|
69 | /**
|
---|
70 | Display processor context.
|
---|
71 |
|
---|
72 | @param[in] ExceptionType Exception type.
|
---|
73 | @param[in] SystemContext Processor context to be display.
|
---|
74 | **/
|
---|
75 | VOID
|
---|
76 | EFIAPI
|
---|
77 | DumpCpuContext (
|
---|
78 | IN EFI_EXCEPTION_TYPE ExceptionType,
|
---|
79 | IN EFI_SYSTEM_CONTEXT SystemContext
|
---|
80 | )
|
---|
81 | {
|
---|
82 | }
|
---|
83 |
|
---|
84 | /**
|
---|
85 | Setup separate stacks for certain exception handlers.
|
---|
86 | If the input Buffer and BufferSize are both NULL, use global variable if possible.
|
---|
87 |
|
---|
88 | @param[in] Buffer Point to buffer used to separate exception stack.
|
---|
89 | @param[in, out] BufferSize On input, it indicates the byte size of Buffer.
|
---|
90 | If the size is not enough, the return status will
|
---|
91 | be EFI_BUFFER_TOO_SMALL, and output BufferSize
|
---|
92 | will be the size it needs.
|
---|
93 |
|
---|
94 | @retval EFI_SUCCESS The stacks are assigned successfully.
|
---|
95 | @retval EFI_UNSUPPORTED This function is not supported.
|
---|
96 | @retval EFI_BUFFER_TOO_SMALL This BufferSize is too small.
|
---|
97 | **/
|
---|
98 | EFI_STATUS
|
---|
99 | EFIAPI
|
---|
100 | InitializeSeparateExceptionStacks (
|
---|
101 | IN VOID *Buffer,
|
---|
102 | IN OUT UINTN *BufferSize
|
---|
103 | )
|
---|
104 | {
|
---|
105 | return EFI_UNSUPPORTED;
|
---|
106 | }
|
---|