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 {...@@ -59,23 +59,34 @@ pub const BootServices = extern struct {
59 /// Checks whether an event is in the signaled state.59 /// Checks whether an event is in the signaled state.
60 checkEvent: fn (Event) callconv(.C) Status,60 checkEvent: fn (Event) callconv(.C) Status,
6161
62 installProtocolInterface: Status, // TODO62 /// Installs a protocol interface on a device handle. If the handle does not exist, it is created
63 reinstallProtocolInterface: Status, // TODO63 /// and added to the list of handles in the system. installMultipleProtocolInterfaces()
64 uninstallProtocolInterface: Status, // TODO64 /// 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
66 /// Queries a handle to determine if it supports a specified protocol.74 /// Queries a handle to determine if it supports a specified protocol.
67 handleProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque) callconv(.C) Status,75 handleProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque) callconv(.C) Status,
6876
69 reserved: *anyopaque,77 reserved: *anyopaque,
7078
71 registerProtocolNotify: Status, // TODO79 /// 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
73 /// Returns an array of handles that support a specified protocol.82 /// Returns an array of handles that support a specified protocol.
74 locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, [*]Handle) callconv(.C) Status,83 locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, [*]Handle) callconv(.C) Status,
7584
76 /// Locates the handle to a device on the device path that supports the specified protocol85 /// Locates the handle to a device on the device path that supports the specified protocol
77 locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status,86 locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status,
78 installConfigurationTable: Status, // TODO87
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
80 /// Loads an EFI image into memory.91 /// Loads an EFI image into memory.
81 loadImage: fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(.C) Status,92 loadImage: fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(.C) Status,
...@@ -101,8 +112,11 @@ pub const BootServices = extern struct {...@@ -101,8 +112,11 @@ pub const BootServices = extern struct {
101 /// Sets the system's watchdog timer.112 /// Sets the system's watchdog timer.
102 setWatchdogTimer: fn (usize, u64, usize, ?[*]const u16) callconv(.C) Status,113 setWatchdogTimer: fn (usize, u64, usize, ?[*]const u16) callconv(.C) Status,
103114
104 connectController: Status, // TODO115 /// Connects one or more drives to a controller.
105 disconnectController: Status, // TODO116 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
107 /// Queries a handle to determine if it supports a specified protocol.121 /// Queries a handle to determine if it supports a specified protocol.
108 openProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status,122 openProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status,
...@@ -122,8 +136,11 @@ pub const BootServices = extern struct {...@@ -122,8 +136,11 @@ pub const BootServices = extern struct {
122 /// Returns the first protocol instance that matches the given protocol.136 /// Returns the first protocol instance that matches the given protocol.
123 locateProtocol: fn (*align(8) const Guid, ?*const anyopaque, *?*anyopaque) callconv(.C) Status,137 locateProtocol: fn (*align(8) const Guid, ?*const anyopaque, *?*anyopaque) callconv(.C) Status,
124138
125 installMultipleProtocolInterfaces: Status, // TODO139 /// Installs one or more protocol interfaces into the boot services environment
126 uninstallMultipleProtocolInterfaces: Status, // TODO140 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
128 /// Computes and returns a 32-bit CRC for a data buffer.145 /// Computes and returns a 32-bit CRC for a data buffer.
129 calculateCrc32: fn ([*]const u8, usize, *u32) callconv(.C) Status,146 calculateCrc32: fn ([*]const u8, usize, *u32) callconv(.C) Status,
...@@ -134,7 +151,8 @@ pub const BootServices = extern struct {...@@ -134,7 +151,8 @@ pub const BootServices = extern struct {
134 /// Fills a buffer with a specified value151 /// Fills a buffer with a specified value
135 setMem: fn ([*]u8, usize, u8) callconv(.C) void,152 setMem: fn ([*]u8, usize, u8) callconv(.C) void,
136153
137 createEventEx: Status, // TODO154 /// Creates an event in a group.
155 createEventEx: fn (u32, usize, EfiEventNotify, *const anyopaque, *align(8) const Guid, *Event) callconv(.C) Status,
138156
139 pub const signature: u64 = 0x56524553544f4f42;157 pub const signature: u64 = 0x56524553544f4f42;
140158
...@@ -151,6 +169,8 @@ pub const BootServices = extern struct {...@@ -151,6 +169,8 @@ pub const BootServices = extern struct {
151 pub const tpl_high_level: usize = 31;169 pub const tpl_high_level: usize = 31;
152};170};
153171
172pub const EfiEventNotify = fn (event: Event, ctx: *anyopaque) callconv(.C) void;
173
154pub const TimerDelay = enum(u32) {174pub const TimerDelay = enum(u32) {
155 TimerCancel,175 TimerCancel,
156 TimerPeriodic,176 TimerPeriodic,
...@@ -231,6 +251,10 @@ pub const ProtocolInformationEntry = extern struct {...@@ -231,6 +251,10 @@ pub const ProtocolInformationEntry = extern struct {
231 open_count: u32,251 open_count: u32,
232};252};
233253
254pub const EfiInterfaceType = enum(u32) {
255 EfiNativeInterface,
256};
257
234pub const AllocateType = enum(u32) {258pub const AllocateType = enum(u32) {
235 AllocateAnyPages,259 AllocateAnyPages,
236 AllocateMaxAddress,260 AllocateMaxAddress,