Add X64 support for DebugSupport driver.
[mirror_edk2.git] / EdkModulePkg / Universal / DebugSupport / Dxe / 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 #define DISABLE_INTERRUPTS 0UL
20
21 //
22 // The remaining definitions comprise the protocol members.
23 //
24 #define EFI_ISA IsaIpf
25
26 //
27 // processor specific functions that must be public
28 //
29 EFI_STATUS
30 plInitializeDebugSupportDriver (
31 VOID
32 )
33 /*++
34
35 Routine Description:
36 IPF specific DebugSupport driver initialization. Must be public because it's
37 referenced from DebugSupport.c
38
39 Arguments:
40
41 Returns:
42
43 EFI_SUCCESS
44
45 --*/
46 ;
47
48 EFI_STATUS
49 EFIAPI
50 plUnloadDebugSupportDriver (
51 IN EFI_HANDLE ImageHandle
52 )
53 /*++
54
55 Routine Description:
56 Unload handler that is called during UnloadImage() - deallocates pool memory
57 used by the driver. Must be public because it's referenced from DebugSuport.c
58
59 Arguments:
60 ImageHandle - Image handle
61
62 Returns:
63
64 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
65
66 --*/
67 ;
68
69 //
70 // Assembly worker functions and data referenced from plDebugSupport.c
71 //
72 VOID *
73 GetIva (
74 VOID
75 )
76 /*++
77
78 Routine Description:
79
80 C callable function to obtain the current value of IVA
81
82 Arguments:
83
84 None
85
86 Returns:
87
88 Current value if IVA
89
90 --*/
91 ;
92
93 VOID
94 HookStub (
95 VOID
96 )
97 /*++
98
99 Routine Description:
100
101 HookStub will be copied from it's loaded location into the IVT when
102 an IVT entry is hooked.
103
104 Arguments:
105
106 None
107
108 Returns:
109
110 None
111
112 --*/
113 ;
114
115 VOID
116 ChainHandler (
117 VOID
118 )
119 /*++
120
121 Routine Description:
122
123 Chains an interrupt handler
124
125 Arguments:
126
127 None
128
129 Returns:
130
131 None
132
133 --*/
134 ;
135
136 VOID
137 UnchainHandler (
138 VOID
139 )
140 /*++
141
142 Routine Description:
143
144 Unchains an interrupt handler
145
146 Arguments:
147
148 None
149
150 Returns:
151
152 None
153
154 --*/
155 ;
156
157 UINT64
158 ProgramInterruptFlags (
159 IN UINT64 NewInterruptState
160 )
161 /*++
162
163 Routine Description:
164
165 C callable function to enable/disable interrupts
166
167 Arguments:
168
169 NewInterruptState - New Interrupt State
170
171 Returns:
172
173 Previous state of psr.ic
174
175 --*/
176 ;
177
178 VOID
179 InstructionCacheFlush (
180 IN VOID *StartAddress,
181 IN UINTN SizeInBytes
182 )
183 /*++
184
185 Routine Description:
186
187 Flushes instruction cache for specified number of bytes
188
189 Arguments:
190
191 StartAddress - Cache Start Address
192 SizeInBytes - Cache Size
193
194 Returns:
195
196 None
197
198 --*/
199 ;
200
201 EFI_STATUS
202 EFIAPI
203 GetMaximumProcessorIndex (
204 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
205 OUT UINTN *MaxProcessorIndex
206 )
207 /*++
208
209 Routine Description: This is a DebugSupport protocol member function. Hard
210 coded to support only 1 processor for now.
211
212 Arguments:
213 This - The DebugSupport instance
214 MaxProcessorIndex - The maximuim supported processor index
215
216 Returns:
217 Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0
218
219 --*/
220 ;
221
222 EFI_STATUS
223 EFIAPI
224 RegisterPeriodicCallback (
225 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
226 IN UINTN ProcessorIndex,
227 IN EFI_PERIODIC_CALLBACK PeriodicCallback
228 )
229 /*++
230
231 Routine Description:
232 DebugSupport protocol member function
233
234 Arguments:
235 This - The DebugSupport instance
236 ProcessorIndex - Which processor the callback applies to.
237 PeriodicCallback - Callback function
238
239 Returns:
240
241 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
242
243 --*/
244 ;
245
246 EFI_STATUS
247 EFIAPI
248 RegisterExceptionCallback (
249 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
250 IN UINTN ProcessorIndex,
251 IN EFI_EXCEPTION_CALLBACK NewHandler,
252 IN EFI_EXCEPTION_TYPE ExceptionType
253 )
254 /*++
255
256 Routine Description:
257 DebugSupport protocol member function
258
259 Arguments:
260 This - The DebugSupport instance
261 ProcessorIndex - Which processor the callback applies to.
262 NewCallback - Callback function
263 ExceptionType - Which exception to hook
264
265 Returns:
266
267 EFI_STATUS - anything other than EFI_SUCCESS indicates the callback was not registered.
268
269 --*/
270 ;
271
272 EFI_STATUS
273 EFIAPI
274 InvalidateInstructionCache (
275 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
276 IN UINTN ProcessorIndex,
277 IN VOID *Start,
278 IN UINTN Length
279 )
280 /*++
281
282 Routine Description:
283 DebugSupport protocol member function. Calls assembly routine to flush cache.
284
285 Arguments:
286 This - The DebugSupport instance
287 ProcessorIndex - Which processor the callback applies to.
288 Start - Physical base of the memory range to be invalidated
289 Length - mininum number of bytes in instruction cache to invalidate
290
291 Returns:
292 EFI_SUCCESS
293
294 --*/
295 ;
296
297 #endif