master
 1const uefi = @import("std").os.uefi;
 2const BootServices = uefi.tables.BootServices;
 3const ConfigurationTable = uefi.tables.ConfigurationTable;
 4const Handle = uefi.Handle;
 5const RuntimeServices = uefi.tables.RuntimeServices;
 6const SimpleTextInputProtocol = uefi.protocol.SimpleTextInput;
 7const SimpleTextOutputProtocol = uefi.protocol.SimpleTextOutput;
 8const TableHeader = uefi.tables.TableHeader;
 9
10/// The EFI System Table contains pointers to the runtime and boot services tables.
11///
12/// As the system_table may grow with new UEFI versions, it is important to check hdr.header_size.
13///
14/// After successfully calling boot_services.exitBootServices, console_in_handle,
15/// 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,
17/// hdr.crc32 must be recomputed.
18pub const SystemTable = extern struct {
19    hdr: TableHeader,
20
21    /// A null-terminated string that identifies the vendor that produces the system firmware of the platform.
22    firmware_vendor: [*:0]u16,
23    firmware_revision: u32,
24    console_in_handle: ?Handle,
25    con_in: ?*SimpleTextInputProtocol,
26    console_out_handle: ?Handle,
27    con_out: ?*SimpleTextOutputProtocol,
28    standard_error_handle: ?Handle,
29    std_err: ?*SimpleTextOutputProtocol,
30    runtime_services: *RuntimeServices,
31    boot_services: ?*BootServices,
32    number_of_table_entries: usize,
33    configuration_table: [*]ConfigurationTable,
34
35    pub const signature: u64 = 0x5453595320494249;
36    pub const revision_1_02: u32 = (1 << 16) | 2;
37    pub const revision_1_10: u32 = (1 << 16) | 10;
38    pub const revision_2_00: u32 = (2 << 16);
39    pub const revision_2_10: u32 = (2 << 16) | 10;
40    pub const revision_2_20: u32 = (2 << 16) | 20;
41    pub const revision_2_30: u32 = (2 << 16) | 30;
42    pub const revision_2_31: u32 = (2 << 16) | 31;
43    pub const revision_2_40: u32 = (2 << 16) | 40;
44    pub const revision_2_50: u32 = (2 << 16) | 50;
45    pub const revision_2_60: u32 = (2 << 16) | 60;
46    pub const revision_2_70: u32 = (2 << 16) | 70;
47    pub const revision_2_80: u32 = (2 << 16) | 80;
48    pub const revision_2_90: u32 = (2 << 16) | 90;
49    pub const revision_2_100: u32 = (2 << 16) | 100;
50    pub const revision_2_110: u32 = (2 << 16) | 110;
51};