3 Copyright (c) 2004 - 2007, 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
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.
18 EFI intrinsic definitions. This includes all EFI 1.0 boot and runtime
21 Drivers and applications are passed in a pointer to the EFI system table.
22 The EFI system table contains pointers to the boot and runtime services
30 #include EFI_PROTOCOL_DEFINITION (DevicePath)
31 #include EFI_PROTOCOL_DEFINITION (SimpleTextIn)
32 #include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
34 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
35 #include "EfiCapsule.h"
37 #include "EfiStatusCode.h"
41 // Declare forward referenced data structures
43 EFI_FORWARD_DECLARATION (EFI_SYSTEM_TABLE
);
51 (EFIAPI
*EFI_ALLOCATE_PAGES
) (
52 IN EFI_ALLOCATE_TYPE Type
,
53 IN EFI_MEMORY_TYPE MemoryType
,
55 OUT EFI_PHYSICAL_ADDRESS
* Memory
61 (EFIAPI
*EFI_FREE_PAGES
) (
62 IN EFI_PHYSICAL_ADDRESS Memory
,
69 (EFIAPI
*EFI_GET_MEMORY_MAP
) (
70 IN OUT UINTN
*MemoryMapSize
,
71 IN OUT EFI_MEMORY_DESCRIPTOR
* MemoryMap
,
73 OUT UINTN
*DescriptorSize
,
74 OUT UINT32
*DescriptorVersion
77 #define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
78 #define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)
83 (EFIAPI
*EFI_ALLOCATE_POOL
) (
84 IN EFI_MEMORY_TYPE PoolType
,
92 (EFIAPI
*EFI_FREE_POOL
) (
99 (EFIAPI
*EFI_SET_VIRTUAL_ADDRESS_MAP
) (
100 IN UINTN MemoryMapSize
,
101 IN UINTN DescriptorSize
,
102 IN UINT32 DescriptorVersion
,
103 IN EFI_MEMORY_DESCRIPTOR
* VirtualMap
109 (EFIAPI
*EFI_CONNECT_CONTROLLER
) (
110 IN EFI_HANDLE ControllerHandle
,
111 IN EFI_HANDLE
* DriverImageHandle OPTIONAL
,
112 IN EFI_DEVICE_PATH_PROTOCOL
* RemainingDevicePath OPTIONAL
,
119 (EFIAPI
*EFI_DISCONNECT_CONTROLLER
) (
120 IN EFI_HANDLE ControllerHandle
,
121 IN EFI_HANDLE DriverImageHandle
, OPTIONAL
122 IN EFI_HANDLE ChildHandle OPTIONAL
126 // ConvertPointer DebugDisposition type.
128 #define EFI_OPTIONAL_POINTER 0x00000001
133 (EFIAPI
*EFI_CONVERT_POINTER
) (
134 IN UINTN DebugDisposition
,
135 IN OUT VOID
**Address
141 #define EFI_EVENT_TIMER 0x80000000
142 #define EFI_EVENT_RUNTIME 0x40000000
143 #define EFI_EVENT_RUNTIME_CONTEXT 0x20000000
145 #define EFI_EVENT_NOTIFY_WAIT 0x00000100
146 #define EFI_EVENT_NOTIFY_SIGNAL 0x00000200
148 #define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
149 #define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
151 #define EFI_EVENT_EFI_SIGNAL_MASK 0x000000FF
152 #define EFI_EVENT_EFI_SIGNAL_MAX 4
156 (EFIAPI
*EFI_EVENT_NOTIFY
) (
164 (EFIAPI
*EFI_CREATE_EVENT
) (
166 IN EFI_TPL NotifyTpl
,
167 IN EFI_EVENT_NOTIFY NotifyFunction
,
168 IN VOID
*NotifyContext
,
169 OUT EFI_EVENT
* Event
175 (EFIAPI
*EFI_CREATE_EVENT_EX
) (
177 IN EFI_TPL NotifyTpl OPTIONAL
,
178 IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL
,
179 IN CONST VOID
*NotifyContext OPTIONAL
,
180 IN CONST EFI_GUID
*EventGroup OPTIONAL
,
194 (EFIAPI
*EFI_SET_TIMER
) (
196 IN EFI_TIMER_DELAY Type
,
197 IN UINT64 TriggerTime
203 (EFIAPI
*EFI_SIGNAL_EVENT
) (
210 (EFIAPI
*EFI_WAIT_FOR_EVENT
) (
211 IN UINTN NumberOfEvents
,
212 IN EFI_EVENT
* Event
,
219 (EFIAPI
*EFI_CLOSE_EVENT
) (
226 (EFIAPI
*EFI_CHECK_EVENT
) (
231 // Task priority level
233 #define EFI_TPL_APPLICATION 4
234 #define EFI_TPL_CALLBACK 8
235 #define EFI_TPL_NOTIFY 16
236 #define EFI_TPL_HIGH_LEVEL 31
241 (EFIAPI
*EFI_RAISE_TPL
) (
248 (EFIAPI
*EFI_RESTORE_TPL
) (
253 // Variable attributes
255 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
256 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
257 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
259 #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
260 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
266 (EFIAPI
*EFI_GET_VARIABLE
) (
267 IN CHAR16
*VariableName
,
268 IN EFI_GUID
* VendorGuid
,
269 OUT UINT32
*Attributes OPTIONAL
,
270 IN OUT UINTN
*DataSize
,
277 (EFIAPI
*EFI_GET_NEXT_VARIABLE_NAME
) (
278 IN OUT UINTN
*VariableNameSize
,
279 IN OUT CHAR16
*VariableName
,
280 IN OUT EFI_GUID
* VendorGuid
286 (EFIAPI
*EFI_SET_VARIABLE
) (
287 IN CHAR16
*VariableName
,
288 IN EFI_GUID
* VendorGuid
,
289 IN UINT32 Attributes
,
301 } EFI_TIME_CAPABILITIES
;
306 (EFIAPI
*EFI_GET_TIME
) (
308 OUT EFI_TIME_CAPABILITIES
* Capabilities OPTIONAL
314 (EFIAPI
*EFI_SET_TIME
) (
321 (EFIAPI
*EFI_GET_WAKEUP_TIME
) (
322 OUT BOOLEAN
*Enabled
,
323 OUT BOOLEAN
*Pending
,
330 (EFIAPI
*EFI_SET_WAKEUP_TIME
) (
332 IN EFI_TIME
* Time OPTIONAL
336 // Image Entry prototype
340 (EFIAPI
*EFI_IMAGE_ENTRY_POINT
) (
341 IN EFI_HANDLE ImageHandle
,
342 IN EFI_SYSTEM_TABLE
* SystemTable
351 (EFIAPI
*EFI_IMAGE_LOAD
) (
352 IN BOOLEAN BootPolicy
,
353 IN EFI_HANDLE ParentImageHandle
,
354 IN EFI_DEVICE_PATH_PROTOCOL
* FilePath
,
355 IN VOID
*SourceBuffer OPTIONAL
,
357 OUT EFI_HANDLE
* ImageHandle
363 (EFIAPI
*EFI_IMAGE_START
) (
364 IN EFI_HANDLE ImageHandle
,
365 OUT UINTN
*ExitDataSize
,
366 OUT CHAR16
**ExitData OPTIONAL
373 IN EFI_HANDLE ImageHandle
,
374 IN EFI_STATUS ExitStatus
,
375 IN UINTN ExitDataSize
,
376 IN CHAR16
*ExitData OPTIONAL
382 (EFIAPI
*EFI_IMAGE_UNLOAD
) (
383 IN EFI_HANDLE ImageHandle
389 (EFIAPI
*EFI_EXIT_BOOT_SERVICES
) (
390 IN EFI_HANDLE ImageHandle
,
400 (EFIAPI
*EFI_STALL
) (
401 IN UINTN Microseconds
407 (EFIAPI
*EFI_SET_WATCHDOG_TIMER
) (
409 IN UINT64 WatchdogCode
,
411 IN CHAR16
*WatchdogData OPTIONAL
419 #if ((TIANO_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
428 (EFIAPI
*EFI_RESET_SYSTEM
) (
429 IN EFI_RESET_TYPE ResetType
,
430 IN EFI_STATUS ResetStatus
,
432 IN CHAR16
*ResetData OPTIONAL
438 (EFIAPI
*EFI_GET_NEXT_MONOTONIC_COUNT
) (
445 (EFIAPI
*EFI_GET_NEXT_HIGH_MONO_COUNT
) (
446 OUT UINT32
*HighCount
452 (EFIAPI
*EFI_CALCULATE_CRC32
) (
461 (EFIAPI
*EFI_COPY_MEM
) (
462 IN VOID
*Destination
,
470 (EFIAPI
*EFI_SET_MEM
) (
477 // Protocol handler functions
481 } EFI_INTERFACE_TYPE
;
486 (EFIAPI
*EFI_INSTALL_PROTOCOL_INTERFACE
) (
487 IN OUT EFI_HANDLE
* Handle
,
488 IN EFI_GUID
* Protocol
,
489 IN EFI_INTERFACE_TYPE InterfaceType
,
496 (EFIAPI
*EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES
) (
497 IN OUT EFI_HANDLE
* Handle
,
504 (EFIAPI
*EFI_REINSTALL_PROTOCOL_INTERFACE
) (
505 IN EFI_HANDLE Handle
,
506 IN EFI_GUID
* Protocol
,
507 IN VOID
*OldInterface
,
508 IN VOID
*NewInterface
514 (EFIAPI
*EFI_UNINSTALL_PROTOCOL_INTERFACE
) (
515 IN EFI_HANDLE Handle
,
516 IN EFI_GUID
* Protocol
,
523 (EFIAPI
*EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
) (
524 IN EFI_HANDLE Handle
,
531 (EFIAPI
*EFI_HANDLE_PROTOCOL
) (
532 IN EFI_HANDLE Handle
,
533 IN EFI_GUID
* Protocol
,
537 #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
538 #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
539 #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
540 #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
541 #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
542 #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
545 // ///////////////////////////////////////////////////////////////////////////////////////////////
546 // OpenProtocol() Attribute Values
547 /////////////////////////////////////////////////////////////////////////////////////////////////
548 // BY_HANDLE_PROTOCOL - Used by EFI 1.0 Drivers and Applications
549 // May not actually add an elemnt to the open list in a production build
551 // GET_PROTOCOL - Used by EFI 1.1 Drivers to get a protocol interface
552 // May not actually add an elemnt to the open list in a production build
554 // TEST_PROTOCOL - Used by EFI 1.1 Drivers to test for the existence of a protocol interface
555 // The interface is not returned, and it is an optional parameter tham may be NULL.
556 // May not actually add an elemnt to the open list in a production build
558 // BY_DRIVER - Used by EFI 1.1 Drivers that are able to share a protocol with other
559 // agents other than its children. A driver is always able to share
560 // a protocol with its children, since the driver is in control of the
561 // parent controller's and the child controller's use of the protocol.
563 // BY_DRIVER | EXCLUSIVE - Used by EFI 1.1 Drivers that will not share a protocol with any other
564 // agents except its children. A driver is always able to share
565 // a protocol with its children, since the driver is in control of the
566 // parent controller's and the child controller's use of the protocol.
567 // This attribute will force all other drivers to disconnect from the protocol
568 // before this driver attaches. When this driver closes the handle, the other
569 // drivers will reconnect to the protocol.
572 // BY_CHILD_CONTROLLER - Used by EFI 1.1 Driver to show that a protocol is consumed by a child
573 // of the driver. This is information used by DisconnectController() to
574 // determine the list of children that a protocol has. It has
575 // no affect on the OpenProtocol()/ClosePrototocol() behavior.
577 // EXCLUSIVE - Used by EFI 1.1 Applications to gain exclusive access to a protocol.
578 // All drivers are disconnected from the handle while the application has
579 // the handle open. These drivers are reconnected when the application
580 // closes the handle.
582 /////////////////////////////////////////////////////////////////////////////////////////////////
583 // OpenProtocol() behavior based on Attribute values
584 /////////////////////////////////////////////////////////////////////////////////////////////////
586 // OpenProtocol (Handle, Protocol, Interface, ImageHandle, DeviceHandle, Attributes)
587 // * EFI_UNSUPPORTED if Protocol does not exist on Handle
588 // * EFI_INVALID_PARAMETER if Handle is not a valid handle.
589 // * EFI_INVALID_PARAMETER if Protocol is NULL or not a valid GUID
590 // * EFI_INVALID_PARAMETER if Interface is NULL
591 // * EFI_INVALID_PARAMETER if Attributes is not one of the following values:
592 // BY_HANDLE_PROTOCOL
595 // BY_CHILD_CONTROLLER
597 // BY_DRIVER | EXCLUSIVE
599 // * EFI_INVALID_PARAMETER if Attributes BY_CHILD_CONTROLLER and ImageHandle is not a valid handle
600 // * EFI_INVALID_PARAMETER if Attributes BY_CHILD_CONTROLLER and DeviceHandle is not a valid handle
601 // * EFI_INVALID_PARAMETER if Attributes BY_CHILD_CONTROLLER and Handle == DeviceHandle
602 // * EFI_INVALID_PARAMETER if Attributes BY_DRIVER and ImageHandle is not a valid handle
603 // * EFI_INVALID_PARAMETER if Attributes BY_DRIVER and DeviceHandle is not a valid handle
604 // * EFI_INVALID_PARAMETER if Attributes BY_DRIVER | EXCLUSIVE and ImageHandle is not a valid handle
605 // * EFI_INVALID_PARAMETER if Attributes BY_DRIVER | EXCLUSIVE and DeviceHandle is not a valid handle
606 // * EFI_INVALID_PARAMETER if Attributes EXCLUSIVE and ImageHandle is not a valid handle
608 // OpenProtocol() Attributes = BY_HANDLE_PROTOCOL, GET_PROTOCOL, TEST_PROTOCOL, BY_CHILD_CONTROLLER
609 // * EFI_SUCCESS if Protocol exists on the Handle
611 // OpenProtocol() Attributes = BY_DRIVER
612 // * EFI_SUCCESS if there are no items in the Open List for (Handle, Protocol)
613 // * EFI_SUCCESS if there are only items in the Open List for (Handle, Protocol)
614 // that have the one of the following Attributes
615 // BY_HANDLE_PROTOCOL
618 // BY_CHILD_CONTROLLER
619 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
620 // that have the one of the following Attributes
622 // AND ImageHandle != OpenListItem.IH
623 // * EFI_ALREADY_STARTED if there are any items in the Open List for (Handle, Protocol)
624 // that have the one of the following Attributes
626 // AND ImageHandle == OpenListItem.IH
627 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
628 // that have the one of the following Attributes
629 // BY_DRIVER | EXCLUSIVE
632 // OpenProtocol() Attributes = BY_DRIVER | EXCLUSIVE
633 // * EFI_SUCCESS if there are no items in the Open List for (Handle, Protocol)
634 // * EFI_SUCCESS if there are only items in the Open List for (Handle, Protocol)
635 // that have the one of the following Attributes
636 // BY_HANDLE_PROTOCOL
639 // BY_CHILD_CONTROLLER
640 // * EFI_SUCCESS if there are any items in the Open List for (Handle, Protocol)
641 // that have the one of the following Attributes
643 // AND the driver is removed by DisconnectController(IH,DH)
644 // * EFI_ALREADY_STARTED if there are any items in the Open List for (Handle, Protocol)
645 // that have the one of the following Attributes
646 // BY_DRIVER | EXCLUSIVE
647 // AND ImageHandle == OpenListItem.IH
648 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
649 // that have the one of the following Attributes
651 // AND the driver can not be removed by DisconnectController(IH,DH)
652 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
653 // that have the one of the following Attributes
654 // BY_DRIVER | EXCLUSIVE
657 // OpenProtocol() Attributes = EXCLUSIVE
658 // * EFI_SUCCESS if there are no items in the Open List for (Handle, Protocol)
659 // * EFI_SUCCESS if there are only items in the Open List for (Handle, Protocol)
660 // that have the one of the following Attributes
661 // BY_HANDLE_PROTOCOL
664 // BY_CHILD_CONTROLLER
665 // * EFI_SUCCESS if there are any items in the Open List for (Handle, Protocol)
666 // that have the one of the following Attributes
668 // AND the driver is removed by DisconnectController(IH,DH)
669 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
670 // that have the one of the following Attributes
672 // AND the driver can not be removed by DisconnectController(IH,DH)
673 // * EFI_ACCESS_DENIED if there are any items in the Open List for (Handle, Protocol)
674 // that have the one of the following Attributes
675 // BY_DRIVER | EXCLUSIVE
678 /////////////////////////////////////////////////////////////////////////////////////////////////
679 // CloseProtocol() Behavior based on the Attributes of the item being closed and the items
680 // remaining on the Open List
681 /////////////////////////////////////////////////////////////////////////////////////////////////
682 // CloseProtocol(Handle, Protocol, ImageHandle, DeviceHandle)
683 // CloseProtocol() Attributes of item = BY_HANDLE_PROTOCOL,
686 // BY_CHILD_CONTROLLER,
688 // BY_DRIVER | EXCLUSIVE
690 // EFI_NOT_FOUND if Protocol does not exist on Handle
691 // EFI_INVALID_PARAMETER if Handle is not a valid handle.
692 // EFI_INVALID_PARAMETER if Protocol is NULL or not a valid GUID
693 // EFI_INVALID_PARAMETER if ImageHandle is not a valid handle
694 // EFI_INVALID_PARAMETER if DeviceHandle is not a valid handle
695 // EFI_NOT_FOUND if (ImageHandle, DeviceHandle) is not present in the Open List
696 // for (Handle, Protocol)
697 // EFI_ACCESS_DENIED if (ImageHandle, DeviceHandle) is present in the Open List
698 // for (Handle, Protocol), but the item can not be removed.
699 // EFI_SUCCESS if (ImageHandle, DeviceHandle) is present in the Open List
700 // for (Handle, Protocol), and the item can be removed.
702 /////////////////////////////////////////////////////////////////////////////////////////////////
703 // UninstallProtocolInterface() behavior
704 /////////////////////////////////////////////////////////////////////////////////////////////////
706 // UninstallProtocolInterface (Handle, Protocol, Interface)
708 // EFI_INVALID_PARAMETER if Handle is not a valid handle.
709 // EFI_INVALID_PARAMETER if Protocol is not a vlaid GUID
710 // EFI_NOT_FOUND if Handle doe not support Protocol
711 // EFI_NOT_FOUND if the interface for (Handle, Protocol) does not match Interface
712 // EFI_ACCESS_DENIED if the list of Open Items for (Handle, Protocol) can not be removed
713 // EFI_SUCCESS if the list of Open Items is empty, and Protocol is removed from Handle
715 // Algorithm to remove Open Item List:
717 // Loop through all Open Item List entries
718 // if (OpenItem.Attributes & BY_DRIVER) then
719 // DisconnectController (OpenItem.IH, OpenItem.DH)
722 // Loop through all Open Item List entries
723 // if (OpenItem.Attributes & BY_HANDLE_PROTOCOL or GET_PROTOCOL or TEST_PROTOCOL) then
724 // CloseProtocol (Handle, Protocol, OpenItem.IH, OpenItem.DH)
727 // if Open Item List is empty then remove Protocol from Handle and return EFI_SUCCESS
728 // if Open Item List is not empty then return EFI_ACCESS_DENIED
730 /////////////////////////////////////////////////////////////////////////////////////////////////
734 (EFIAPI
*EFI_OPEN_PROTOCOL
) (
735 IN EFI_HANDLE Handle
,
736 IN EFI_GUID
* Protocol
,
737 OUT VOID
**Interface
,
738 IN EFI_HANDLE ImageHandle
,
739 IN EFI_HANDLE ControllerHandle
, OPTIONAL
746 (EFIAPI
*EFI_CLOSE_PROTOCOL
) (
747 IN EFI_HANDLE Handle
,
748 IN EFI_GUID
* Protocol
,
749 IN EFI_HANDLE ImageHandle
,
750 IN EFI_HANDLE DeviceHandle
754 EFI_HANDLE AgentHandle
;
755 EFI_HANDLE ControllerHandle
;
758 } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
;
763 (EFIAPI
*EFI_OPEN_PROTOCOL_INFORMATION
) (
764 IN EFI_HANDLE UserHandle
,
765 IN EFI_GUID
* Protocol
,
766 IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
**EntryBuffer
,
767 OUT UINTN
*EntryCount
773 (EFIAPI
*EFI_PROTOCOLS_PER_HANDLE
) (
774 IN EFI_HANDLE UserHandle
,
775 OUT EFI_GUID
***ProtocolBuffer
,
776 OUT UINTN
*ProtocolBufferCount
782 (EFIAPI
*EFI_REGISTER_PROTOCOL_NOTIFY
) (
783 IN EFI_GUID
* Protocol
,
785 OUT VOID
**Registration
792 } EFI_LOCATE_SEARCH_TYPE
;
797 (EFIAPI
*EFI_LOCATE_HANDLE
) (
798 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
799 IN EFI_GUID
* Protocol OPTIONAL
,
800 IN VOID
*SearchKey OPTIONAL
,
801 IN OUT UINTN
*BufferSize
,
802 OUT EFI_HANDLE
* Buffer
808 (EFIAPI
*EFI_LOCATE_DEVICE_PATH
) (
809 IN EFI_GUID
* Protocol
,
810 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
,
811 OUT EFI_HANDLE
* Device
817 (EFIAPI
*EFI_INSTALL_CONFIGURATION_TABLE
) (
825 (EFIAPI
*EFI_RESERVED_SERVICE
) (
832 (EFIAPI
*EFI_LOCATE_HANDLE_BUFFER
) (
833 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
834 IN EFI_GUID
* Protocol OPTIONAL
,
835 IN VOID
*SearchKey OPTIONAL
,
836 IN OUT UINTN
*NumberHandles
,
837 OUT EFI_HANDLE
**Buffer
843 (EFIAPI
*EFI_LOCATE_PROTOCOL
) (
845 VOID
*Registration
, OPTIONAL
850 // Definition of Status Code extended data header
852 // HeaderSize The size of the architecture. This is specified to enable
853 // the future expansion
855 // Size The size of the data in bytes. This does not include the size
856 // of the header structure.
858 // Type A GUID defining the type of the data
861 #if ((TIANO_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
866 (EFIAPI
*EFI_REPORT_STATUS_CODE
) (
867 IN EFI_STATUS_CODE_TYPE Type
,
868 IN EFI_STATUS_CODE_VALUE Value
,
870 IN EFI_GUID
* CallerId OPTIONAL
,
871 IN EFI_STATUS_CODE_DATA
* Data OPTIONAL
876 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
881 (EFIAPI
*EFI_UPDATE_CAPSULE
) (
882 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
883 IN UINTN CapsuleCount
,
884 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
891 (EFIAPI
*EFI_QUERY_CAPSULE_CAPABILITIES
) (
892 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
893 IN UINTN CapsuleCount
,
894 OUT UINT64
*MaxiumCapsuleSize
,
895 OUT EFI_RESET_TYPE
*ResetType
901 (EFIAPI
*EFI_QUERY_VARIABLE_INFO
) (
902 IN UINT32 Attributes
,
903 OUT UINT64
*MaximumVariableStorageSize
,
904 OUT UINT64
*RemainingVariableStorageSize
,
905 OUT UINT64
*MaximumVariableSize
911 // EFI Runtime Services Table
913 #define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL
914 #define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION
917 EFI_TABLE_HEADER Hdr
;
922 EFI_GET_TIME GetTime
;
923 EFI_SET_TIME SetTime
;
924 EFI_GET_WAKEUP_TIME GetWakeupTime
;
925 EFI_SET_WAKEUP_TIME SetWakeupTime
;
928 // Virtual memory services
930 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap
;
931 EFI_CONVERT_POINTER ConvertPointer
;
936 EFI_GET_VARIABLE GetVariable
;
937 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName
;
938 EFI_SET_VARIABLE SetVariable
;
943 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount
;
944 EFI_RESET_SYSTEM ResetSystem
;
946 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
948 // New Boot Service added by UEFI 2.0
950 EFI_UPDATE_CAPSULE UpdateCapsule
;
951 EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities
;
952 EFI_QUERY_VARIABLE_INFO QueryVariableInfo
;
953 #elif (TIANO_RELEASE_VERSION != 0)
955 // Tiano extension to EFI 1.10 runtime table
956 // It was moved to a protocol to not conflict with UEFI 2.0
957 // If Tiano is disabled, this item is not enabled for EFI1.10
959 EFI_REPORT_STATUS_CODE ReportStatusCode
;
962 } EFI_RUNTIME_SERVICES
;
965 // EFI Boot Services Table
967 #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL
968 #define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION
971 EFI_TABLE_HEADER Hdr
;
974 // Task priority functions
976 EFI_RAISE_TPL RaiseTPL
;
977 EFI_RESTORE_TPL RestoreTPL
;
982 EFI_ALLOCATE_PAGES AllocatePages
;
983 EFI_FREE_PAGES FreePages
;
984 EFI_GET_MEMORY_MAP GetMemoryMap
;
985 EFI_ALLOCATE_POOL AllocatePool
;
986 EFI_FREE_POOL FreePool
;
989 // Event & timer functions
991 EFI_CREATE_EVENT CreateEvent
;
992 EFI_SET_TIMER SetTimer
;
993 EFI_WAIT_FOR_EVENT WaitForEvent
;
994 EFI_SIGNAL_EVENT SignalEvent
;
995 EFI_CLOSE_EVENT CloseEvent
;
996 EFI_CHECK_EVENT CheckEvent
;
999 // Protocol handler functions
1001 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
;
1002 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
;
1003 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
;
1004 EFI_HANDLE_PROTOCOL HandleProtocol
;
1006 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
;
1007 EFI_LOCATE_HANDLE LocateHandle
;
1008 EFI_LOCATE_DEVICE_PATH LocateDevicePath
;
1009 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
;
1014 EFI_IMAGE_LOAD LoadImage
;
1015 EFI_IMAGE_START StartImage
;
1017 EFI_IMAGE_UNLOAD UnloadImage
;
1018 EFI_EXIT_BOOT_SERVICES ExitBootServices
;
1023 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
;
1025 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
;
1028 // ////////////////////////////////////////////////////
1030 //////////////////////////////////////////////////////
1032 // DriverSupport Services
1034 EFI_CONNECT_CONTROLLER ConnectController
;
1035 EFI_DISCONNECT_CONTROLLER DisconnectController
;
1038 // Added Open and Close protocol for the new driver model
1040 EFI_OPEN_PROTOCOL OpenProtocol
;
1041 EFI_CLOSE_PROTOCOL CloseProtocol
;
1042 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
;
1045 // Added new services to EFI 1.1 as Lib to reduce code size.
1047 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
;
1048 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
;
1049 EFI_LOCATE_PROTOCOL LocateProtocol
;
1051 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
;
1052 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
;
1057 EFI_CALCULATE_CRC32 CalculateCrc32
;
1060 // Memory Utility Services
1062 EFI_COPY_MEM CopyMem
;
1064 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
1066 // UEFI 2.0 Extension to the table
1068 EFI_CREATE_EVENT_EX CreateEventEx
;
1071 } EFI_BOOT_SERVICES
;
1074 // EFI Configuration Table
1077 EFI_GUID VendorGuid
;
1079 } EFI_CONFIGURATION_TABLE
;
1084 #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL
1085 #define EFI_SYSTEM_TABLE_REVISION EFI_SPECIFICATION_VERSION
1086 #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | 02)
1087 #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | 10)
1088 #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | 00)
1089 #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | 10)
1091 struct _EFI_SYSTEM_TABLE
{
1092 EFI_TABLE_HEADER Hdr
;
1094 CHAR16
*FirmwareVendor
;
1095 UINT32 FirmwareRevision
;
1097 EFI_HANDLE ConsoleInHandle
;
1098 EFI_SIMPLE_TEXT_IN_PROTOCOL
*ConIn
;
1100 EFI_HANDLE ConsoleOutHandle
;
1101 EFI_SIMPLE_TEXT_OUT_PROTOCOL
*ConOut
;
1103 EFI_HANDLE StandardErrorHandle
;
1104 EFI_SIMPLE_TEXT_OUT_PROTOCOL
*StdErr
;
1106 EFI_RUNTIME_SERVICES
*RuntimeServices
;
1107 EFI_BOOT_SERVICES
*BootServices
;
1109 UINTN NumberOfTableEntries
;
1110 EFI_CONFIGURATION_TABLE
*ConfigurationTable
;