Boot services are services provided by the system’s firmware until the operating system takes over control over the hardware by calling exitBootServices.

Boot Services must not be used after exitBootServices has been called. The only exception is getMemoryMap, which may be used after the first unsuccessful call to exitBootServices. After successfully calling exitBootServices, system_table.console_in_handle, system_table.con_in, system_table.console_out_handle, system_table.con_out, system_table.standard_error_handle, system_table.std_err, and system_table.boot_services should be set to null. After setting these attributes to null, system_table.hdr.crc32 must be recomputed.

As the boot_services table may grow with new UEFI versions, it is important to check hdr.header_size.

Fields

raiseTpl: *const fn (usize) callconv(cc) usize,

Raises a task’s priority level and returns its previous level.

restoreTpl: *const fn (usize) callconv(cc) void,

Restores a task’s priority level to its previous value.

allocatePages: *const fn (AllocateType, MemoryType, usize, *[*]align(4096) u8) callconv(cc) Status,

Allocates memory pages from the system.

freePages: *const fn ([*]align(4096) u8, usize) callconv(cc) Status,

Frees memory pages.

getMemoryMap: *const fn (*usize, ?[*]MemoryDescriptor, *usize, *usize, *u32) callconv(cc) Status,

Returns the current memory map.

allocatePool: *const fn (MemoryType, usize, *[*]align(8) u8) callconv(cc) Status,

Allocates pool memory.

freePool: *const fn ([*]align(8) u8) callconv(cc) Status,

Returns pool memory to the system.

createEvent: *const fn (u32, usize, ?*const fn (Event, ?*anyopaque) callconv(cc) void, ?*const anyopaque, *Event) callconv(cc) Status,

Creates an event.

setTimer: *const fn (Event, TimerDelay, u64) callconv(cc) Status,

Sets the type of timer and the trigger time for a timer event.

waitForEvent: *const fn (usize, [*]const Event, *usize) callconv(cc) Status,

Stops execution until an event is signaled.

signalEvent: *const fn (Event) callconv(cc) Status,

Signals an event.

closeEvent: *const fn (Event) callconv(cc) Status,

Closes an event.

checkEvent: *const fn (Event) callconv(cc) Status,

Checks whether an event is in the signaled state.

installProtocolInterface: *const fn (Handle, *const align(8) Guid, EfiInterfaceType, *anyopaque) callconv(cc) Status,

Installs a protocol interface on a device handle. If the handle does not exist, it is created and added to the list of handles in the system. installMultipleProtocolInterfaces() performs more error checking than installProtocolInterface(), so its use is recommended over this.

reinstallProtocolInterface: *const fn (Handle, *const align(8) Guid, *anyopaque, *anyopaque) callconv(cc) Status,

Reinstalls a protocol interface on a device handle

uninstallProtocolInterface: *const fn (Handle, *const align(8) Guid, *anyopaque) callconv(cc) Status,

Removes a protocol interface from a device handle. Usage of uninstallMultipleProtocolInterfaces is recommended over this.

handleProtocol: *const fn (Handle, *const align(8) Guid, *?*anyopaque) callconv(cc) Status,

Queries a handle to determine if it supports a specified protocol.

reserved: *anyopaque,
registerProtocolNotify: *const fn (*const align(8) Guid, Event, **anyopaque) callconv(cc) Status,

Creates an event that is to be signaled whenever an interface is installed for a specified protocol.

locateHandle: *const fn (LocateSearchType, ?*const align(8) Guid, ?*const anyopaque, *usize, [*]Handle) callconv(cc) Status,

Returns an array of handles that support a specified protocol.

locateDevicePath: *const fn (*const align(8) Guid, **const DevicePathProtocol, *?Handle) callconv(cc) Status,

Locates the handle to a device on the device path that supports the specified protocol

installConfigurationTable: *const fn (*const align(8) Guid, ?*anyopaque) callconv(cc) Status,

Adds, updates, or removes a configuration table entry from the EFI System Table.

loadImage: *const fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(cc) Status,

Loads an EFI image into memory.

startImage: *const fn (Handle, ?*usize, ?*[*]u16) callconv(cc) Status,

Transfers control to a loaded image’s entry point.

exit: *const fn (Handle, Status, usize, ?*const anyopaque) callconv(cc) Status,

Terminates a loaded EFI image and returns control to boot services.

unloadImage: *const fn (Handle) callconv(cc) Status,

Unloads an image.

exitBootServices: *const fn (Handle, usize) callconv(cc) Status,

Terminates all boot services.

getNextMonotonicCount: *const fn (*u64) callconv(cc) Status,

Returns a monotonically increasing count for the platform.

stall: *const fn (usize) callconv(cc) Status,

Induces a fine-grained stall.

setWatchdogTimer: *const fn (usize, u64, usize, ?[*]const u16) callconv(cc) Status,

Sets the system’s watchdog timer.

connectController: *const fn (Handle, ?Handle, ?*DevicePathProtocol, bool) callconv(cc) Status,

Connects one or more drives to a controller.

disconnectController: *const fn (Handle, ?Handle, ?Handle) callconv(cc) Status,
openProtocol: *const fn (Handle, *const align(8) Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(cc) Status,

Queries a handle to determine if it supports a specified protocol.

closeProtocol: *const fn (Handle, *const align(8) Guid, Handle, ?Handle) callconv(cc) Status,

Closes a protocol on a handle that was opened using openProtocol().

openProtocolInformation: *const fn (Handle, *const align(8) Guid, *[*]ProtocolInformationEntry, *usize) callconv(cc) Status,

Retrieves the list of agents that currently have a protocol interface opened.

protocolsPerHandle: *const fn (Handle, *[*]*const align(8) Guid, *usize) callconv(cc) Status,

Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.

locateHandleBuffer: *const fn (LocateSearchType, ?*const align(8) Guid, ?*const anyopaque, *usize, *[*]Handle) callconv(cc) Status,

Returns an array of handles that support the requested protocol in a buffer allocated from pool.

locateProtocol: *const fn (*const align(8) Guid, ?*const anyopaque, *?*anyopaque) callconv(cc) Status,

Returns the first protocol instance that matches the given protocol.

installMultipleProtocolInterfaces: *const fn (*Handle) callconv(.C) Status,

Installs one or more protocol interfaces into the boot services environment

uninstallMultipleProtocolInterfaces: *const fn (*Handle) callconv(.C) Status,

Removes one or more protocol interfaces into the boot services environment

calculateCrc32: *const fn ([*]const u8, usize, *u32) callconv(cc) Status,

Computes and returns a 32-bit CRC for a data buffer.

copyMem: *const fn ([*]u8, [*]const u8, usize) callconv(cc) void,

Copies the contents of one buffer to another buffer

setMem: *const fn ([*]u8, usize, u8) callconv(cc) void,

Fills a buffer with a specified value

createEventEx: *const fn (u32, usize, EfiEventNotify, *const anyopaque, *const align(8) Guid, *Event) callconv(cc) Status,

Creates an event in a group.

Functions

fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol

Opens a protocol with a structure as the loaded image for a UEFI application