abb6967deabd2e9f989b15510a2e935947403182
[mirror_edk2.git] / EdkModulePkg / Universal / DebugSupport / Dxe / Ia32 / plDebugSupport.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 plDebugSupport.h
15
16 Abstract:
17
18 IA32 specific debug support macros, typedefs and prototypes.
19
20 Revision History
21
22 --*/
23
24 #ifndef _PLDEBUG_SUPPORT_H
25 #define _PLDEBUG_SUPPORT_H
26
27 #define NUM_IDT_ENTRIES 0x78
28 #define SYSTEM_TIMER_VECTOR 0x68
29 #define VECTOR_ENTRY_PAGES 1
30 #define CopyDescriptor(Dest, Src) CopyMem ((Dest), (Src), sizeof (DESCRIPTOR))
31 #define ZeroDescriptor(Dest) CopyDescriptor ((Dest), &NullDesc)
32 #define ReadIdt(Vector, Dest) CopyDescriptor ((Dest), &((GetIdtr ())[(Vector)]))
33 #define WriteIdt(Vector, Src) CopyDescriptor (&((GetIdtr ())[(Vector)]), (Src))
34 #define CompareDescriptor(Desc1, Desc2) CompareMem ((Desc1), (Desc2), sizeof (DESCRIPTOR))
35 #define EFI_ISA IsaIa32
36 #define FF_FXSR (1 << 24)
37
38 typedef UINT64 DESCRIPTOR;
39
40 typedef struct {
41 DESCRIPTOR OrigDesc;
42 VOID (*OrigVector) (VOID);
43 DESCRIPTOR NewDesc;
44 VOID (*StubEntry) (VOID);
45 VOID (*RegisteredCallback) ();
46 } IDT_ENTRY;
47
48 extern EFI_SYSTEM_CONTEXT SystemContext;
49 extern UINT8 InterruptEntryStub[];
50 extern UINT32 StubSize;
51 extern VOID (*OrigVector) (VOID);
52
53 VOID
54 CommonIdtEntry (
55 VOID
56 )
57 /*++
58
59 Routine Description:
60
61 TODO: Add function description
62
63 Arguments:
64
65 None
66
67 Returns:
68
69 TODO: add return values
70
71 --*/
72 ;
73
74 BOOLEAN
75 FxStorSupport (
76 VOID
77 )
78 /*++
79
80 Routine Description:
81
82 TODO: Add function description
83
84 Arguments:
85
86 None
87
88 Returns:
89
90 TODO: add return values
91
92 --*/
93 ;
94
95 DESCRIPTOR *
96 GetIdtr (
97 VOID
98 )
99 /*++
100
101 Routine Description:
102
103 TODO: Add function description
104
105 Arguments:
106
107 None
108
109 Returns:
110
111 TODO: add return values
112
113 --*/
114 ;
115
116 VOID
117 Vect2Desc (
118 DESCRIPTOR * DestDesc,
119 VOID (*Vector) (VOID)
120 )
121 /*++
122
123 Routine Description:
124
125 TODO: Add function description
126
127 Arguments:
128
129 DestDesc - TODO: add argument description
130 ) - TODO: add argument description
131
132 Returns:
133
134 TODO: add return values
135
136 --*/
137 ;
138
139 BOOLEAN
140 WriteInterruptFlag (
141 BOOLEAN NewState
142 )
143 /*++
144
145 Routine Description:
146
147 TODO: Add function description
148
149 Arguments:
150
151 NewState - TODO: add argument description
152
153 Returns:
154
155 TODO: add return values
156
157 --*/
158 ;
159
160 EFI_STATUS
161 plInitializeDebugSupportDriver (
162 VOID
163 )
164 /*++
165
166 Routine Description:
167
168 TODO: Add function description
169
170 Arguments:
171
172 None
173
174 Returns:
175
176 TODO: add return values
177
178 --*/
179 ;
180
181 EFI_STATUS
182 EFIAPI
183 plUnloadDebugSupportDriver (
184 IN EFI_HANDLE ImageHandle
185 )
186 /*++
187
188 Routine Description:
189
190 TODO: Add function description
191
192 Arguments:
193
194 ImageHandle - TODO: add argument description
195
196 Returns:
197
198 TODO: add return values
199
200 --*/
201 ;
202
203 //
204 // DebugSupport protocol member functions
205 //
206 EFI_STATUS
207 EFIAPI
208 GetMaximumProcessorIndex (
209 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
210 OUT UINTN *MaxProcessorIndex
211 )
212 /*++
213
214 Routine Description:
215
216 TODO: Add function description
217
218 Arguments:
219
220 This - TODO: add argument description
221 MaxProcessorIndex - TODO: add argument description
222
223 Returns:
224
225 TODO: add return values
226
227 --*/
228 ;
229
230 EFI_STATUS
231 EFIAPI
232 RegisterPeriodicCallback (
233 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
234 IN UINTN ProcessorIndex,
235 IN EFI_PERIODIC_CALLBACK PeriodicCallback
236 )
237 /*++
238
239 Routine Description:
240
241 TODO: Add function description
242
243 Arguments:
244
245 This - TODO: add argument description
246 ProcessorIndex - TODO: add argument description
247 PeriodicCallback - TODO: add argument description
248
249 Returns:
250
251 TODO: add return values
252
253 --*/
254 ;
255
256 EFI_STATUS
257 EFIAPI
258 RegisterExceptionCallback (
259 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
260 IN UINTN ProcessorIndex,
261 IN EFI_EXCEPTION_CALLBACK NewCallback,
262 IN EFI_EXCEPTION_TYPE ExceptionType
263 )
264 /*++
265
266 Routine Description:
267
268 TODO: Add function description
269
270 Arguments:
271
272 This - TODO: add argument description
273 ProcessorIndex - TODO: add argument description
274 NewCallback - TODO: add argument description
275 ExceptionType - TODO: add argument description
276
277 Returns:
278
279 TODO: add return values
280
281 --*/
282 ;
283
284 EFI_STATUS
285 EFIAPI
286 InvalidateInstructionCache (
287 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
288 IN UINTN ProcessorIndex,
289 IN VOID *Start,
290 IN UINT64 Length
291 )
292 /*++
293
294 Routine Description:
295
296 TODO: Add function description
297
298 Arguments:
299
300 This - TODO: add argument description
301 ProcessorIndex - TODO: add argument description
302 Start - TODO: add argument description
303 Length - TODO: add argument description
304
305 Returns:
306
307 TODO: add return values
308
309 --*/
310 ;
311
312 #endif