Deleted Added
full compact
efiapi.h (123399) efiapi.h (163898)
1/* $FreeBSD: head/sys/boot/efi/include/efiapi.h 123399 2003-12-10 19:08:09Z jhb $ */
1/* $FreeBSD: head/sys/boot/efi/include/efiapi.h 163898 2006-11-02 02:42:48Z marcel $ */
2#ifndef _EFI_API_H
3#define _EFI_API_H
4
5/*++
6
2#ifndef _EFI_API_H
3#define _EFI_API_H
4
5/*++
6
7Copyright (c) 1998 Intel Corporation
7Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8This software and associated documentation (if any) is furnished
9under a license and may only be used or copied in accordance
10with the terms of the license. Except as permitted by such
11license, no part of this software or documentation may be
12reproduced, stored in a retrieval system, or transmitted in any
13form or by any means without the express written consent of
14Intel Corporation.
8
9Module Name:
10
11 efiapi.h
12
13Abstract:
14
15 Global EFI runtime & boot service interfaces
16
17
18
19
20Revision History
21
22--*/
23
15
16Module Name:
17
18 efiapi.h
19
20Abstract:
21
22 Global EFI runtime & boot service interfaces
23
24
25
26
27Revision History
28
29--*/
30
24/*
25 * EFI Specification Revision
26 */
31//
32// EFI Specification Revision
33//
27
28#define EFI_SPECIFICATION_MAJOR_REVISION 1
34
35#define EFI_SPECIFICATION_MAJOR_REVISION 1
29#define EFI_SPECIFICATION_MINOR_REVISION 02
36#define EFI_SPECIFICATION_MINOR_REVISION 10
30
37
31/*
32 * Declare forward referenced data structures
33 */
38//
39// Declare forward referenced data structures
40//
34
35INTERFACE_DECL(_EFI_SYSTEM_TABLE);
36
41
42INTERFACE_DECL(_EFI_SYSTEM_TABLE);
43
37/*
38 * EFI Memory
39 */
44//
45// EFI Memory
46//
40
41typedef
42EFI_STATUS
43(EFIAPI *EFI_ALLOCATE_PAGES) (
44 IN EFI_ALLOCATE_TYPE Type,
45 IN EFI_MEMORY_TYPE MemoryType,
46 IN UINTN NoPages,
47 OUT EFI_PHYSICAL_ADDRESS *Memory

--- 39 unchanged lines hidden (view full) ---

87 IN UINTN MemoryMapSize,
88 IN UINTN DescriptorSize,
89 IN UINT32 DescriptorVersion,
90 IN EFI_MEMORY_DESCRIPTOR *VirtualMap
91 );
92
93
94#define EFI_OPTIONAL_PTR 0x00000001
47
48typedef
49EFI_STATUS
50(EFIAPI *EFI_ALLOCATE_PAGES) (
51 IN EFI_ALLOCATE_TYPE Type,
52 IN EFI_MEMORY_TYPE MemoryType,
53 IN UINTN NoPages,
54 OUT EFI_PHYSICAL_ADDRESS *Memory

--- 39 unchanged lines hidden (view full) ---

94 IN UINTN MemoryMapSize,
95 IN UINTN DescriptorSize,
96 IN UINT32 DescriptorVersion,
97 IN EFI_MEMORY_DESCRIPTOR *VirtualMap
98 );
99
100
101#define EFI_OPTIONAL_PTR 0x00000001
95#define EFI_INTERNAL_FNC 0x00000002 /* Pointer to internal runtime fnc */
96#define EFI_INTERNAL_PTR 0x00000004 /* Pointer to internal runtime data */
102#define EFI_INTERNAL_FNC 0x00000002 // Pointer to internal runtime fnc
103#define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data
97
98
99typedef
100EFI_STATUS
101(EFIAPI *EFI_CONVERT_POINTER) (
102 IN UINTN DebugDisposition,
103 IN OUT VOID **Address
104 );
105
106
104
105
106typedef
107EFI_STATUS
108(EFIAPI *EFI_CONVERT_POINTER) (
109 IN UINTN DebugDisposition,
110 IN OUT VOID **Address
111 );
112
113
107/*
108 * EFI Events
109 */
114//
115// EFI Events
116//
110
111
112
113#define EVT_TIMER 0x80000000
114#define EVT_RUNTIME 0x40000000
115#define EVT_RUNTIME_CONTEXT 0x20000000
116
117#define EVT_NOTIFY_WAIT 0x00000100

