authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 18:14:32-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2019-10-16 18:14:32-04:00
log45e5841281e0adf7924f0931dff219bf38f74622
treea832edd59787dd3548681dcc0975775ef5275384
parent09abd09ab85189b15c3296407a5a8a803e93ebd0
parente6eae25053581032f7b26cb86fa6c8c84465e1c8
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #3464 from nrdmn/uefi

UEFI improvements

19 files changed, 164 insertions(+), 30 deletions(-)

lib/std/os/uefi.zig+46-1
...@@ -1,15 +1,23 @@...@@ -1,15 +1,23 @@
1/// A protocol is an interface identified by a GUID.
1pub const protocols = @import("uefi/protocols.zig");2pub const protocols = @import("uefi/protocols.zig");
3/// Status codes returned by EFI interfaces
2pub const status = @import("uefi/status.zig");4pub const status = @import("uefi/status.zig");
3pub const tables = @import("uefi/tables.zig");5pub const tables = @import("uefi/tables.zig");
46
7const fmt = @import("std").fmt;
8
5const builtin = @import("builtin");9const builtin = @import("builtin");
6pub const is_the_target = builtin.os == .uefi;10pub const is_the_target = builtin.os == .uefi;
711
12/// The EFI image's handle that is passed to its entry point.
8pub var handle: Handle = undefined;13pub var handle: Handle = undefined;
14/// A pointer to the EFI System Table that is passed to the EFI image's entry point.
9pub var system_table: *tables.SystemTable = undefined;15pub var system_table: *tables.SystemTable = undefined;
1016
17/// A handle to an event structure.
11pub const Event = *@OpaqueType();18pub const Event = *@OpaqueType();
12// GUIDs must be align(8)19
20/// GUIDs must be align(8)
13pub const Guid = extern struct {21pub const Guid = extern struct {
14 time_low: u32,22 time_low: u32,
15 time_mid: u16,23 time_mid: u16,
...@@ -17,29 +25,66 @@ pub const Guid = extern struct {...@@ -17,29 +25,66 @@ pub const Guid = extern struct {
17 clock_seq_high_and_reserved: u8,25 clock_seq_high_and_reserved: u8,
18 clock_seq_low: u8,26 clock_seq_low: u8,
19 node: [6]u8,27 node: [6]u8,
28
29 /// Format GUID into hexadecimal lowercase xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format
30 pub fn format(
31 self: @This(),
32 comptime f: []const u8,
33 options: fmt.FormatOptions,
34 context: var,
35 comptime Errors: type,
36 output: fn (@typeOf(context), []const u8) Errors!void,
37 ) Errors!void {
38 if (f.len == 0) {
39 return fmt.format(context, Errors, output, "{x:0>8}-{x:0>4}-{x:0>4}-{x:0>2}{x:0>2}-{x:0>12}", self.time_low, self.time_mid, self.time_high_and_version, self.clock_seq_high_and_reserved, self.clock_seq_low, self.node);
40 } else {
41 @compileError("Unknown format character: '" ++ f ++ "'");
42 }
43 }
20};44};
45
46/// An EFI Handle represents a collection of related interfaces.
21pub const Handle = *@OpaqueType();47pub const Handle = *@OpaqueType();
48
49/// This structure represents time information.
22pub const Time = extern struct {50pub const Time = extern struct {
51 /// 1900 - 9999
23 year: u16,52 year: u16,
53 /// 1 - 12
24 month: u8,54 month: u8,
55 /// 1 - 31
25 day: u8,56 day: u8,
57 /// 0 - 23
26 hour: u8,58 hour: u8,
59 /// 0 - 59
27 minute: u8,60 minute: u8,
61 /// 0 - 59
28 second: u8,62 second: u8,
29 _pad1: u8,63 _pad1: u8,
64 /// 0 - 999999999
30 nanosecond: u32,65 nanosecond: u32,
66 /// The time's offset in minutes from UTC.
67 /// Allowed values are -1440 to 1440 or unspecified_timezone
31 timezone: i16,68 timezone: i16,
32 daylight: packed struct {69 daylight: packed struct {
33 _pad1: u6,70 _pad1: u6,
71 /// If true, the time has been adjusted for daylight savings time.
34 in_daylight: bool,72 in_daylight: bool,
73 /// If true, the time is affected by daylight savings time.
35 adjust_daylight: bool,74 adjust_daylight: bool,
36 },75 },
37 _pad2: u8,76 _pad2: u8,
3877
78 /// Time is to be interpreted as local time
39 pub const unspecified_timezone: i16 = 0x7ff;79 pub const unspecified_timezone: i16 = 0x7ff;
40};80};
81
82/// Capabilities of the clock device
41pub const TimeCapabilities = extern struct {83pub const TimeCapabilities = extern struct {
84 /// Resolution in Hz
42 resolution: u32,85 resolution: u32,
86 /// Accuracy in an error rate of 1e-6 parts per million.
43 accuracy: u32,87 accuracy: u32,
88 /// If true, a time set operation clears the device's time below the resolution level.
44 sets_to_zero: bool,89 sets_to_zero: bool,
45};90};
lib/std/os/uefi/protocols/absolute_pointer_protocol.zig+7-5
...@@ -2,17 +2,19 @@ const uefi = @import("std").os.uefi;...@@ -2,17 +2,19 @@ const uefi = @import("std").os.uefi;
2const Event = uefi.Event;2const Event = uefi.Event;
3const Guid = uefi.Guid;3const Guid = uefi.Guid;
44
5/// UEFI Specification, Version 2.8, 12.75/// Protocol for touchscreens
6pub const AbsolutePointerProtocol = extern struct {6pub const AbsolutePointerProtocol = extern struct {
7 _reset: extern fn (*const AbsolutePointerProtocol, bool) usize,7 _reset: extern fn (*const AbsolutePointerProtocol, bool) usize,
8 _get_state: extern fn (*const AbsolutePointerProtocol, *AbsolutePointerState) usize,8 _get_state: extern fn (*const AbsolutePointerProtocol, *AbsolutePointerState) usize,
9 wait_for_input: Event,9 wait_for_input: Event,
10 mode: *AbsolutePointerMode,10 mode: *AbsolutePointerMode,
1111
12 /// Resets the pointer device hardware.
12 pub fn reset(self: *const AbsolutePointerProtocol, verify: bool) usize {13 pub fn reset(self: *const AbsolutePointerProtocol, verify: bool) usize {
13 return self._reset(self, verify);14 return self._reset(self, verify);
14 }15 }
1516
17 /// Retrieves the current state of a pointer device.
16 pub fn getState(self: *const AbsolutePointerProtocol, state: *AbsolutePointerState) usize {18 pub fn getState(self: *const AbsolutePointerProtocol, state: *AbsolutePointerState) usize {
17 return self._get_state(self, state);19 return self._get_state(self, state);
18 }20 }
...@@ -42,12 +44,12 @@ pub const AbsolutePointerMode = extern struct {...@@ -42,12 +44,12 @@ pub const AbsolutePointerMode = extern struct {
42};44};
4345
44pub const AbsolutePointerState = extern struct {46pub const AbsolutePointerState = extern struct {
45 current_x: u64 = undefined,47 current_x: u64,
46 current_y: u64 = undefined,48 current_y: u64,
47 current_z: u64 = undefined,49 current_z: u64,
48 active_buttons: packed struct {50 active_buttons: packed struct {
49 touch_active: bool,51 touch_active: bool,
50 alt_active: bool,52 alt_active: bool,
51 _pad1: u30,53 _pad1: u30,
52 } = undefined,54 },
53};55};
lib/std/os/uefi/protocols/edid_active_protocol.zig+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 12.94/// EDID information for an active video output device
5pub const EdidActiveProtocol = extern struct {5pub const EdidActiveProtocol = extern struct {
6 size_of_edid: u32,6 size_of_edid: u32,
7 edid: ?[*]u8,7 edid: ?[*]u8,
lib/std/os/uefi/protocols/edid_discovered_protocol.zig+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 12.94/// EDID information for a video output device
5pub const EdidDiscoveredProtocol = extern struct {5pub const EdidDiscoveredProtocol = extern struct {
6 size_of_edid: u32,6 size_of_edid: u32,
7 edid: ?[*]u8,7 edid: ?[*]u8,
lib/std/os/uefi/protocols/edid_override_protocol.zig+2-1
...@@ -2,10 +2,11 @@ const uefi = @import("std").os.uefi;...@@ -2,10 +2,11 @@ const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
3const Handle = uefi.Handle;3const Handle = uefi.Handle;
44
5/// UEFI Specification, Version 2.8, 12.95/// Override EDID information
6pub const EdidOverrideProtocol = extern struct {6pub const EdidOverrideProtocol = extern struct {
7 _get_edid: extern fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) usize,7 _get_edid: extern fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) usize,
88
9 /// Returns policy information and potentially a replacement EDID for the specified video output device.
9 /// attributes must be align(4)10 /// attributes must be align(4)
10 pub fn getEdid(self: *const EdidOverrideProtocol, handle: Handle, attributes: *EdidOverrideProtocolAttributes, edid_size: *usize, edid: *?[*]u8) usize {11 pub fn getEdid(self: *const EdidOverrideProtocol, handle: Handle, attributes: *EdidOverrideProtocolAttributes, edid_size: *usize, edid: *?[*]u8) usize {
11 return self._get_edid(self, handle, attributes, edid_size, edid);12 return self._get_edid(self, handle, attributes, edid_size, edid);
lib/std/os/uefi/protocols/graphics_output_protocol.zig+4-1
...@@ -1,21 +1,24 @@...@@ -1,21 +1,24 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 12.94/// Graphics output
5pub const GraphicsOutputProtocol = extern struct {5pub const GraphicsOutputProtocol = extern struct {
6 _query_mode: extern fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) usize,6 _query_mode: extern fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) usize,
7 _set_mode: extern fn (*const GraphicsOutputProtocol, u32) usize,7 _set_mode: extern fn (*const GraphicsOutputProtocol, u32) usize,
8 _blt: extern fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) usize,8 _blt: extern fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) usize,
9 mode: *GraphicsOutputProtocolMode,9 mode: *GraphicsOutputProtocolMode,
1010
11 /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports.
11 pub fn queryMode(self: *const GraphicsOutputProtocol, mode: u32, size_of_info: *usize, info: **GraphicsOutputModeInformation) usize {12 pub fn queryMode(self: *const GraphicsOutputProtocol, mode: u32, size_of_info: *usize, info: **GraphicsOutputModeInformation) usize {
12 return self._query_mode(self, mode, size_of_info, info);13 return self._query_mode(self, mode, size_of_info, info);
13 }14 }
1415
16 /// Set the video device into the specified mode and clears the visible portions of the output display to black.
15 pub fn setMode(self: *const GraphicsOutputProtocol, mode: u32) usize {17 pub fn setMode(self: *const GraphicsOutputProtocol, mode: u32) usize {
16 return self._set_mode(self, mode);18 return self._set_mode(self, mode);
17 }19 }
1820
21 /// Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
19 pub fn blt(self: *const GraphicsOutputProtocol, blt_buffer: ?[*]GraphicsOutputBltPixel, blt_operation: GraphicsOutputBltOperation, source_x: usize, source_y: usize, destination_x: usize, destination_y: usize, width: usize, height: usize, delta: usize) usize {22 pub fn blt(self: *const GraphicsOutputProtocol, blt_buffer: ?[*]GraphicsOutputBltPixel, blt_operation: GraphicsOutputBltOperation, source_x: usize, source_y: usize, destination_x: usize, destination_y: usize, width: usize, height: usize, delta: usize) usize {
20 return self._blt(self, blt_buffer, blt_operation, source_x, source_y, destination_x, destination_y, width, height, delta);23 return self._blt(self, blt_buffer, blt_operation, source_x, source_y, destination_x, destination_y, width, height, delta);
21 }24 }
lib/std/os/uefi/protocols/hii.zig+3
...@@ -3,6 +3,7 @@ const Guid = uefi.Guid;...@@ -3,6 +3,7 @@ const Guid = uefi.Guid;
33
4pub const HIIHandle = *@OpaqueType();4pub const HIIHandle = *@OpaqueType();
55
6/// The header found at the start of each package.
6pub const HIIPackageHeader = packed struct {7pub const HIIPackageHeader = packed struct {
7 length: u24,8 length: u24,
8 type: u8,9 type: u8,
...@@ -22,8 +23,10 @@ pub const HIIPackageHeader = packed struct {...@@ -22,8 +23,10 @@ pub const HIIPackageHeader = packed struct {
22 pub const type_system_end: u8 = 0xff;23 pub const type_system_end: u8 = 0xff;
23};24};
2425
26/// The header found at the start of each package list.
25pub const HIIPackageList = extern struct {27pub const HIIPackageList = extern struct {
26 package_list_guid: Guid,28 package_list_guid: Guid,
29 /// The size of the package list (in bytes), including the header.
27 package_list_length: u32,30 package_list_length: u32,
2831
29 // TODO implement iterator32 // TODO implement iterator
lib/std/os/uefi/protocols/hii_database_protocol.zig+5
...@@ -2,6 +2,7 @@ const uefi = @import("std").os.uefi;...@@ -2,6 +2,7 @@ const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
3const hii = uefi.protocols.hii;3const hii = uefi.protocols.hii;
44
5/// Database manager for HII-related data structures.
5pub const HIIDatabaseProtocol = extern struct {6pub const HIIDatabaseProtocol = extern struct {
6 _new_package_list: usize, // TODO7 _new_package_list: usize, // TODO
7 _remove_package_list: extern fn (*const HIIDatabaseProtocol, hii.HIIHandle) usize,8 _remove_package_list: extern fn (*const HIIDatabaseProtocol, hii.HIIHandle) usize,
...@@ -15,18 +16,22 @@ pub const HIIDatabaseProtocol = extern struct {...@@ -15,18 +16,22 @@ pub const HIIDatabaseProtocol = extern struct {
15 _set_keyboard_layout: usize, // TODO16 _set_keyboard_layout: usize, // TODO
16 _get_package_list_handle: usize, // TODO17 _get_package_list_handle: usize, // TODO
1718
19 /// Removes a package list from the HII database.
18 pub fn removePackageList(self: *const HIIDatabaseProtocol, handle: hii.HIIHandle) usize {20 pub fn removePackageList(self: *const HIIDatabaseProtocol, handle: hii.HIIHandle) usize {
19 return self._remove_package_list(self, handle);21 return self._remove_package_list(self, handle);
20 }22 }
2123
24 /// Update a package list in the HII database.
22 pub fn updatePackageList(self: *const HIIDatabaseProtocol, handle: hii.HIIHandle, buffer: *const hii.HIIPackageList) usize {25 pub fn updatePackageList(self: *const HIIDatabaseProtocol, handle: hii.HIIHandle, buffer: *const hii.HIIPackageList) usize {
23 return self._update_package_list(self, handle, buffer);26 return self._update_package_list(self, handle, buffer);
24 }27 }
2528
29 /// Determines the handles that are currently active in the database.
26 pub fn listPackageLists(self: *const HIIDatabaseProtocol, package_type: u8, package_guid: ?*const Guid, buffer_length: *usize, handles: [*]hii.HIIHandle) usize {30 pub fn listPackageLists(self: *const HIIDatabaseProtocol, package_type: u8, package_guid: ?*const Guid, buffer_length: *usize, handles: [*]hii.HIIHandle) usize {
27 return self._list_package_lists(self, package_type, package_guid, buffer_length, handles);31 return self._list_package_lists(self, package_type, package_guid, buffer_length, handles);
28 }32 }
2933
34 /// Exports the contents of one or all package lists in the HII database into a buffer.
30 pub fn exportPackageLists(self: *const HIIDatabaseProtocol, handle: ?hii.HIIHandle, buffer_size: *usize, buffer: *hii.HIIPackageList) usize {35 pub fn exportPackageLists(self: *const HIIDatabaseProtocol, handle: ?hii.HIIHandle, buffer_size: *usize, buffer: *hii.HIIPackageList) usize {
31 return self._export_package_lists(self, handle, buffer_size, buffer);36 return self._export_package_lists(self, handle, buffer_size, buffer);
32 }37 }
lib/std/os/uefi/protocols/hii_popup_protocol.zig+2
...@@ -2,10 +2,12 @@ const uefi = @import("std").os.uefi;...@@ -2,10 +2,12 @@ const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
3const hii = uefi.protocols.hii;3const hii = uefi.protocols.hii;
44
5/// Display a popup window
5pub const HIIPopupProtocol = extern struct {6pub const HIIPopupProtocol = extern struct {
6 revision: u64,7 revision: u64,
7 _create_popup: extern fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) usize,8 _create_popup: extern fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) usize,
89
10 /// Displays a popup window.
9 pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) usize {11 pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) usize {
10 return self._create_popup(self, style, popup_type, handle, msg, user_selection);12 return self._create_popup(self, style, popup_type, handle, msg, user_selection);
11 }13 }
lib/std/os/uefi/protocols/rng_protocol.zig+3-1
...@@ -1,15 +1,17 @@...@@ -1,15 +1,17 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 37.54/// Random Number Generator protocol
5pub const RNGProtocol = extern struct {5pub const RNGProtocol = extern struct {
6 _get_info: extern fn (*const RNGProtocol, *usize, [*]align(8) Guid) usize,6 _get_info: extern fn (*const RNGProtocol, *usize, [*]align(8) Guid) usize,
7 _get_rng: extern fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) usize,7 _get_rng: extern fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) usize,
88
9 /// Returns information about the random number generation implementation.
9 pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) usize {10 pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) usize {
10 return self._get_info(self, list_size, list);11 return self._get_info(self, list_size, list);
11 }12 }
1213
14 /// Produces and returns an RNG value using either the default or specified RNG algorithm.
13 pub fn getRNG(self: *const RNGProtocol, algo: ?*align(8) const Guid, value_length: usize, value: [*]u8) usize {15 pub fn getRNG(self: *const RNGProtocol, algo: ?*align(8) const Guid, value_length: usize, value: [*]u8) usize {
14 return self._get_rng(self, algo, value_length, value);16 return self._get_rng(self, algo, value_length, value);
15 }17 }
lib/std/os/uefi/protocols/simple_pointer_protocol.zig+3-1
...@@ -2,17 +2,19 @@ const uefi = @import("std").os.uefi;...@@ -2,17 +2,19 @@ const uefi = @import("std").os.uefi;
2const Event = uefi.Event;2const Event = uefi.Event;
3const Guid = uefi.Guid;3const Guid = uefi.Guid;
44
5/// UEFI Specification, Version 2.8, 12.55/// Protocol for mice
6pub const SimplePointerProtocol = struct {6pub const SimplePointerProtocol = struct {
7 _reset: extern fn (*const SimplePointerProtocol, bool) usize,7 _reset: extern fn (*const SimplePointerProtocol, bool) usize,
8 _get_state: extern fn (*const SimplePointerProtocol, *SimplePointerState) usize,8 _get_state: extern fn (*const SimplePointerProtocol, *SimplePointerState) usize,
9 wait_for_input: Event,9 wait_for_input: Event,
10 mode: *SimplePointerMode,10 mode: *SimplePointerMode,
1111
12 /// Resets the pointer device hardware.
12 pub fn reset(self: *const SimplePointerProtocol, verify: bool) usize {13 pub fn reset(self: *const SimplePointerProtocol, verify: bool) usize {
13 return self._reset(self, verify);14 return self._reset(self, verify);
14 }15 }
1516
17 /// Retrieves the current state of a pointer device.
16 pub fn getState(self: *const SimplePointerProtocol, state: *SimplePointerState) usize {18 pub fn getState(self: *const SimplePointerProtocol, state: *SimplePointerState) usize {
17 return self._get_state(self, state);19 return self._get_state(self, state);
18 }20 }
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+6-1
...@@ -2,7 +2,7 @@ const uefi = @import("std").os.uefi;...@@ -2,7 +2,7 @@ const uefi = @import("std").os.uefi;
2const Event = uefi.Event;2const Event = uefi.Event;
3const Guid = uefi.Guid;3const Guid = uefi.Guid;
44
5/// UEFI Specification, Version 2.8, 12.35/// Character input devices, e.g. Keyboard
6pub const SimpleTextInputExProtocol = extern struct {6pub const SimpleTextInputExProtocol = extern struct {
7 _reset: extern fn (*const SimpleTextInputExProtocol, bool) usize,7 _reset: extern fn (*const SimpleTextInputExProtocol, bool) usize,
8 _read_key_stroke_ex: extern fn (*const SimpleTextInputExProtocol, *KeyData) usize,8 _read_key_stroke_ex: extern fn (*const SimpleTextInputExProtocol, *KeyData) usize,
...@@ -11,22 +11,27 @@ pub const SimpleTextInputExProtocol = extern struct {...@@ -11,22 +11,27 @@ pub const SimpleTextInputExProtocol = extern struct {
11 _register_key_notify: extern fn (*const SimpleTextInputExProtocol, *const KeyData, extern fn (*const KeyData) usize, **c_void) usize,11 _register_key_notify: extern fn (*const SimpleTextInputExProtocol, *const KeyData, extern fn (*const KeyData) usize, **c_void) usize,
12 _unregister_key_notify: extern fn (*const SimpleTextInputExProtocol, *const c_void) usize,12 _unregister_key_notify: extern fn (*const SimpleTextInputExProtocol, *const c_void) usize,
1313
14 /// Resets the input device hardware.
14 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) usize {15 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) usize {
15 return self._reset(self, verify);16 return self._reset(self, verify);
16 }17 }
1718
19 /// Reads the next keystroke from the input device.
18 pub fn readKeyStrokeEx(self: *const SimpleTextInputExProtocol, key_data: *KeyData) usize {20 pub fn readKeyStrokeEx(self: *const SimpleTextInputExProtocol, key_data: *KeyData) usize {
19 return self._read_key_stroke_ex(self, key_data);21 return self._read_key_stroke_ex(self, key_data);
20 }22 }
2123
24 /// Set certain state for the input device.
22 pub fn setState(self: *const SimpleTextInputExProtocol, state: *const u8) usize {25 pub fn setState(self: *const SimpleTextInputExProtocol, state: *const u8) usize {
23 return self._set_state(self, state);26 return self._set_state(self, state);
24 }27 }
2528
29 /// Register a notification function for a particular keystroke for the input device.
26 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: extern fn (*const KeyData) usize, handle: **c_void) usize {30 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: extern fn (*const KeyData) usize, handle: **c_void) usize {
27 return self._register_key_notify(self, key_data, notify, handle);31 return self._register_key_notify(self, key_data, notify, handle);
28 }32 }
2933
34 /// Remove the notification that was previously registered.
30 pub fn unregisterKeyNotify(self: *const SimpleTextInputExProtocol, handle: *const c_void) usize {35 pub fn unregisterKeyNotify(self: *const SimpleTextInputExProtocol, handle: *const c_void) usize {
31 return self._unregister_key_notify(self, handle);36 return self._unregister_key_notify(self, handle);
32 }37 }
lib/std/os/uefi/protocols/simple_text_output_protocol.zig+10-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 12.44/// Character output devices
5pub const SimpleTextOutputProtocol = extern struct {5pub const SimpleTextOutputProtocol = extern struct {
6 _reset: extern fn (*const SimpleTextOutputProtocol, bool) usize,6 _reset: extern fn (*const SimpleTextOutputProtocol, bool) usize,
7 _output_string: extern fn (*const SimpleTextOutputProtocol, [*]const u16) usize,7 _output_string: extern fn (*const SimpleTextOutputProtocol, [*]const u16) usize,
...@@ -14,38 +14,47 @@ pub const SimpleTextOutputProtocol = extern struct {...@@ -14,38 +14,47 @@ pub const SimpleTextOutputProtocol = extern struct {
14 _enable_cursor: extern fn (*const SimpleTextOutputProtocol, bool) usize,14 _enable_cursor: extern fn (*const SimpleTextOutputProtocol, bool) usize,
15 mode: *SimpleTextOutputMode,15 mode: *SimpleTextOutputMode,
1616
17 /// Resets the text output device hardware.
17 pub fn reset(self: *const SimpleTextOutputProtocol, verify: bool) usize {18 pub fn reset(self: *const SimpleTextOutputProtocol, verify: bool) usize {
18 return self._reset(self, verify);19 return self._reset(self, verify);
19 }20 }
2021
22 /// Writes a string to the output device.
21 pub fn outputString(self: *const SimpleTextOutputProtocol, msg: [*]const u16) usize {23 pub fn outputString(self: *const SimpleTextOutputProtocol, msg: [*]const u16) usize {
22 return self._output_string(self, msg);24 return self._output_string(self, msg);
23 }25 }
2426
27 /// Verifies that all characters in a string can be output to the target device.
25 pub fn testString(self: *const SimpleTextOutputProtocol, msg: [*]const u16) usize {28 pub fn testString(self: *const SimpleTextOutputProtocol, msg: [*]const u16) usize {
26 return self._test_string(self, msg);29 return self._test_string(self, msg);
27 }30 }
2831
32 /// Returns information for an available text mode that the output device(s) supports.
29 pub fn queryMode(self: *const SimpleTextOutputProtocol, mode_number: usize, columns: *usize, rows: *usize) usize {33 pub fn queryMode(self: *const SimpleTextOutputProtocol, mode_number: usize, columns: *usize, rows: *usize) usize {
30 return self._query_mode(self, mode_number, columns, rows);34 return self._query_mode(self, mode_number, columns, rows);
31 }35 }
3236
37 /// Sets the output device(s) to a specified mode.
33 pub fn setMode(self: *const SimpleTextOutputProtocol, mode_number: usize) usize {38 pub fn setMode(self: *const SimpleTextOutputProtocol, mode_number: usize) usize {
34 return self._set_mode(self, mode_number);39 return self._set_mode(self, mode_number);
35 }40 }
3641
42 /// Sets the background and foreground colors for the outputString() and clearScreen() functions.
37 pub fn setAttribute(self: *const SimpleTextOutputProtocol, attribute: usize) usize {43 pub fn setAttribute(self: *const SimpleTextOutputProtocol, attribute: usize) usize {
38 return self._set_attribute(self, attribute);44 return self._set_attribute(self, attribute);
39 }45 }
4046
47 /// Clears the output device(s) display to the currently selected background color.
41 pub fn clearScreen(self: *const SimpleTextOutputProtocol) usize {48 pub fn clearScreen(self: *const SimpleTextOutputProtocol) usize {
42 return self._clear_screen(self);49 return self._clear_screen(self);
43 }50 }
4451
52 /// Sets the current coordinates of the cursor position.
45 pub fn setCursorPosition(self: *const SimpleTextOutputProtocol, column: usize, row: usize) usize {53 pub fn setCursorPosition(self: *const SimpleTextOutputProtocol, column: usize, row: usize) usize {
46 return self._set_cursor_position(self, column, row);54 return self._set_cursor_position(self, column, row);
47 }55 }
4856
57 /// Makes the cursor visible or invisible.
49 pub fn enableCursor(self: *const SimpleTextOutputProtocol, visible: bool) usize {58 pub fn enableCursor(self: *const SimpleTextOutputProtocol, visible: bool) usize {
50 return self._enable_cursor(self, visible);59 return self._enable_cursor(self, visible);
51 }60 }
lib/std/os/uefi/status.zig+41-1
...@@ -1,46 +1,86 @@...@@ -1,46 +1,86 @@
1const high_bit = 1 << @typeInfo(usize).Int.bits - 1;1const high_bit = 1 << @typeInfo(usize).Int.bits - 1;
22
3/// UEFI Specification, Version 2.8, Appendix D3/// The operation completed successfully.
4pub const success: usize = 0;4pub const success: usize = 0;
55
6/// The image failed to load.
6pub const load_error: usize = high_bit | 1;7pub const load_error: usize = high_bit | 1;
8/// A parameter was incorrect.
7pub const invalid_parameter: usize = high_bit | 2;9pub const invalid_parameter: usize = high_bit | 2;
10/// The operation is not supported.
8pub const unsupported: usize = high_bit | 3;11pub const unsupported: usize = high_bit | 3;
12/// The buffer was not the proper size for the request.
9pub const bad_buffer_size: usize = high_bit | 4;13pub const bad_buffer_size: usize = high_bit | 4;
14/// The buffer is not large enough to hold the requested data. The required buffer size is returned in the appropriate parameter when this error occurs.
10pub const buffer_too_small: usize = high_bit | 5;15pub const buffer_too_small: usize = high_bit | 5;
16/// There is no data pending upon return.
11pub const not_ready: usize = high_bit | 6;17pub const not_ready: usize = high_bit | 6;
18/// The physical device reported an error while attempting the operation.
12pub const device_error: usize = high_bit | 7;19pub const device_error: usize = high_bit | 7;
20/// The device cannot be written to.
13pub const write_protected: usize = high_bit | 8;21pub const write_protected: usize = high_bit | 8;
22/// A resource has run out.
14pub const out_of_resources: usize = high_bit | 9;23pub const out_of_resources: usize = high_bit | 9;
24/// An inconstancy was detected on the file system causing the operating to fail.
15pub const volume_corrupted: usize = high_bit | 10;25pub const volume_corrupted: usize = high_bit | 10;
26/// There is no more space on the file system.
16pub const volume_full: usize = high_bit | 11;27pub const volume_full: usize = high_bit | 11;
28/// The device does not contain any medium to perform the operation.
17pub const no_media: usize = high_bit | 12;29pub const no_media: usize = high_bit | 12;
30/// The medium in the device has changed since the last access.
18pub const media_changed: usize = high_bit | 13;31pub const media_changed: usize = high_bit | 13;
32/// The item was not found.
19pub const not_found: usize = high_bit | 14;33pub const not_found: usize = high_bit | 14;
34/// Access was denied.
20pub const access_denied: usize = high_bit | 15;35pub const access_denied: usize = high_bit | 15;
36/// The server was not found or did not respond to the request.
21pub const no_response: usize = high_bit | 16;37pub const no_response: usize = high_bit | 16;
38/// A mapping to a device does not exist.
22pub const no_mapping: usize = high_bit | 17;39pub const no_mapping: usize = high_bit | 17;
40/// The timeout time expired.
23pub const timeout: usize = high_bit | 18;41pub const timeout: usize = high_bit | 18;
42/// The protocol has not been started.
24pub const not_started: usize = high_bit | 19;43pub const not_started: usize = high_bit | 19;
44/// The protocol has already been started.
25pub const already_started: usize = high_bit | 20;45pub const already_started: usize = high_bit | 20;
46/// The operation was aborted.
26pub const aborted: usize = high_bit | 21;47pub const aborted: usize = high_bit | 21;
48/// An ICMP error occurred during the network operation.
27pub const icmp_error: usize = high_bit | 22;49pub const icmp_error: usize = high_bit | 22;
50/// A TFTP error occurred during the network operation.
28pub const tftp_error: usize = high_bit | 23;51pub const tftp_error: usize = high_bit | 23;
52/// A protocol error occurred during the network operation.
29pub const protocol_error: usize = high_bit | 24;53pub const protocol_error: usize = high_bit | 24;
54/// The function encountered an internal version that was incompatible with a version requested by the caller.
30pub const incompatible_version: usize = high_bit | 25;55pub const incompatible_version: usize = high_bit | 25;
56/// The function was not performed due to a security violation.
31pub const security_violation: usize = high_bit | 26;57pub const security_violation: usize = high_bit | 26;
58/// A CRC error was detected.
32pub const crc_error: usize = high_bit | 27;59pub const crc_error: usize = high_bit | 27;
60/// Beginning or end of media was reached
33pub const end_of_media: usize = high_bit | 28;61pub const end_of_media: usize = high_bit | 28;
62/// The end of the file was reached.
34pub const end_of_file: usize = high_bit | 31;63pub const end_of_file: usize = high_bit | 31;
64/// The language specified was invalid.
35pub const invalid_language: usize = high_bit | 32;65pub const invalid_language: usize = high_bit | 32;
66/// The security status of the data is unknown or compromised and the data must be updated or replaced to restore a valid security status.
36pub const compromised_data: usize = high_bit | 33;67pub const compromised_data: usize = high_bit | 33;
68/// There is an address conflict address allocation
37pub const ip_address_conflict: usize = high_bit | 34;69pub const ip_address_conflict: usize = high_bit | 34;
70/// A HTTP error occurred during the network operation.
38pub const http_error: usize = high_bit | 35;71pub const http_error: usize = high_bit | 35;
3972
73/// The string contained one or more characters that the device could not render and were skipped.
40pub const warn_unknown_glyph: usize = 1;74pub const warn_unknown_glyph: usize = 1;
75/// The handle was closed, but the file was not deleted.
41pub const warn_delete_failure: usize = 2;76pub const warn_delete_failure: usize = 2;
77/// The handle was closed, but the data to the file was not flushed properly.
42pub const warn_write_failure: usize = 3;78pub const warn_write_failure: usize = 3;
79/// The resulting buffer was too small, and the data was truncated to the buffer size.
43pub const warn_buffer_too_small: usize = 4;80pub const warn_buffer_too_small: usize = 4;
81/// The data has not been updated within the timeframe set by localpolicy for this type of data.
44pub const warn_stale_data: usize = 5;82pub const warn_stale_data: usize = 5;
83/// The resulting buffer contains UEFI-compliant file system.
45pub const warn_file_system: usize = 6;84pub const warn_file_system: usize = 6;
85/// The operation will be processed across a system reset.
46pub const warn_reset_required: usize = 7;86pub const warn_reset_required: usize = 7;
lib/std/os/uefi/tables/boot_services.zig+17-4
...@@ -4,29 +4,37 @@ const Guid = uefi.Guid;...@@ -4,29 +4,37 @@ const Guid = uefi.Guid;
4const Handle = uefi.Handle;4const Handle = uefi.Handle;
5const TableHeader = uefi.tables.TableHeader;5const TableHeader = uefi.tables.TableHeader;
66
7/// UEFI Specification, Version 2.8, 4.47/// Boot services are services provided by the system's firmware until the operating system takes
8///8/// over control over the hardware by calling exitBootServices.
9/// As the boot_services table may grow with new UEFI versions, it is important to check hdr.header_size.
10///9///
11/// Boot Services must not be used after exitBootServices has been called. The only exception is10/// Boot Services must not be used after exitBootServices has been called. The only exception is
12/// getMemoryMap, which may be used after the first unsuccessful call to exitBootServices.11/// getMemoryMap, which may be used after the first unsuccessful call to exitBootServices.
13/// After successfully calling exitBootServices, system_table.console_in_handle, system_table.con_in,12/// After successfully calling exitBootServices, system_table.console_in_handle, system_table.con_in,
14/// system_table.console_out_handle, system_table.con_out, system_table.standard_error_handle,13/// system_table.console_out_handle, system_table.con_out, system_table.standard_error_handle,
15/// system_table.std_err, and system_table.boot_services should be set to null. After setting these14/// system_table.std_err, and system_table.boot_services should be set to null. After setting these
16/// attributes to null, system_table.hdr.crc32 must be recomputed. See UEFI Specification, Version 2.8, 7.4.15/// attributes to null, system_table.hdr.crc32 must be recomputed.
16///
17/// As the boot_services table may grow with new UEFI versions, it is important to check hdr.header_size.
17pub const BootServices = extern struct {18pub const BootServices = extern struct {
18 hdr: TableHeader,19 hdr: TableHeader,
19 raiseTpl: usize, // TODO20 raiseTpl: usize, // TODO
20 restoreTpl: usize, // TODO21 restoreTpl: usize, // TODO
21 allocatePages: usize, // TODO22 allocatePages: usize, // TODO
22 freePages: usize, // TODO23 freePages: usize, // TODO
24 /// Returns the current memory map.
23 getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize,25 getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize,
26 /// Allocates pool memory.
24 allocatePool: extern fn (MemoryType, usize, *align(8) [*]u8) usize,27 allocatePool: extern fn (MemoryType, usize, *align(8) [*]u8) usize,
25 freePool: usize, // TODO28 freePool: usize, // TODO
29 /// Creates an event.
26 createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize,30 createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize,
31 /// Sets the type of timer and the trigger time for a timer event.
27 setTimer: extern fn (Event, TimerDelay, u64) usize,32 setTimer: extern fn (Event, TimerDelay, u64) usize,
33 /// Stops execution until an event is signaled.
28 waitForEvent: extern fn (usize, [*]const Event, *usize) usize,34 waitForEvent: extern fn (usize, [*]const Event, *usize) usize,
35 /// Signals an event.
29 signalEvent: extern fn (Event) usize,36 signalEvent: extern fn (Event) usize,
37 /// Closes an event.
30 closeEvent: extern fn (Event) usize,38 closeEvent: extern fn (Event) usize,
31 checkEvent: usize, // TODO39 checkEvent: usize, // TODO
32 installProtocolInterface: usize, // TODO40 installProtocolInterface: usize, // TODO
...@@ -40,11 +48,15 @@ pub const BootServices = extern struct {...@@ -40,11 +48,15 @@ pub const BootServices = extern struct {
40 installConfigurationTable: usize, // TODO48 installConfigurationTable: usize, // TODO
41 imageLoad: usize, // TODO49 imageLoad: usize, // TODO
42 imageStart: usize, // TODO50 imageStart: usize, // TODO
51 /// Terminates a loaded EFI image and returns control to boot services.
43 exit: extern fn (Handle, usize, usize, ?*const c_void) usize,52 exit: extern fn (Handle, usize, usize, ?*const c_void) usize,
44 imageUnload: usize, // TODO53 imageUnload: usize, // TODO
54 /// Terminates all boot services.
45 exitBootServices: extern fn (Handle, usize) usize,55 exitBootServices: extern fn (Handle, usize) usize,
46 getNextMonotonicCount: usize, // TODO56 getNextMonotonicCount: usize, // TODO
57 /// Induces a fine-grained stall.
47 stall: extern fn (usize) usize,58 stall: extern fn (usize) usize,
59 /// Sets the system's watchdog timer.
48 setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) usize,60 setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) usize,
49 connectController: usize, // TODO61 connectController: usize, // TODO
50 disconnectController: usize, // TODO62 disconnectController: usize, // TODO
...@@ -53,6 +65,7 @@ pub const BootServices = extern struct {...@@ -53,6 +65,7 @@ pub const BootServices = extern struct {
53 openProtocolInformation: usize, // TODO65 openProtocolInformation: usize, // TODO
54 protocolsPerHandle: usize, // TODO66 protocolsPerHandle: usize, // TODO
55 locateHandleBuffer: usize, // TODO67 locateHandleBuffer: usize, // TODO
68 /// Returns the first protocol instance that matches the given protocol.
56 locateProtocol: extern fn (*align(8) const Guid, ?*const c_void, *?*c_void) usize,69 locateProtocol: extern fn (*align(8) const Guid, ?*const c_void, *?*c_void) usize,
57 installMultipleProtocolInterfaces: usize, // TODO70 installMultipleProtocolInterfaces: usize, // TODO
58 uninstallMultipleProtocolInterfaces: usize, // TODO71 uninstallMultipleProtocolInterfaces: usize, // TODO
lib/std/os/uefi/tables/configuration_table.zig-2
...@@ -1,8 +1,6 @@...@@ -1,8 +1,6 @@
1const uefi = @import("std").os.uefi;1const uefi = @import("std").os.uefi;
2const Guid = uefi.Guid;2const Guid = uefi.Guid;
33
4/// UEFI Specification, Version 2.8, 4.6
5/// Because GUIDs must be align(8), structs of this type also must be align(8)
6pub const ConfigurationTable = extern struct {4pub const ConfigurationTable = extern struct {
7 vendor_guid: Guid,5 vendor_guid: Guid,
8 vendor_table: *c_void,6 vendor_table: *c_void,
lib/std/os/uefi/tables/runtime_services.zig+8-5
...@@ -4,26 +4,31 @@ const TableHeader = uefi.tables.TableHeader;...@@ -4,26 +4,31 @@ const TableHeader = uefi.tables.TableHeader;
4const Time = uefi.Time;4const Time = uefi.Time;
5const TimeCapabilities = uefi.TimeCapabilities;5const TimeCapabilities = uefi.TimeCapabilities;
66
7/// UEFI Specification, Version 2.8, 4.57/// Runtime services are provided by the firmware before and after exitBootServices has been called.
8///8///
9/// As the runtime_services table may grow with new UEFI versions, it is important to check hdr.header_size.9/// As the runtime_services table may grow with new UEFI versions, it is important to check hdr.header_size.
10///10///
11/// Some functions may not be supported. Check the RuntimeServicesSupported variable using getVariable.11/// Some functions may not be supported. Check the RuntimeServicesSupported variable using getVariable.
12/// getVariable is one of the functions that may not be supported. See UEFI Specification, Version 2.8, 8.1.12/// getVariable is one of the functions that may not be supported.
13///13///
14/// Some functions may not be called while other functions are running. See UEFI Specification, Version 2.8, 8.1.14/// Some functions may not be called while other functions are running.
15pub const RuntimeServices = extern struct {15pub const RuntimeServices = extern struct {
16 hdr: TableHeader,16 hdr: TableHeader,
17 /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
17 getTime: extern fn (*uefi.Time, ?*TimeCapabilities) usize,18 getTime: extern fn (*uefi.Time, ?*TimeCapabilities) usize,
18 setTime: usize, // TODO19 setTime: usize, // TODO
19 getWakeupTime: usize, // TODO20 getWakeupTime: usize, // TODO
20 setWakeupTime: usize, // TODO21 setWakeupTime: usize, // TODO
21 setVirtualAddressMap: usize, // TODO22 setVirtualAddressMap: usize, // TODO
22 convertPointer: usize, // TODO23 convertPointer: usize, // TODO
24 /// Returns the value of a variable.
23 getVariable: extern fn ([*]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) usize,25 getVariable: extern fn ([*]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) usize,
26 /// Enumerates the current variable names.
24 getNextVariableName: extern fn (*usize, [*]u16, *align(8) Guid) usize,27 getNextVariableName: extern fn (*usize, [*]u16, *align(8) Guid) usize,
28 /// Sets the value of a variable.
25 setVariable: extern fn ([*]const u16, *align(8) const Guid, u32, usize, *c_void) usize,29 setVariable: extern fn ([*]const u16, *align(8) const Guid, u32, usize, *c_void) usize,
26 getNextHighMonotonicCount: usize, // TODO30 getNextHighMonotonicCount: usize, // TODO
31 /// Resets the entire platform.
27 resetSystem: extern fn (ResetType, usize, usize, ?*const c_void) noreturn,32 resetSystem: extern fn (ResetType, usize, usize, ?*const c_void) noreturn,
28 updateCapsule: usize, // TODO33 updateCapsule: usize, // TODO
29 queryCapsuleCapabilities: usize, // TODO34 queryCapsuleCapabilities: usize, // TODO
...@@ -32,7 +37,6 @@ pub const RuntimeServices = extern struct {...@@ -32,7 +37,6 @@ pub const RuntimeServices = extern struct {
32 pub const signature: u64 = 0x56524553544e5552;37 pub const signature: u64 = 0x56524553544e5552;
33};38};
3439
35/// UEFI Specification, Version 2.8, 8.5.1
36pub const ResetType = extern enum(u32) {40pub const ResetType = extern enum(u32) {
37 ResetCold,41 ResetCold,
38 ResetWarm,42 ResetWarm,
...@@ -40,7 +44,6 @@ pub const ResetType = extern enum(u32) {...@@ -40,7 +44,6 @@ pub const ResetType = extern enum(u32) {
40 ResetPlatformSpecific,44 ResetPlatformSpecific,
41};45};
4246
43/// UEFI Specification, Version 2.8, 3.3
44pub const global_variable align(8) = Guid{47pub const global_variable align(8) = Guid{
45 .time_low = 0x8be4df61,48 .time_low = 0x8be4df61,
46 .time_mid = 0x93ca,49 .time_mid = 0x93ca,
lib/std/os/uefi/tables/system_table.zig+4-3
...@@ -7,17 +7,18 @@ const SimpleTextInputExProtocol = uefi.protocols.SimpleTextInputExProtocol;...@@ -7,17 +7,18 @@ const SimpleTextInputExProtocol = uefi.protocols.SimpleTextInputExProtocol;
7const SimpleTextOutputProtocol = uefi.protocols.SimpleTextOutputProtocol;7const SimpleTextOutputProtocol = uefi.protocols.SimpleTextOutputProtocol;
8const TableHeader = uefi.tables.TableHeader;8const TableHeader = uefi.tables.TableHeader;
99
10/// UEFI Specification, Version 2.8, 4.310/// The EFI System Table contains pointers to the runtime and boot services tables.
11///11///
12/// As the system_table may grow with new UEFI versions, it is important to check hdr.header_size.12/// As the system_table may grow with new UEFI versions, it is important to check hdr.header_size.
13///13///
14/// After successfully calling boot_services.exitBootServices, console_in_handle,14/// After successfully calling boot_services.exitBootServices, console_in_handle,
15/// con_in, console_out_handle, con_out, standard_error_handle, std_err, and15/// con_in, console_out_handle, con_out, standard_error_handle, std_err, and
16/// boot_services should be set to null. After setting these attributes to null,16/// boot_services should be set to null. After setting these attributes to null,
17/// hdr.crc32 must be recomputed. See UEFI Specification, Version 2.8, 7.4.17/// hdr.crc32 must be recomputed.
18pub const SystemTable = extern struct {18pub const SystemTable = extern struct {
19 hdr: TableHeader,19 hdr: TableHeader,
20 firmware_vendor: *u16,20 /// A null-terminated string that identifies the vendor that produces the system firmware of the platform.
21 firmware_vendor: [*]u16,
21 firmware_revision: u32,22 firmware_revision: u32,
22 console_in_handle: ?Handle,23 console_in_handle: ?Handle,
23 con_in: ?*SimpleTextInputExProtocol,24 con_in: ?*SimpleTextInputExProtocol,
lib/std/os/uefi/tables/table_header.zig+1-1
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1/// UEFI Specification, Version 2.8, 4.2
2pub const TableHeader = extern struct {1pub const TableHeader = extern struct {
3 signature: u64,2 signature: u64,
4 revision: u32,3 revision: u32,
4 /// The size, in bytes, of the entire table including the TableHeader
5 header_size: u32,5 header_size: u32,
6 crc32: u32,6 crc32: u32,
7 reserved: u32,7 reserved: u32,