]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / CpuExceptionHandlerLibNull / CpuExceptionHandlerLibNull.c
1 /** @file
2 CPU Exception Handler library implementition with empty functions.
3
4 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14 #include <PiPei.h>
15 #include <Library/CpuExceptionHandlerLib.h>
16
17 /**
18 Initializes all CPU exceptions entries and provides the default exception handlers.
19
20 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
21 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
22 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
23 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
24
25 @param[in] VectorInfo Pointer to reserved vector list.
26
27 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
28 with default exception handlers.
29 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
30 @retval EFI_UNSUPPORTED This function is not supported.
31
32 **/
33 EFI_STATUS
34 EFIAPI
35 InitializeCpuExceptionHandlers (
36 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
37 )
38 {
39 return EFI_SUCCESS;
40 }
41
42 /**
43 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.
44
45 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
46 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
47 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
48 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
49
50 @param[in] VectorInfo Pointer to reserved vector list.
51
52 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized
53 with default interrupt/exception handlers.
54 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
55 @retval EFI_UNSUPPORTED This function is not supported.
56
57 **/
58 EFI_STATUS
59 EFIAPI
60 InitializeCpuInterruptHandlers (
61 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
62 )
63 {
64 return EFI_SUCCESS;
65 }
66
67 /**
68 Registers a function to be called from the processor interrupt handler.
69
70 This function registers and enables the handler specified by InterruptHandler for a processor
71 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
72 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
73 The installed handler is called once for each processor interrupt or exception.
74 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
75 InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.
76
77 @param[in] InterruptType Defines which interrupt or exception to hook.
78 @param[in] InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
79 when a processor interrupt occurs. If this parameter is NULL, then the handler
80 will be uninstalled.
81
82 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
83 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
84 previously installed.
85 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
86 previously installed.
87 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
88 or this function is not supported.
89 **/
90 EFI_STATUS
91 EFIAPI
92 RegisterCpuInterruptHandler (
93 IN EFI_EXCEPTION_TYPE InterruptType,
94 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
95 )
96 {
97 return EFI_UNSUPPORTED;
98 }
99
100 /**
101 Display processor context.
102
103 @param[in] ExceptionType Exception type.
104 @param[in] SystemContext Processor context to be display.
105 **/
106 VOID
107 EFIAPI
108 DumpCpuContext (
109 IN EFI_EXCEPTION_TYPE ExceptionType,
110 IN EFI_SYSTEM_CONTEXT SystemContext
111 )
112 {
113 }
114
115 /**
116 Initializes all CPU exceptions entries with optional extra initializations.
117
118 By default, this method should include all functionalities implemented by
119 InitializeCpuExceptionHandlers(), plus extra initialization works, if any.
120 This could be done by calling InitializeCpuExceptionHandlers() directly
121 in this method besides the extra works.
122
123 InitData is optional and its use and content are processor arch dependent.
124 The typical usage of it is to convey resources which have to be reserved
125 elsewhere and are necessary for the extra initializations of exception.
126
127 @param[in] VectorInfo Pointer to reserved vector list.
128 @param[in] InitData Pointer to data optional for extra initializations
129 of exception.
130
131 @retval EFI_SUCCESS The exceptions have been successfully
132 initialized.
133 @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid
134 content.
135 @retval EFI_UNSUPPORTED This function is not supported.
136
137 **/
138 EFI_STATUS
139 EFIAPI
140 InitializeCpuExceptionHandlersEx (
141 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,
142 IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL
143 )
144 {
145 return InitializeCpuExceptionHandlers (VectorInfo);
146 }
147