--- 58 unchanged lines hidden (view full) ---

176 );
177
178typedef
179EFI_STATUS
180(EFIAPI *EFI_CHECK_EVENT) (
181 IN EFI_EVENT Event
182 );
183
117
118
119
120#define EVT_TIMER 0x80000000
121#define EVT_RUNTIME 0x40000000
122#define EVT_RUNTIME_CONTEXT 0x20000000
123
124#define EVT_NOTIFY_WAIT 0x00000100

--- 58 unchanged lines hidden (view full) ---

183 );
184
185typedef
186EFI_STATUS
187(EFIAPI *EFI_CHECK_EVENT) (
188 IN EFI_EVENT Event
189 );
190
184/*
185 * Task priority level
186 */
191//
192// Task priority level
193//
187
188#define TPL_APPLICATION 4
189#define TPL_CALLBACK 8
190#define TPL_NOTIFY 16
191#define TPL_HIGH_LEVEL 31
192
193typedef
194EFI_TPL
195(EFIAPI *EFI_RAISE_TPL) (
196 IN EFI_TPL NewTpl
197 );
198
199typedef
200VOID
201(EFIAPI *EFI_RESTORE_TPL) (
202 IN EFI_TPL OldTpl
203 );
204
205
194
195#define TPL_APPLICATION 4
196#define TPL_CALLBACK 8
197#define TPL_NOTIFY 16
198#define TPL_HIGH_LEVEL 31
199
200typedef
201EFI_TPL
202(EFIAPI *EFI_RAISE_TPL) (
203 IN EFI_TPL NewTpl
204 );
205
206typedef
207VOID
208(EFIAPI *EFI_RESTORE_TPL) (
209 IN EFI_TPL OldTpl
210 );
211
212
206/*
207 * EFI platform variables
208 */
213//
214// EFI platform varibles
215//
209
210#define EFI_GLOBAL_VARIABLE \
211 { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }
212
216
217#define EFI_GLOBAL_VARIABLE \
218 { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }
219
213/* Variable attributes */
220// Variable attributes
214#define EFI_VARIABLE_NON_VOLATILE 0x00000001
215#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
216#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
217
221#define EFI_VARIABLE_NON_VOLATILE 0x00000001
222#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
223#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
224
218/* Variable size limitation */
225// Variable size limitation
219#define EFI_MAXIMUM_VARIABLE_SIZE 1024
220
221typedef
222EFI_STATUS
223(EFIAPI *EFI_GET_VARIABLE) (
224 IN CHAR16 *VariableName,
225 IN EFI_GUID *VendorGuid,
226 OUT UINT32 *Attributes OPTIONAL,

--- 16 unchanged lines hidden (view full) ---

243 IN CHAR16 *VariableName,
244 IN EFI_GUID *VendorGuid,
245 IN UINT32 Attributes,
246 IN UINTN DataSize,
247 IN VOID *Data
248 );
249
250
226#define EFI_MAXIMUM_VARIABLE_SIZE 1024
227
228typedef
229EFI_STATUS
230(EFIAPI *EFI_GET_VARIABLE) (
231 IN CHAR16 *VariableName,
232 IN EFI_GUID *VendorGuid,
233 OUT UINT32 *Attributes OPTIONAL,

--- 16 unchanged lines hidden (view full) ---

250 IN CHAR16 *VariableName,
251 IN EFI_GUID *VendorGuid,
252 IN UINT32 Attributes,
253 IN UINTN DataSize,
254 IN VOID *Data
255 );
256
257
251/*
252 * EFI Time
253 */
258//
259// EFI Time
260//
254
255typedef struct {
261
262typedef struct {
256 UINT32 Resolution; /* 1e-6 parts per million */
257 UINT32 Accuracy; /* hertz */
258 BOOLEAN SetsToZero; /* Set clears sub-second time */
263 UINT32 Resolution; // 1e-6 parts per million
264 UINT32 Accuracy; // hertz
265 BOOLEAN SetsToZero; // Set clears sub-second time
259} EFI_TIME_CAPABILITIES;
260
261
262typedef
263EFI_STATUS
264(EFIAPI *EFI_GET_TIME) (
265 OUT EFI_TIME *Time,
266 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL

--- 16 unchanged lines hidden (view full) ---

283typedef
284EFI_STATUS
285(EFIAPI *EFI_SET_WAKEUP_TIME) (
286 IN BOOLEAN Enable,
287 IN EFI_TIME *Time OPTIONAL
288 );
289
290
266} EFI_TIME_CAPABILITIES;
267
268
269typedef
270EFI_STATUS
271(EFIAPI *EFI_GET_TIME) (
272 OUT EFI_TIME *Time,
273 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL

--- 16 unchanged lines hidden (view full) ---

290typedef
291EFI_STATUS
292(EFIAPI *EFI_SET_WAKEUP_TIME) (
293 IN BOOLEAN Enable,
294 IN EFI_TIME *Time OPTIONAL
295 );
296
297
291/*
292 * Image functions
293 */
298//
299// Image functions
300//
294
295
301
302
296/* PE32+ Subsystem type for EFI images */
303// PE32+ Subsystem type for EFI images
297
298#if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION)
299#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
300#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
301#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
302#endif
303
304
305#if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION)
306#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
307#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
308#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
309#endif
310
304/* PE32+ Machine type for EFI images */
311// PE32+ Machine type for EFI images
305
306#if !defined(EFI_IMAGE_MACHINE_IA32)
307#define EFI_IMAGE_MACHINE_IA32 0x014c
308#endif
309
310#if !defined(EFI_IMAGE_MACHINE_IA64)
311#define EFI_IMAGE_MACHINE_IA64 0x0200
312#endif
313
312
313#if !defined(EFI_IMAGE_MACHINE_IA32)
314#define EFI_IMAGE_MACHINE_IA32 0x014c
315#endif
316
317#if !defined(EFI_IMAGE_MACHINE_IA64)
318#define EFI_IMAGE_MACHINE_IA64 0x0200
319#endif
320
314/* Image Entry prototype */
321#if !defined(EFI_IMAGE_MACHINE_EBC)
322#define EFI_IMAGE_MACHINE_EBC 0x0EBC
323#endif
315
324
325// Image Entry prototype
326
316typedef
317EFI_STATUS
318(EFIAPI *EFI_IMAGE_ENTRY_POINT) (
319 IN EFI_HANDLE ImageHandle,
320 IN struct _EFI_SYSTEM_TABLE *SystemTable
321 );
322
323typedef

--- 26 unchanged lines hidden (view full) ---

350
351typedef
352EFI_STATUS
353(EFIAPI *EFI_IMAGE_UNLOAD) (
354 IN EFI_HANDLE ImageHandle
355 );
356
357
327typedef
328EFI_STATUS
329(EFIAPI *EFI_IMAGE_ENTRY_POINT) (
330 IN EFI_HANDLE ImageHandle,
331 IN struct _EFI_SYSTEM_TABLE *SystemTable
332 );
333
334typedef

--- 26 unchanged lines hidden (view full) ---

361
362typedef
363EFI_STATUS
364(EFIAPI *EFI_IMAGE_UNLOAD) (
365 IN EFI_HANDLE ImageHandle
366 );
367
368
358/* Image handle */
369// Image handle
359#define LOADED_IMAGE_PROTOCOL \
360 { 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
361
370#define LOADED_IMAGE_PROTOCOL \
371 { 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
372
362#define EFI_IMAGE_INFORMATION_REVISION 0x1000
373#define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000
363typedef struct {
364 UINT32 Revision;
365 EFI_HANDLE ParentHandle;
366 struct _EFI_SYSTEM_TABLE *SystemTable;
367
374typedef struct {
375 UINT32 Revision;
376 EFI_HANDLE ParentHandle;
377 struct _EFI_SYSTEM_TABLE *SystemTable;
378
368 /* Source location of image */
379 // Source location of image
369 EFI_HANDLE DeviceHandle;
370 EFI_DEVICE_PATH *FilePath;
371 VOID *Reserved;
372
380 EFI_HANDLE DeviceHandle;
381 EFI_DEVICE_PATH *FilePath;
382 VOID *Reserved;
383
373 /* Images load options */
384 // Images load options
374 UINT32 LoadOptionsSize;
375 VOID *LoadOptions;
376
385 UINT32 LoadOptionsSize;
386 VOID *LoadOptions;
387
377 /* Location of where image was loaded */
388 // Location of where image was loaded
378 VOID *ImageBase;
379 UINT64 ImageSize;
380 EFI_MEMORY_TYPE ImageCodeType;
381 EFI_MEMORY_TYPE ImageDataType;
382
389 VOID *ImageBase;
390 UINT64 ImageSize;
391 EFI_MEMORY_TYPE ImageCodeType;
392 EFI_MEMORY_TYPE ImageDataType;
393
383 /* If the driver image supports a dynamic unload request */
394 // If the driver image supports a dynamic unload request
384 EFI_IMAGE_UNLOAD Unload;
385
386} EFI_LOADED_IMAGE;
387
388
389typedef
390EFI_STATUS
391(EFIAPI *EFI_EXIT_BOOT_SERVICES) (
392 IN EFI_HANDLE ImageHandle,
393 IN UINTN MapKey
394 );
395
395 EFI_IMAGE_UNLOAD Unload;
396
397} EFI_LOADED_IMAGE;
398
399
400typedef
401EFI_STATUS
402(EFIAPI *EFI_EXIT_BOOT_SERVICES) (
403 IN EFI_HANDLE ImageHandle,
404 IN UINTN MapKey
405 );
406
396/*
397 * Misc
398 */
407//
408// Misc
409//
399
400
401typedef
402EFI_STATUS
403(EFIAPI *EFI_STALL) (
404 IN UINTN Microseconds
405 );
406

--- 4 unchanged lines hidden (view full) ---

411 IN UINT64 WatchdogCode,
412 IN UINTN DataSize,
413 IN CHAR16 *WatchdogData OPTIONAL
414 );
415
416
417typedef enum {
418 EfiResetCold,
410
411
412typedef
413EFI_STATUS
414(EFIAPI *EFI_STALL) (
415 IN UINTN Microseconds
416 );
417

--- 4 unchanged lines hidden (view full) ---

422 IN UINT64 WatchdogCode,
423 IN UINTN DataSize,
424 IN CHAR16 *WatchdogData OPTIONAL
425 );
426
427
428typedef enum {
429 EfiResetCold,
419 EfiResetWarm
430 EfiResetWarm,
431 EfiResetShutdown
420} EFI_RESET_TYPE;
421
422typedef
432} EFI_RESET_TYPE;
433
434typedef
423EFI_STATUS
435VOID
424(EFIAPI *EFI_RESET_SYSTEM) (
425 IN EFI_RESET_TYPE ResetType,
426 IN EFI_STATUS ResetStatus,
427 IN UINTN DataSize,
428 IN CHAR16 *ResetData OPTIONAL
429 );
430
431typedef
432EFI_STATUS
433(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (
434 OUT UINT64 *Count
435 );
436
437typedef
438EFI_STATUS
439(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (
440 OUT UINT32 *HighCount
441 );
442
436(EFIAPI *EFI_RESET_SYSTEM) (
437 IN EFI_RESET_TYPE ResetType,
438 IN EFI_STATUS ResetStatus,
439 IN UINTN DataSize,
440 IN CHAR16 *ResetData OPTIONAL
441 );
442
443typedef
444EFI_STATUS
445(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (
446 OUT UINT64 *Count
447 );
448
449typedef
450EFI_STATUS
451(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (
452 OUT UINT32 *HighCount
453 );
454
443/*
444 * Protocol handler functions
445 */
455//
456// Protocol handler functions
457//
446
447typedef enum {
458
459typedef enum {
448 EFI_NATIVE_INTERFACE,
449 EFI_PCODE_INTERFACE
460 EFI_NATIVE_INTERFACE
450} EFI_INTERFACE_TYPE;
451
452typedef
453EFI_STATUS
454(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
455 IN OUT EFI_HANDLE *Handle,
456 IN EFI_GUID *Protocol,
457 IN EFI_INTERFACE_TYPE InterfaceType,

--- 62 unchanged lines hidden (view full) ---

520(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
521 IN EFI_GUID *Guid,
522 IN VOID *Table
523 );
524
525typedef
526EFI_STATUS
527(EFIAPI *EFI_RESERVED_SERVICE) (
461} EFI_INTERFACE_TYPE;
462
463typedef
464EFI_STATUS
465(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
466 IN OUT EFI_HANDLE *Handle,
467 IN EFI_GUID *Protocol,
468 IN EFI_INTERFACE_TYPE InterfaceType,

--- 62 unchanged lines hidden (view full) ---

531(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
532 IN EFI_GUID *Guid,
533 IN VOID *Table
534 );
535
536typedef
537EFI_STATUS
538(EFIAPI *EFI_RESERVED_SERVICE) (
528 VOID
529 );
530
539 );
540
531/*
532 * Standard EFI table header
533 */
541typedef
542EFI_STATUS
543(EFIAPI *EFI_CONNECT_CONTROLLER) (
544 IN EFI_HANDLE ControllerHandle,
545 IN EFI_HANDLE *DriverImageHandle OPTIONAL,
546 IN EFI_DEVICE_PATH *RemainingDevicePath OPTIONAL,
547 IN BOOLEAN Recursive
548 );
534
549
550typedef
551EFI_STATUS
552(EFIAPI *EFI_DISCONNECT_CONTROLLER)(
553 IN EFI_HANDLE ControllerHandle,
554 IN EFI_HANDLE DriverImageHandle, OPTIONAL
555 IN EFI_HANDLE ChildHandle OPTIONAL
556 );
557
558#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
559#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
560#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
561#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
562#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
563#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
564
565typedef
566EFI_STATUS
567(EFIAPI *EFI_OPEN_PROTOCOL) (
568 IN EFI_HANDLE Handle,
569 IN EFI_GUID *Protocol,
570 OUT VOID **Interface,
571 IN EFI_HANDLE ImageHandle,
572 IN EFI_HANDLE ControllerHandle, OPTIONAL
573 IN UINT32 Attributes
574 );
575
576typedef
577EFI_STATUS
578(EFIAPI *EFI_CLOSE_PROTOCOL) (
579 IN EFI_HANDLE Handle,
580 IN EFI_GUID *Protocol,
581 IN EFI_HANDLE ImageHandle,
582 IN EFI_HANDLE DeviceHandle
583 );
584
585typedef struct {
586 EFI_HANDLE AgentHandle;
587 EFI_HANDLE ControllerHandle;
588 UINT32 Attributes;
589 UINT32 OpenCount;
590} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
591
592typedef
593EFI_STATUS
594(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
595 IN EFI_HANDLE UserHandle,
596 IN EFI_GUID *Protocol,
597 IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
598 OUT UINTN *EntryCount
599 );
600
601typedef
602EFI_STATUS
603(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
604 IN EFI_HANDLE UserHandle,
605 OUT EFI_GUID ***ProtocolBuffer,
606 OUT UINTN *ProtocolBufferCount
607 );
608
609typedef
610EFI_STATUS
611(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
612 IN EFI_LOCATE_SEARCH_TYPE SearchType,
613 IN EFI_GUID *Protocol OPTIONAL,
614 IN VOID *SearchKey OPTIONAL,
615 IN OUT UINTN *NumberHandles,
616 OUT EFI_HANDLE **Buffer
617 );
618
619typedef
620EFI_STATUS
621(EFIAPI *EFI_LOCATE_PROTOCOL) (
622 EFI_GUID *Protocol,
623 VOID *Registration, OPTIONAL
624 VOID **Interface
625 );
626
627typedef
628EFI_STATUS
629(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
630 IN OUT EFI_HANDLE *Handle,
631 ...
632 );
633
634typedef
635EFI_STATUS
636(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
637 IN EFI_HANDLE Handle,
638 ...
639 );
640
641typedef
642EFI_STATUS
643(EFIAPI *EFI_CALCULATE_CRC32) (
644 IN VOID *Data,
645 IN UINTN DataSize,
646 OUT UINT32 *Crc32
647 );
648
649typedef
650VOID
651(EFIAPI *EFI_COPY_MEM) (
652 IN VOID *Destination,
653 IN VOID *Source,
654 IN UINTN Length
655 );
656
657typedef
658VOID
659(EFIAPI *EFI_SET_MEM) (
660 IN VOID *Buffer,
661 IN UINTN Size,
662 IN UINT8 Value
663 );
664
665//
666// Standard EFI table header
667//
668
535typedef struct _EFI_TABLE_HEARDER {
669typedef struct _EFI_TABLE_HEARDER {
536 UINT64 Signature;
537 UINT32 Revision;
538 UINT32 HeaderSize;
539 UINT32 CRC32;
540 UINT32 Reserved;
670 UINT64 Signature;
671 UINT32 Revision;
672 UINT32 HeaderSize;
673 UINT32 CRC32;
674 UINT32 Reserved;
541} EFI_TABLE_HEADER;
542
543
675} EFI_TABLE_HEADER;
676
677
544/*
545 * EFI Runtime Serivces Table
546 */
678//
679// EFI Runtime Serivces Table
680//
547
548#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
681
682#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
549#define EFI_RUNTIME_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
683#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
550
551typedef struct {
684
685typedef struct {
552 EFI_TABLE_HEADER Hdr;
686 EFI_TABLE_HEADER Hdr;
553
687
554 /* Time services */
688 //
689 // Time services
690 //
555
691
556 EFI_GET_TIME GetTime;
557 EFI_SET_TIME SetTime;
558 EFI_GET_WAKEUP_TIME GetWakeupTime;
559 EFI_SET_WAKEUP_TIME SetWakeupTime;
692 EFI_GET_TIME GetTime;
693 EFI_SET_TIME SetTime;
694 EFI_GET_WAKEUP_TIME GetWakeupTime;
695 EFI_SET_WAKEUP_TIME SetWakeupTime;
560
696
561 /* Virtual memory services */
697 //
698 // Virtual memory services
699 //
562
700
563 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
564 EFI_CONVERT_POINTER ConvertPointer;
701 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
702 EFI_CONVERT_POINTER ConvertPointer;
565
703
566 /* Variable serviers */
704 //
705 // Variable serviers
706 //
567
707
568 EFI_GET_VARIABLE GetVariable;
569 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
570 EFI_SET_VARIABLE SetVariable;
708 EFI_GET_VARIABLE GetVariable;
709 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
710 EFI_SET_VARIABLE SetVariable;
571
711
572 /* Misc */
712 //
713 // Misc
714 //
573
715
574 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
575 EFI_RESET_SYSTEM ResetSystem;
716 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
717 EFI_RESET_SYSTEM ResetSystem;
576
577} EFI_RUNTIME_SERVICES;
578
579
718
719} EFI_RUNTIME_SERVICES;
720
721
580/*
581 * EFI Boot Services Table
582 */
722//
723// EFI Boot Services Table
724//
583
584#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
725
726#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
585#define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
727#define EFI_BOOT_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
586
728
587typedef struct _EFI_BOOT_SERVICES {
729typedef struct {
588
730
589 EFI_TABLE_HEADER Hdr;
731 EFI_TABLE_HEADER Hdr;
590
732
591 /* Task priority functions */
733 //
734 // Task priority functions
735 //
592
736
593 EFI_RAISE_TPL RaiseTPL;
594 EFI_RESTORE_TPL RestoreTPL;
737 EFI_RAISE_TPL RaiseTPL;
738 EFI_RESTORE_TPL RestoreTPL;
595
739
596 /* Memory functions */
740 //
741 // Memory functions
742 //
597
743
598 EFI_ALLOCATE_PAGES AllocatePages;
599 EFI_FREE_PAGES FreePages;
600 EFI_GET_MEMORY_MAP GetMemoryMap;
601 EFI_ALLOCATE_POOL AllocatePool;
602 EFI_FREE_POOL FreePool;
744 EFI_ALLOCATE_PAGES AllocatePages;
745 EFI_FREE_PAGES FreePages;
746 EFI_GET_MEMORY_MAP GetMemoryMap;
747 EFI_ALLOCATE_POOL AllocatePool;
748 EFI_FREE_POOL FreePool;
603
749
604 /* Event & timer functions */
750 //
751 // Event & timer functions
752 //
605
753
606 EFI_CREATE_EVENT CreateEvent;
607 EFI_SET_TIMER SetTimer;
608 EFI_WAIT_FOR_EVENT WaitForEvent;
609 EFI_SIGNAL_EVENT SignalEvent;
610 EFI_CLOSE_EVENT CloseEvent;
611 EFI_CHECK_EVENT CheckEvent;
754 EFI_CREATE_EVENT CreateEvent;
755 EFI_SET_TIMER SetTimer;
756 EFI_WAIT_FOR_EVENT WaitForEvent;
757 EFI_SIGNAL_EVENT SignalEvent;
758 EFI_CLOSE_EVENT CloseEvent;
759 EFI_CHECK_EVENT CheckEvent;
612
760
613 /* Protocol handler functions */
761 //
762 // Protocol handler functions
763 //
614
764
615 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
616 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
617 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
618 EFI_HANDLE_PROTOCOL HandleProtocol;
619 EFI_HANDLE_PROTOCOL PCHandleProtocol;
620 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
621 EFI_LOCATE_HANDLE LocateHandle;
622 EFI_LOCATE_DEVICE_PATH LocateDevicePath;
623 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
765 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
766 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
767 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
768 EFI_HANDLE_PROTOCOL HandleProtocol;
769 VOID *Reserved;
770 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
771 EFI_LOCATE_HANDLE LocateHandle;
772 EFI_LOCATE_DEVICE_PATH LocateDevicePath;
773 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
624
774
625 /* Image functions */
775 //
776 // Image functions
777 //
626
778
627 EFI_IMAGE_LOAD LoadImage;
628 EFI_IMAGE_START StartImage;
629 EFI_EXIT Exit;
630 EFI_IMAGE_UNLOAD UnloadImage;
631 EFI_EXIT_BOOT_SERVICES ExitBootServices;
779 EFI_IMAGE_LOAD LoadImage;
780 EFI_IMAGE_START StartImage;
781 EFI_EXIT Exit;
782 EFI_IMAGE_UNLOAD UnloadImage;
783 EFI_EXIT_BOOT_SERVICES ExitBootServices;
632
784
633 /* Misc functions */
785 //
786 // Misc functions
787 //
634
788
635 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
636 EFI_STALL Stall;
637 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
789 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
790 EFI_STALL Stall;
791 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
638
792
793 //
794 // DriverSupport Services
795 //
796 EFI_CONNECT_CONTROLLER ConnectController;
797 EFI_DISCONNECT_CONTROLLER DisconnectController;
798
799 //
800 // Open and Close Protocol Services
801 //
802 EFI_OPEN_PROTOCOL OpenProtocol;
803 EFI_CLOSE_PROTOCOL CloseProtocol;
804 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
805
806 //
807 // Library Services to reduce size of drivers
808 //
809 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
810 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
811 EFI_LOCATE_PROTOCOL LocateProtocol;
812
813 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
814 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
815
816 //
817 // CRC32 services
818 //
819 EFI_CALCULATE_CRC32 CalculateCrc32;
820
821 //
822 // Memory Utility Services
823 //
824 EFI_COPY_MEM CopyMem;
825 EFI_SET_MEM SetMem;
826
639} EFI_BOOT_SERVICES;
640
641
827} EFI_BOOT_SERVICES;
828
829
642/*
643 * EFI Configuration Table and GUID definitions
644 */
830//
831// EFI Configuration Table and GUID definitions
832//
645
646#define MPS_TABLE_GUID \
833
834#define MPS_TABLE_GUID \
647 { 0xeb9d2d2f, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
835 { 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
648
649#define ACPI_TABLE_GUID \
836
837#define ACPI_TABLE_GUID \
650 { 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
838 { 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
651
652#define ACPI_20_TABLE_GUID \
839
840#define ACPI_20_TABLE_GUID \
653 { 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
841 { 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
654
655#define SMBIOS_TABLE_GUID \
842
843#define SMBIOS_TABLE_GUID \
656 { 0xeb9d2d31, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
844 { 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
657
658#define SAL_SYSTEM_TABLE_GUID \
845
846#define SAL_SYSTEM_TABLE_GUID \
659 { 0xeb9d2d32, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
847 { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
660
848
661/* DIG64 Headless Console & Debug Port Table. */
662#define HCDP_TABLE_GUID \
663 {0xf951938d,0x620b,0x42ef,{0x82,0x79,0xa8,0x4b,0x79,0x61,0x78,0x98}}
664
665typedef struct _EFI_CONFIGURATION_TABLE {
849
850typedef struct _EFI_CONFIGURATION_TABLE {
666 EFI_GUID VendorGuid;
667 VOID *VendorTable;
851 EFI_GUID VendorGuid;
852 VOID *VendorTable;
668} EFI_CONFIGURATION_TABLE;
669
670
853} EFI_CONFIGURATION_TABLE;
854
855
671/*
672 * EFI System Table
673 */
856//
857// EFI System Table
858//
674
675
676
677
678#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
859
860
861
862
863#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
679#define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
864#define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
865#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | 10)
866#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | 02)
680
681typedef struct _EFI_SYSTEM_TABLE {
867
868typedef struct _EFI_SYSTEM_TABLE {
682 EFI_TABLE_HEADER Hdr;
869 EFI_TABLE_HEADER Hdr;
683
870
684 CHAR16 *FirmwareVendor;
685 UINT32 FirmwareRevision;
871 CHAR16 *FirmwareVendor;
872 UINT32 FirmwareRevision;
686
873
687 EFI_HANDLE ConsoleInHandle;
688 SIMPLE_INPUT_INTERFACE *ConIn;
874 EFI_HANDLE ConsoleInHandle;
875 SIMPLE_INPUT_INTERFACE *ConIn;
689
876
690 EFI_HANDLE ConsoleOutHandle;
691 SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
877 EFI_HANDLE ConsoleOutHandle;
878 SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
692
879
693 EFI_HANDLE StandardErrorHandle;
694 SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
880 EFI_HANDLE StandardErrorHandle;
881 SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
695
882
696 EFI_RUNTIME_SERVICES *RuntimeServices;
697 EFI_BOOT_SERVICES *BootServices;
883 EFI_RUNTIME_SERVICES *RuntimeServices;
884 EFI_BOOT_SERVICES *BootServices;
698
885
699 UINTN NumberOfTableEntries;
700 EFI_CONFIGURATION_TABLE *ConfigurationTable;
886 UINTN NumberOfTableEntries;
887 EFI_CONFIGURATION_TABLE *ConfigurationTable;
701
702} EFI_SYSTEM_TABLE;
703
704#endif
888
889} EFI_SYSTEM_TABLE;
890
891#endif