5 UEFI Services
This chapter focuses on the UEFI services that apply to the implementation of UEFI drivers. This includes descriptions of those services, along with code examples, that demonstrate how a UEFI driver typically uses those services. The EDK II provides a number of library functions that simplify the use of UEFI services as well as UEFI driver improvements in maintainability, portability, readability, robustness, and size. Additional descriptions and code examples using EDK II library functions also appear where applicable.
The UEFI Boot Services and UEFI Runtime Services available to UEFI Drivers fall into three general areas:
  • Commonly used services
  • Rarely used services
  • Services that should not be used from a UEFI driver
The full function prototypes and descriptions for each service, and their arguments, are available in the Boot Services and Runtime Services chapters of the UEFI Specification. The full function prototypes and descriptions of the EDK II library functions, and their arguments, are available in the EDK II MdePkg Package Document and the EDK II MdeModulePkg Package Document.
The following table lists alphabetically all UEFI Boot and Runtime Services.

Table 17-Alphabetical listing of UEFI services

Service
Type
Service Type
AllocatePool()
Boot
Memory Allocation
AllocatePages()
Boot
Memory Allocation
CalculateCrc32()
Boot
Miscellaneous
CheckEvent()
Boot
Event
CloseEvent()
Boot
Event
CloseProtocol()
Boot
Protocol Handler
ConnectController()
Boot
Protocol Handler
ConvertPointer()
Runtime
Miscellaneous
CopyMem()
Boot
Miscellaneous
CreateEvent()
Boot
Event
CreateEventEx()
Boot
Event
DisconnectController()
Boot
Protocol Handler
Exit()
Boot
Special
ExitBootServices()
Boot
Special
FreePages()
Boot
Memory Allocation
FreePool()
Boot
Memory Allocation
GetMemoryMap()
Boot
Memory Allocation
GetNextMonotonicCount()
Boot
Special
GetNextHighMonotonicCount()
Runtime
Special