Rev 2726 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2726 | vana | 1 | #ifndef _EFI_API_H |
2 | #define _EFI_API_H |
||
3 | |||
4 | /*++ |
||
5 | |||
6 | Copyright (c) 1998 Intel Corporation |
||
7 | |||
8 | Module Name: |
||
9 | |||
10 | efiapi.h |
||
11 | |||
12 | Abstract: |
||
13 | |||
14 | Global EFI runtime & boot service interfaces |
||
15 | |||
16 | |||
17 | |||
18 | |||
19 | Revision History |
||
20 | |||
21 | --*/ |
||
22 | |||
23 | // |
||
24 | // EFI Specification Revision |
||
25 | // |
||
26 | |||
27 | #define EFI_SPECIFICATION_MAJOR_REVISION 1 |
||
28 | #define EFI_SPECIFICATION_MINOR_REVISION 02 |
||
29 | |||
30 | // |
||
31 | // Declare forward referenced data structures |
||
32 | // |
||
33 | |||
34 | INTERFACE_DECL(_EFI_SYSTEM_TABLE); |
||
35 | |||
36 | // |
||
37 | // EFI Memory |
||
38 | // |
||
39 | |||
40 | typedef |
||
41 | EFI_STATUS |
||
42 | (EFIAPI *EFI_ALLOCATE_PAGES) ( |
||
43 | IN EFI_ALLOCATE_TYPE Type, |
||
44 | IN EFI_MEMORY_TYPE MemoryType, |
||
45 | IN UINTN NoPages, |
||
46 | OUT EFI_PHYSICAL_ADDRESS *Memory |
||
47 | ); |
||
48 | |||
49 | typedef |
||
50 | EFI_STATUS |
||
51 | (EFIAPI *EFI_FREE_PAGES) ( |
||
52 | IN EFI_PHYSICAL_ADDRESS Memory, |
||
53 | IN UINTN NoPages |
||
54 | ); |
||
55 | |||
56 | typedef |
||
57 | EFI_STATUS |
||
58 | (EFIAPI *EFI_GET_MEMORY_MAP) ( |
||
59 | IN OUT UINTN *MemoryMapSize, |
||
60 | IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, |
||
61 | OUT UINTN *MapKey, |
||
62 | OUT UINTN *DescriptorSize, |
||
63 | OUT UINT32 *DescriptorVersion |
||
64 | ); |
||
65 | |||
66 | #define NextMemoryDescriptor(Ptr,Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size)) |
||
67 | |||
68 | |||
69 | typedef |
||
70 | EFI_STATUS |
||
71 | (EFIAPI *EFI_ALLOCATE_POOL) ( |
||
72 | IN EFI_MEMORY_TYPE PoolType, |
||
73 | IN UINTN Size, |
||
74 | OUT VOID **Buffer |
||
75 | ); |
||
76 | |||
77 | typedef |
||
78 | EFI_STATUS |
||
79 | (EFIAPI *EFI_FREE_POOL) ( |
||
80 | IN VOID *Buffer |
||
81 | ); |
||
82 | |||
83 | typedef |
||
84 | EFI_STATUS |
||
85 | (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( |
||
86 | IN UINTN MemoryMapSize, |
||
87 | IN UINTN DescriptorSize, |
||
88 | IN UINT32 DescriptorVersion, |
||
89 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap |
||
90 | ); |
||
91 | |||
92 | |||
93 | #define EFI_OPTIONAL_PTR 0x00000001 |
||
94 | #define EFI_INTERNAL_FNC 0x00000002 // Pointer to internal runtime fnc |
||
95 | #define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data |
||
96 | |||
97 | |||
98 | typedef |
||
99 | EFI_STATUS |
||
100 | (EFIAPI *EFI_CONVERT_POINTER) ( |
||
101 | IN UINTN DebugDisposition, |
||
102 | IN OUT VOID **Address |
||
103 | ); |
||
104 | |||
105 | |||
106 | // |
||
107 | // EFI Events |
||
108 | // |
||
109 | |||
110 | |||
111 | |||
112 | #define EVT_TIMER 0x80000000 |
||
113 | #define EVT_RUNTIME 0x40000000 |
||
114 | #define EVT_RUNTIME_CONTEXT 0x20000000 |
||
115 | |||
116 | #define EVT_NOTIFY_WAIT 0x00000100 |
||
117 | #define EVT_NOTIFY_SIGNAL 0x00000200 |
||
118 | |||
119 | #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 |
||
120 | #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 |
||
121 | |||
122 | #define EVT_EFI_SIGNAL_MASK 0x000000FF |
||
123 | #define EVT_EFI_SIGNAL_MAX 2 |
||
124 | |||
125 | typedef |
||
126 | VOID |
||
127 | (EFIAPI *EFI_EVENT_NOTIFY) ( |
||
128 | IN EFI_EVENT Event, |
||
129 | IN VOID *Context |
||
130 | ); |
||
131 | |||
132 | typedef |
||
133 | EFI_STATUS |
||
134 | (EFIAPI *EFI_CREATE_EVENT) ( |
||
135 | IN UINT32 Type, |
||
136 | IN EFI_TPL NotifyTpl, |
||
137 | IN EFI_EVENT_NOTIFY NotifyFunction, |
||
138 | IN VOID *NotifyContext, |
||
139 | OUT EFI_EVENT *Event |
||
140 | ); |
||
141 | |||
142 | typedef enum { |
||
143 | TimerCancel, |
||
144 | TimerPeriodic, |
||
145 | TimerRelative, |
||
146 | TimerTypeMax |
||
147 | } EFI_TIMER_DELAY; |
||
148 | |||
149 | typedef |
||
150 | EFI_STATUS |
||
151 | (EFIAPI *EFI_SET_TIMER) ( |
||
152 | IN EFI_EVENT Event, |
||
153 | IN EFI_TIMER_DELAY Type, |
||
154 | IN UINT64 TriggerTime |
||
155 | ); |
||
156 | |||
157 | typedef |
||
158 | EFI_STATUS |
||
159 | (EFIAPI *EFI_SIGNAL_EVENT) ( |
||
160 | IN EFI_EVENT Event |
||
161 | ); |
||
162 | |||
163 | typedef |
||
164 | EFI_STATUS |
||
165 | (EFIAPI *EFI_WAIT_FOR_EVENT) ( |
||
166 | IN UINTN NumberOfEvents, |
||
167 | IN EFI_EVENT *Event, |
||
168 | OUT UINTN *Index |
||
169 | ); |
||
170 | |||
171 | typedef |
||
172 | EFI_STATUS |
||
173 | (EFIAPI *EFI_CLOSE_EVENT) ( |
||
174 | IN EFI_EVENT Event |
||
175 | ); |
||
176 | |||
177 | typedef |
||
178 | EFI_STATUS |
||
179 | (EFIAPI *EFI_CHECK_EVENT) ( |
||
180 | IN EFI_EVENT Event |
||
181 | ); |
||
182 | |||
183 | // |
||
184 | // Task priority level |
||
185 | // |
||
186 | |||
187 | #define TPL_APPLICATION 4 |
||
188 | #define TPL_CALLBACK 8 |
||
189 | #define TPL_NOTIFY 16 |
||
190 | #define TPL_HIGH_LEVEL 31 |
||
191 | |||
192 | typedef |
||
193 | EFI_TPL |
||
194 | (EFIAPI *EFI_RAISE_TPL) ( |
||
195 | IN EFI_TPL NewTpl |
||
196 | ); |
||
197 | |||
198 | typedef |
||
199 | VOID |
||
200 | (EFIAPI *EFI_RESTORE_TPL) ( |
||
201 | IN EFI_TPL OldTpl |
||
202 | ); |
||
203 | |||
204 | |||
205 | // |
||
206 | // EFI platform varibles |
||
207 | // |
||
208 | |||
209 | #define EFI_GLOBAL_VARIABLE \ |
||
210 | { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } |
||
211 | |||
212 | // Variable attributes |
||
213 | #define EFI_VARIABLE_NON_VOLATILE 0x00000001 |
||
214 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 |
||
215 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 |
||
216 | |||
217 | // Variable size limitation |
||
218 | #define EFI_MAXIMUM_VARIABLE_SIZE 1024 |
||
219 | |||
220 | typedef |
||
221 | EFI_STATUS |
||
222 | (EFIAPI *EFI_GET_VARIABLE) ( |
||
223 | IN CHAR16 *VariableName, |
||
224 | IN EFI_GUID *VendorGuid, |
||
225 | OUT UINT32 *Attributes OPTIONAL, |
||
226 | IN OUT UINTN *DataSize, |
||
227 | OUT VOID *Data |
||
228 | ); |
||
229 | |||
230 | typedef |
||
231 | EFI_STATUS |
||
232 | (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) ( |
||
233 | IN OUT UINTN *VariableNameSize, |
||
234 | IN OUT CHAR16 *VariableName, |
||
235 | IN OUT EFI_GUID *VendorGuid |
||
236 | ); |
||
237 | |||
238 | |||
239 | typedef |
||
240 | EFI_STATUS |
||
241 | (EFIAPI *EFI_SET_VARIABLE) ( |
||
242 | IN CHAR16 *VariableName, |
||
243 | IN EFI_GUID *VendorGuid, |
||
244 | IN UINT32 Attributes, |
||
245 | IN UINTN DataSize, |
||
246 | IN VOID *Data |
||
247 | ); |
||
248 | |||
249 | |||
250 | // |
||
251 | // EFI Time |
||
252 | // |
||
253 | |||
254 | typedef struct { |
||
255 | UINT32 Resolution; // 1e-6 parts per million |
||
256 | UINT32 Accuracy; // hertz |
||
257 | BOOLEAN SetsToZero; // Set clears sub-second time |
||
258 | } EFI_TIME_CAPABILITIES; |
||
259 | |||
260 | |||
261 | typedef |
||
262 | EFI_STATUS |
||
263 | (EFIAPI *EFI_GET_TIME) ( |
||
264 | OUT EFI_TIME *Time, |
||
265 | OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL |
||
266 | ); |
||
267 | |||
268 | typedef |
||
269 | EFI_STATUS |
||
270 | (EFIAPI *EFI_SET_TIME) ( |
||
271 | IN EFI_TIME *Time |
||
272 | ); |
||
273 | |||
274 | typedef |
||
275 | EFI_STATUS |
||
276 | (EFIAPI *EFI_GET_WAKEUP_TIME) ( |
||
277 | OUT BOOLEAN *Enabled, |
||
278 | OUT BOOLEAN *Pending, |
||
279 | OUT EFI_TIME *Time |
||
280 | ); |
||
281 | |||
282 | typedef |
||
283 | EFI_STATUS |
||
284 | (EFIAPI *EFI_SET_WAKEUP_TIME) ( |
||
285 | IN BOOLEAN Enable, |
||
286 | IN EFI_TIME *Time OPTIONAL |
||
287 | ); |
||
288 | |||
289 | |||
290 | // |
||
291 | // Image functions |
||
292 | // |
||
293 | |||
294 | |||
295 | // PE32+ Subsystem type for EFI images |
||
296 | |||
297 | #if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION) |
||
298 | #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 |
||
299 | #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 |
||
300 | #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 |
||
301 | #endif |
||
302 | |||
303 | // PE32+ Machine type for EFI images |
||
304 | |||
305 | #if !defined(EFI_IMAGE_MACHINE_IA32) |
||
306 | #define EFI_IMAGE_MACHINE_IA32 0x014c |
||
307 | #endif |
||
308 | |||
309 | #if !defined(EFI_IMAGE_MACHINE_IA64) |
||
310 | #define EFI_IMAGE_MACHINE_IA64 0x0200 |
||
311 | #endif |
||
312 | |||
313 | // Image Entry prototype |
||
314 | |||
315 | typedef |
||
316 | EFI_STATUS |
||
317 | (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( |
||
318 | IN EFI_HANDLE ImageHandle, |
||
319 | IN struct _EFI_SYSTEM_TABLE *SystemTable |
||
320 | ); |
||
321 | |||
322 | typedef |
||
323 | EFI_STATUS |
||
324 | (EFIAPI *EFI_IMAGE_LOAD) ( |
||
325 | IN BOOLEAN BootPolicy, |
||
326 | IN EFI_HANDLE ParentImageHandle, |
||
327 | IN EFI_DEVICE_PATH *FilePath, |
||
328 | IN VOID *SourceBuffer OPTIONAL, |
||
329 | IN UINTN SourceSize, |
||
330 | OUT EFI_HANDLE *ImageHandle |
||
331 | ); |
||
332 | |||
333 | typedef |
||
334 | EFI_STATUS |
||
335 | (EFIAPI *EFI_IMAGE_START) ( |
||
336 | IN EFI_HANDLE ImageHandle, |
||
337 | OUT UINTN *ExitDataSize, |
||
338 | OUT CHAR16 **ExitData OPTIONAL |
||
339 | ); |
||
340 | |||
341 | typedef |
||
342 | EFI_STATUS |
||
343 | (EFIAPI *EFI_EXIT) ( |
||
344 | IN EFI_HANDLE ImageHandle, |
||
345 | IN EFI_STATUS ExitStatus, |
||
346 | IN UINTN ExitDataSize, |
||
347 | IN CHAR16 *ExitData OPTIONAL |
||
348 | ); |
||
349 | |||
350 | typedef |
||
351 | EFI_STATUS |
||
352 | (EFIAPI *EFI_IMAGE_UNLOAD) ( |
||
353 | IN EFI_HANDLE ImageHandle |
||
354 | ); |
||
355 | |||
356 | |||
357 | // Image handle |
||
358 | #define LOADED_IMAGE_PROTOCOL \ |
||
359 | { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } |
||
360 | |||
361 | #define EFI_IMAGE_INFORMATION_REVISION 0x1000 |
||
362 | typedef struct { |
||
363 | UINT32 Revision; |
||
364 | EFI_HANDLE ParentHandle; |
||
365 | struct _EFI_SYSTEM_TABLE *SystemTable; |
||
366 | |||
367 | // Source location of image |
||
368 | EFI_HANDLE DeviceHandle; |
||
369 | EFI_DEVICE_PATH *FilePath; |
||
370 | VOID *Reserved; |
||
371 | |||
372 | // Images load options |
||
373 | UINT32 LoadOptionsSize; |
||
374 | VOID *LoadOptions; |
||
375 | |||
376 | // Location of where image was loaded |
||
377 | VOID *ImageBase; |
||
378 | UINT64 ImageSize; |
||
379 | EFI_MEMORY_TYPE ImageCodeType; |
||
380 | EFI_MEMORY_TYPE ImageDataType; |
||
381 | |||
382 | // If the driver image supports a dynamic unload request |
||
383 | EFI_IMAGE_UNLOAD Unload; |
||
384 | |||
385 | } EFI_LOADED_IMAGE; |
||
386 | |||
387 | |||
388 | typedef |
||
389 | EFI_STATUS |
||
390 | (EFIAPI *EFI_EXIT_BOOT_SERVICES) ( |
||
391 | IN EFI_HANDLE ImageHandle, |
||
392 | IN UINTN MapKey |
||
393 | ); |
||
394 | |||
395 | // |
||
396 | // Misc |
||
397 | // |
||
398 | |||
399 | |||
400 | typedef |
||
401 | EFI_STATUS |
||
402 | (EFIAPI *EFI_STALL) ( |
||
403 | IN UINTN Microseconds |
||
404 | ); |
||
405 | |||
406 | typedef |
||
407 | EFI_STATUS |
||
408 | (EFIAPI *EFI_SET_WATCHDOG_TIMER) ( |
||
409 | IN UINTN Timeout, |
||
410 | IN UINT64 WatchdogCode, |
||
411 | IN UINTN DataSize, |
||
412 | IN CHAR16 *WatchdogData OPTIONAL |
||
413 | ); |
||
414 | |||
415 | |||
416 | typedef enum { |
||
417 | EfiResetCold, |
||
418 | EfiResetWarm |
||
419 | } EFI_RESET_TYPE; |
||
420 | |||
421 | typedef |
||
422 | EFI_STATUS |
||
423 | (EFIAPI *EFI_RESET_SYSTEM) ( |
||
424 | IN EFI_RESET_TYPE ResetType, |
||
425 | IN EFI_STATUS ResetStatus, |
||
426 | IN UINTN DataSize, |
||
427 | IN CHAR16 *ResetData OPTIONAL |
||
428 | ); |
||
429 | |||
430 | typedef |
||
431 | EFI_STATUS |
||
432 | (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) ( |
||
433 | OUT UINT64 *Count |
||
434 | ); |
||
435 | |||
436 | typedef |
||
437 | EFI_STATUS |
||
438 | (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) ( |
||
439 | OUT UINT32 *HighCount |
||
440 | ); |
||
441 | |||
442 | // |
||
443 | // Protocol handler functions |
||
444 | // |
||
445 | |||
446 | typedef enum { |
||
447 | EFI_NATIVE_INTERFACE, |
||
448 | EFI_PCODE_INTERFACE |
||
449 | } EFI_INTERFACE_TYPE; |
||
450 | |||
451 | typedef |
||
452 | EFI_STATUS |
||
453 | (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) ( |
||
454 | IN OUT EFI_HANDLE *Handle, |
||
455 | IN EFI_GUID *Protocol, |
||
456 | IN EFI_INTERFACE_TYPE InterfaceType, |
||
457 | IN VOID *Interface |
||
458 | ); |
||
459 | |||
460 | typedef |
||
461 | EFI_STATUS |
||
462 | (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) ( |
||
463 | IN EFI_HANDLE Handle, |
||
464 | IN EFI_GUID *Protocol, |
||
465 | IN VOID *OldInterface, |
||
466 | IN VOID *NewInterface |
||
467 | ); |
||
468 | |||
469 | typedef |
||
470 | EFI_STATUS |
||
471 | (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) ( |
||
472 | IN EFI_HANDLE Handle, |
||
473 | IN EFI_GUID *Protocol, |
||
474 | IN VOID *Interface |
||
475 | ); |
||
476 | |||
477 | typedef |
||
478 | EFI_STATUS |
||
479 | (EFIAPI *EFI_HANDLE_PROTOCOL) ( |
||
480 | IN EFI_HANDLE Handle, |
||
481 | IN EFI_GUID *Protocol, |
||
482 | OUT VOID **Interface |
||
483 | ); |
||
484 | |||
485 | typedef |
||
486 | EFI_STATUS |
||
487 | (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) ( |
||
488 | IN EFI_GUID *Protocol, |
||
489 | IN EFI_EVENT Event, |
||
490 | OUT VOID **Registration |
||
491 | ); |
||
492 | |||
493 | typedef enum { |
||
494 | AllHandles, |
||
495 | ByRegisterNotify, |
||
496 | ByProtocol |
||
497 | } EFI_LOCATE_SEARCH_TYPE; |
||
498 | |||
499 | typedef |
||
500 | EFI_STATUS |
||
501 | (EFIAPI *EFI_LOCATE_HANDLE) ( |
||
502 | IN EFI_LOCATE_SEARCH_TYPE SearchType, |
||
503 | IN EFI_GUID *Protocol OPTIONAL, |
||
504 | IN VOID *SearchKey OPTIONAL, |
||
505 | IN OUT UINTN *BufferSize, |
||
506 | OUT EFI_HANDLE *Buffer |
||
507 | ); |
||
508 | |||
509 | typedef |
||
510 | EFI_STATUS |
||
511 | (EFIAPI *EFI_LOCATE_DEVICE_PATH) ( |
||
512 | IN EFI_GUID *Protocol, |
||
513 | IN OUT EFI_DEVICE_PATH **DevicePath, |
||
514 | OUT EFI_HANDLE *Device |
||
515 | ); |
||
516 | |||
517 | typedef |
||
518 | EFI_STATUS |
||
519 | (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) ( |
||
520 | IN EFI_GUID *Guid, |
||
521 | IN VOID *Table |
||
522 | ); |
||
523 | |||
524 | typedef |
||
525 | EFI_STATUS |
||
526 | (EFIAPI *EFI_RESERVED_SERVICE) ( |
||
527 | ); |
||
528 | |||
529 | // |
||
530 | // Standard EFI table header |
||
531 | // |
||
532 | |||
533 | typedef struct _EFI_TABLE_HEARDER { |
||
534 | UINT64 Signature; |
||
535 | UINT32 Revision; |
||
536 | UINT32 HeaderSize; |
||
537 | UINT32 CRC32; |
||
538 | UINT32 Reserved; |
||
539 | } EFI_TABLE_HEADER; |
||
540 | |||
541 | |||
542 | // |
||
543 | // EFI Runtime Serivces Table |
||
544 | // |
||
545 | |||
546 | #define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552 |
||
547 | #define EFI_RUNTIME_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) |
||
548 | |||
549 | typedef struct { |
||
550 | EFI_TABLE_HEADER Hdr; |
||
551 | |||
552 | // |
||
553 | // Time services |
||
554 | // |
||
555 | |||
556 | EFI_GET_TIME GetTime; |
||
557 | EFI_SET_TIME SetTime; |
||
558 | EFI_GET_WAKEUP_TIME GetWakeupTime; |
||
559 | EFI_SET_WAKEUP_TIME SetWakeupTime; |
||
560 | |||
561 | // |
||
562 | // Virtual memory services |
||
563 | // |
||
564 | |||
565 | EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap; |
||
566 | EFI_CONVERT_POINTER ConvertPointer; |
||
567 | |||
568 | // |
||
569 | // Variable serviers |
||
570 | // |
||
571 | |||
572 | EFI_GET_VARIABLE GetVariable; |
||
573 | EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName; |
||
574 | EFI_SET_VARIABLE SetVariable; |
||
575 | |||
576 | // |
||
577 | // Misc |
||
578 | // |
||
579 | |||
580 | EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount; |
||
581 | EFI_RESET_SYSTEM ResetSystem; |
||
582 | |||
583 | } EFI_RUNTIME_SERVICES; |
||
584 | |||
585 | |||
586 | // |
||
587 | // EFI Boot Services Table |
||
588 | // |
||
589 | |||
590 | #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42 |
||
591 | #define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) |
||
592 | |||
593 | typedef struct _EFI_BOOT_SERVICES { |
||
594 | |||
595 | EFI_TABLE_HEADER Hdr; |
||
596 | |||
597 | // |
||
598 | // Task priority functions |
||
599 | // |
||
600 | |||
601 | EFI_RAISE_TPL RaiseTPL; |
||
602 | EFI_RESTORE_TPL RestoreTPL; |
||
603 | |||
604 | // |
||
605 | // Memory functions |
||
606 | // |
||
607 | |||
608 | EFI_ALLOCATE_PAGES AllocatePages; |
||
609 | EFI_FREE_PAGES FreePages; |
||
610 | EFI_GET_MEMORY_MAP GetMemoryMap; |
||
611 | EFI_ALLOCATE_POOL AllocatePool; |
||
612 | EFI_FREE_POOL FreePool; |
||
613 | |||
614 | // |
||
615 | // Event & timer functions |
||
616 | // |
||
617 | |||
618 | EFI_CREATE_EVENT CreateEvent; |
||
619 | EFI_SET_TIMER SetTimer; |
||
620 | EFI_WAIT_FOR_EVENT WaitForEvent; |
||
621 | EFI_SIGNAL_EVENT SignalEvent; |
||
622 | EFI_CLOSE_EVENT CloseEvent; |
||
623 | EFI_CHECK_EVENT CheckEvent; |
||
624 | |||
625 | // |
||
626 | // Protocol handler functions |
||
627 | // |
||
628 | |||
629 | EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface; |
||
630 | EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface; |
||
631 | EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface; |
||
632 | EFI_HANDLE_PROTOCOL HandleProtocol; |
||
633 | EFI_HANDLE_PROTOCOL PCHandleProtocol; |
||
634 | EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify; |
||
635 | EFI_LOCATE_HANDLE LocateHandle; |
||
636 | EFI_LOCATE_DEVICE_PATH LocateDevicePath; |
||
637 | EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable; |
||
638 | |||
639 | // |
||
640 | // Image functions |
||
641 | // |
||
642 | |||
643 | EFI_IMAGE_LOAD LoadImage; |
||
644 | EFI_IMAGE_START StartImage; |
||
645 | EFI_EXIT Exit; |
||
646 | EFI_IMAGE_UNLOAD UnloadImage; |
||
647 | EFI_EXIT_BOOT_SERVICES ExitBootServices; |
||
648 | |||
649 | // |
||
650 | // Misc functions |
||
651 | // |
||
652 | |||
653 | EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount; |
||
654 | EFI_STALL Stall; |
||
655 | EFI_SET_WATCHDOG_TIMER SetWatchdogTimer; |
||
656 | |||
657 | } EFI_BOOT_SERVICES; |
||
658 | |||
659 | |||
660 | // |
||
661 | // EFI Configuration Table and GUID definitions |
||
662 | // |
||
663 | |||
664 | #define MPS_TABLE_GUID \ |
||
665 | { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } |
||
666 | |||
667 | #define ACPI_TABLE_GUID \ |
||
668 | { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } |
||
669 | |||
670 | #define ACPI_20_TABLE_GUID \ |
||
671 | { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } |
||
672 | |||
673 | #define SMBIOS_TABLE_GUID \ |
||
674 | { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } |
||
675 | |||
676 | #define SAL_SYSTEM_TABLE_GUID \ |
||
677 | { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } |
||
678 | |||
679 | |||
680 | typedef struct _EFI_CONFIGURATION_TABLE { |
||
681 | EFI_GUID VendorGuid; |
||
682 | VOID *VendorTable; |
||
683 | } EFI_CONFIGURATION_TABLE; |
||
684 | |||
685 | |||
686 | // |
||
687 | // EFI System Table |
||
688 | // |
||
689 | |||
690 | |||
691 | |||
692 | |||
693 | #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249 |
||
694 | #define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) |
||
695 | |||
696 | typedef struct _EFI_SYSTEM_TABLE { |
||
697 | EFI_TABLE_HEADER Hdr; |
||
698 | |||
699 | CHAR16 *FirmwareVendor; |
||
700 | UINT32 FirmwareRevision; |
||
701 | |||
702 | EFI_HANDLE ConsoleInHandle; |
||
703 | SIMPLE_INPUT_INTERFACE *ConIn; |
||
704 | |||
705 | EFI_HANDLE ConsoleOutHandle; |
||
706 | SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut; |
||
707 | |||
708 | EFI_HANDLE StandardErrorHandle; |
||
709 | SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr; |
||
710 | |||
711 | EFI_RUNTIME_SERVICES *RuntimeServices; |
||
712 | EFI_BOOT_SERVICES *BootServices; |
||
713 | |||
714 | UINTN NumberOfTableEntries; |
||
715 | EFI_CONFIGURATION_TABLE *ConfigurationTable; |
||
716 | |||
717 | } EFI_SYSTEM_TABLE; |
||
718 | |||
719 | #endif |
||
720 |