authorgravatar for ybham6@gmail.comfifty-six <ybham6@gmail.com> 2022-01-13 05:54:24-05:00
committergravatar for ybham6@gmail.comfifty-six <ybham6@gmail.com> 2022-01-13 15:47:14-05:00
logfe28cb8261eeb7e3094d38f2c5fb2012fbf205d6
tree930862ccb4c7c34c8713f7d3c5a90b512f96b3b4
parent649b872450689511ac3c5526d063c89fff7d898a

std/os/uefi: Fill out remaining function signatures and docs on boot_services


1 files changed, 34 insertions(+), 10 deletions(-)

lib/std/os/uefi/tables/boot_services.zig+34-10
......@@ -59,23 +59,34 @@ pub const BootServices = extern struct {
5959 /// Checks whether an event is in the signaled state.
6060 checkEvent: fn (Event) callconv(.C) Status,
6161
62 installProtocolInterface: Status, // TODO
63 reinstallProtocolInterface: Status, // TODO
64 uninstallProtocolInterface: Status, // TODO
62 /// Installs a protocol interface on a device handle. If the handle does not exist, it is created
63 /// and added to the list of handles in the system. installMultipleProtocolInterfaces()
64 /// performs more error checking than installProtocolInterface(), so its use is recommended over this.
65 installProtocolInterface: fn (Handle, *align(8) const Guid, EfiInterfaceType, *anyopaque) callconv(.C) Status,
66
67 /// Reinstalls a protocol interface on a device handle
68 reinstallProtocolInterface: fn (Handle, *align(8) const Guid, *anyopaque, *anyopaque) callconv(.C) Status,
69
70 /// Removes a protocol interface from a device handle. Usage of
71 /// uninstallMultipleProtocolInterfaces is recommended over this.
72 uninstallProtocolInterface: fn (Handle, *align(8) const Guid, *anyopaque) callconv(.C) Status,
6573
6674 /// Queries a handle to determine if it supports a specified protocol.
6775 handleProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque) callconv(.C) Status,
6876
6977 reserved: *anyopaque,
7078
71 registerProtocolNotify: Status, // TODO
79 /// Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
80 registerProtocolNotify: fn (*align(8) const Guid, Event, **anyopaque) callconv(.C) Status,
7281
7382 /// Returns an array of handles that support a specified protocol.
7483 locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, [*]Handle) callconv(.C) Status,
7584
7685 /// Locates the handle to a device on the device path that supports the specified protocol
7786 locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status,
78 installConfigurationTable: Status, // TODO
87
88 /// Adds, updates, or removes a configuration table entry from the EFI System Table.
89 installConfigurationTable: fn (*align(8) const Guid, ?*anyopaque) callconv(.C) Status,
7990
8091 /// Loads an EFI image into memory.
8192 loadImage: fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(.C) Status,
......@@ -101,8 +112,11 @@ pub const BootServices = extern struct {
101112 /// Sets the system's watchdog timer.
102113 setWatchdogTimer: fn (usize, u64, usize, ?[*]const u16) callconv(.C) Status,
103114
104 connectController: Status, // TODO
105 disconnectController: Status, // TODO
115 /// Connects one or more drives to a controller.
116 connectController: fn (Handle, ?Handle, ?*DevicePathProtocol, bool) callconv(.C) Status,
117
118 // Disconnects one or more drivers from a controller
119 disconnectController: fn (Handle, ?Handle, ?Handle) callconv(.C) Status,
106120
107121 /// Queries a handle to determine if it supports a specified protocol.
108122 openProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status,
......@@ -122,8 +136,11 @@ pub const BootServices = extern struct {
122136 /// Returns the first protocol instance that matches the given protocol.
123137 locateProtocol: fn (*align(8) const Guid, ?*const anyopaque, *?*anyopaque) callconv(.C) Status,
124138
125 installMultipleProtocolInterfaces: Status, // TODO
126 uninstallMultipleProtocolInterfaces: Status, // TODO
139 /// Installs one or more protocol interfaces into the boot services environment
140 installMultipleProtocolInterfaces: fn (*Handle, ...) callconv(.C) Status,
141
142 /// Removes one or more protocol interfaces into the boot services environment
143 uninstallMultipleProtocolInterfaces: fn (*Handle, ...) callconv(.C) Status,
127144
128145 /// Computes and returns a 32-bit CRC for a data buffer.
129146 calculateCrc32: fn ([*]const u8, usize, *u32) callconv(.C) Status,
......@@ -134,7 +151,8 @@ pub const BootServices = extern struct {
134151 /// Fills a buffer with a specified value
135152 setMem: fn ([*]u8, usize, u8) callconv(.C) void,
136153
137 createEventEx: Status, // TODO
154 /// Creates an event in a group.
155 createEventEx: fn (u32, usize, EfiEventNotify, *const anyopaque, *align(8) const Guid, *Event) callconv(.C) Status,
138156
139157 pub const signature: u64 = 0x56524553544f4f42;
140158
......@@ -151,6 +169,8 @@ pub const BootServices = extern struct {
151169 pub const tpl_high_level: usize = 31;
152170};
153171
172pub const EfiEventNotify = fn (event: Event, ctx: *anyopaque) callconv(.C) void;
173
154174pub const TimerDelay = enum(u32) {
155175 TimerCancel,
156176 TimerPeriodic,
......@@ -231,6 +251,10 @@ pub const ProtocolInformationEntry = extern struct {
231251 open_count: u32,
232252};
233253
254pub const EfiInterfaceType = enum(u32) {
255 EfiNativeInterface,
256};
257
234258pub const AllocateType = enum(u32) {
235259 AllocateAnyPages,
236260 AllocateMaxAddress,