Commit 9f475dae14

Nick Erdmann <n@nirf.de>
2020-03-09 20:27:53
std/os/uefi: Add shell parameters protocol
1 parent 52eb412
Changed files (3)
lib/std/os/uefi/protocols/shell_parameters_protocol.zig
@@ -0,0 +1,20 @@
+const uefi = @import("std").os.uefi;
+const Guid = uefi.Guid;
+const FileHandle = uefi.FileHandle;
+
+pub const ShellParametersProtocol = extern struct {
+    argv: [*][*:0]const u16,
+    argc: usize,
+    stdin: FileHandle,
+    stdout: FileHandle,
+    stderr: FileHandle,
+
+    pub const guid align(8) = Guid{
+        .time_low = 0x752f3136,
+        .time_mid = 0x4e16,
+        .time_high_and_version = 0x4fdc,
+        .clock_seq_high_and_reserved = 0xa2,
+        .clock_seq_low = 0x2a,
+        .node = [_]u8{ 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca },
+    };
+};
lib/std/os/uefi/protocols.zig
@@ -87,3 +87,5 @@ pub const HIIPopupType = @import("protocols/hii_popup_protocol.zig").HIIPopupTyp
 pub const HIIPopupSelection = @import("protocols/hii_popup_protocol.zig").HIIPopupSelection;
 
 pub const RNGProtocol = @import("protocols/rng_protocol.zig").RNGProtocol;
+
+pub const ShellParametersProtocol = @import("protocols/shell_parameters_protocol.zig").ShellParametersProtocol;
lib/std/os/uefi.zig
@@ -105,3 +105,6 @@ pub const TimeCapabilities = extern struct {
     /// If true, a time set operation clears the device's time below the resolution level.
     sets_to_zero: bool,
 };
+
+/// File Handle as specified in the EFI Shell Spec
+pub const FileHandle = *@OpaqueType();