]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h
ECC clean up.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ipf / PlDebugSupport.h
1 /** @file
2 IPF specific debugsupport types, macros, and definitions.
3
4 Copyright (c) 2004 - 2006 Intel Corporation
5 All rights reserved. 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
15 #ifndef _PLDEBUG_SUPPORT_H_
16 #define _PLDEBUG_SUPPORT_H_
17
18
19 #include <Uefi.h>
20
21 #include <Protocol/DebugSupport.h>
22 #include <Protocol/LoadedImage.h>
23
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/MemoryAllocationLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/PcdLib.h>
31
32 #define DISABLE_INTERRUPTS 0UL
33
34 //
35 // The remaining definitions comprise the protocol members.
36 //
37 #define EFI_ISA IsaIpf
38
39 /**
40 IPF specific DebugSupport driver initialization.
41
42 Must be public because it's referenced from DebugSupport.c
43
44 @retval EFI_SUCCESS Always.
45
46 **/
47 EFI_STATUS
48 PlInitializeDebugSupportDriver (
49 VOID
50 );
51
52 /**
53 Unload handler that is called during UnloadImage() - deallocates pool memory
54 used by the driver. Must be public because it's referenced from DebugSuport.c
55
56 @param ImageHandle The firmware allocated handle for the EFI image.
57
58 @retval EFI_SUCCESS Always.
59
60 **/
61 EFI_STATUS
62 EFIAPI
63 PlUnloadDebugSupportDriver (
64 IN EFI_HANDLE ImageHandle
65 );
66
67 /**
68 C callable function to obtain the current value of IVA.
69
70 @return Current value of IVA.
71
72 **/
73 VOID *
74 GetIva (
75 VOID
76 );
77
78 /**
79 HookStub will be copied from it's loaded location into the IVT when
80 an IVT entry is hooked.
81
82 **/
83 VOID
84 HookStub (
85 VOID
86 );
87
88 /**
89 Chains an interrupt handler.
90
91 **/
92 VOID
93 ChainHandler (
94 VOID
95 );
96
97 /**
98 Unchains an interrupt handler.
99
100 **/
101 VOID
102 UnchainHandler (
103 VOID
104 );
105
106 /**
107 C callable function to enable/disable interrupts.
108
109 @param NewInterruptState New Interrupt State.
110
111 @return Previous state of psr.ic.
112
113 **/
114 UINT64
115 ProgramInterruptFlags (
116 IN UINT64 NewInterruptState
117 );
118
119 /**
120 Flushes instruction cache for specified number of bytes.
121
122 @param StartAddress Cache Start Address.
123 @param SizeInBytes Cache Size.
124
125 **/
126 VOID
127 InstructionCacheFlush (
128 IN VOID *StartAddress,
129 IN UINTN SizeInBytes
130 );
131
132 /**
133 This is a DebugSupport protocol member function, hard
134 coded to support only 1 processor for now.
135
136 @param This The DebugSupport instance
137 @param MaxProcessorIndex The maximuim supported processor index
138
139 @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.
140
141 **/
142 EFI_STATUS
143 EFIAPI
144 GetMaximumProcessorIndex (
145 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
146 OUT UINTN *MaxProcessorIndex
147 );
148
149 /**
150 DebugSupport protocol member function.
151
152 @param This The DebugSupport instance
153 @param ProcessorIndex Which processor the callback applies to.
154 @param PeriodicCallback Callback function
155
156 @retval EFI_SUCCESS Indicates the callback was registered.
157 @retval others Callback was not registered.
158
159 **/
160 EFI_STATUS
161 EFIAPI
162 RegisterPeriodicCallback (
163 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
164 IN UINTN ProcessorIndex,
165 IN EFI_PERIODIC_CALLBACK PeriodicCallback
166 );
167
168 /**
169 DebugSupport protocol member function.
170
171 @param This The DebugSupport instance
172 @param ProcessorIndex Which processor the callback applies to.
173 @param NewCallback Callback function
174 @param ExceptionType Which exception to hook
175
176 @retval EFI_SUCCESS Indicates the callback was registered.
177 @retval others Callback was not registered.
178
179 **/
180 EFI_STATUS
181 EFIAPI
182 RegisterExceptionCallback (
183 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
184 IN UINTN ProcessorIndex,
185 IN EFI_EXCEPTION_CALLBACK NewCallback,
186 IN EFI_EXCEPTION_TYPE ExceptionType
187 );
188
189 /**
190 DebugSupport protocol member function. Calls assembly routine to flush cache.
191
192 @param This The DebugSupport instance
193 @param ProcessorIndex Which processor the callback applies to.
194 @param Start Physical base of the memory range to be invalidated
195 @param Length mininum number of bytes in instruction cache to invalidate
196
197 @retval EFI_SUCCESS Always returned.
198
199 **/
200 EFI_STATUS
201 EFIAPI
202 InvalidateInstructionCache (
203 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
204 IN UINTN ProcessorIndex,
205 IN VOID *Start,
206 IN UINTN Length
207 );
208
209 /**
210 C routine that is called for all registered exceptions. This is the main
211 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
212
213 @param ExceptionType Exception Type
214 @param Context System Context
215 **/
216 VOID
217 CommonHandler (
218 IN EFI_EXCEPTION_TYPE ExceptionType,
219 IN EFI_SYSTEM_CONTEXT Context
220 );
221
222 #endif