authorgravatar for ybham6@gmail.comfifty-six <ybham6@gmail.com> 2022-01-13 11:19:22-05:00
committergravatar for ybham6@gmail.comfifty-six <ybham6@gmail.com> 2022-01-13 15:47:14-05:00
log88687645b2a5c34304c36ded31d5164784aa207a
treede181c0b07e70f4c1eb41797309db0b8979adc2f
parentfe28cb8261eeb7e3094d38f2c5fb2012fbf205d6

std/os/uefi: Fill out remaining runtime services and add parameter names


1 files changed, 46 insertions(+), 14 deletions(-)

lib/std/os/uefi/tables/runtime_services.zig+46-14
......@@ -18,39 +18,71 @@ pub const RuntimeServices = extern struct {
1818 hdr: TableHeader,
1919
2020 /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
21 getTime: fn (*uefi.Time, ?*TimeCapabilities) callconv(.C) Status,
21 getTime: fn (time: *uefi.Time, capabilities: ?*TimeCapabilities) callconv(.C) Status,
2222
23 setTime: Status, // TODO
24 getWakeupTime: Status, // TODO
25 setWakeupTime: Status, // TODO
23 /// Sets the current local time and date information
24 setTime: fn (time: *uefi.Time) callconv(.C) Status,
25
26 /// Returns the current wakeup alarm clock setting
27 getWakeupTime: fn (enabled: *bool, pending: *bool, time: *uefi.Time) callconv(.C) Status,
28
29 /// Sets the system wakeup alarm clock time
30 setWakeupTime: fn (enable: *bool, time: ?*uefi.Time) callconv(.C) Status,
2631
2732 /// Changes the runtime addressing mode of EFI firmware from physical to virtual.
28 setVirtualAddressMap: fn (usize, usize, u32, [*]MemoryDescriptor) callconv(.C) Status,
33 setVirtualAddressMap: fn (mmap_size: usize, descriptor_size: usize, descriptor_version: u32, virtual_map: [*]MemoryDescriptor) callconv(.C) Status,
2934
3035 /// Determines the new virtual address that is to be used on subsequent memory accesses.
31 convertPointer: fn (usize, **anyopaque) callconv(.C) Status,
36 convertPointer: fn (debug_disposition: usize, address: **anyopaque) callconv(.C) Status,
3237
3338 /// Returns the value of a variable.
34 getVariable: fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*anyopaque) callconv(.C) Status,
39 getVariable: fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: ?*u32, data_size: *usize, data: ?*anyopaque) callconv(.C) Status,
3540
3641 /// Enumerates the current variable names.
37 getNextVariableName: fn (*usize, [*:0]u16, *align(8) Guid) callconv(.C) Status,
42 getNextVariableName: fn (var_name_size: *usize, var_name: [*:0]u16, vendor_guid: *align(8) Guid) callconv(.C) Status,
3843
3944 /// Sets the value of a variable.
40 setVariable: fn ([*:0]const u16, *align(8) const Guid, u32, usize, *anyopaque) callconv(.C) Status,
45 setVariable: fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: u32, data_size: usize, data: *anyopaque) callconv(.C) Status,
4146
42 getNextHighMonotonicCount: Status, // TODO
47 /// Return the next high 32 bits of the platform's monotonic counter
48 getNextHighMonotonicCount: fn (high_count: *u32) callconv(.C) Status,
4349
4450 /// Resets the entire platform.
45 resetSystem: fn (ResetType, Status, usize, ?*const anyopaque) callconv(.C) noreturn,
51 resetSystem: fn (reset_type: ResetType, reset_status: Status, data_size: usize, reset_data: ?*const anyopaque) callconv(.C) noreturn,
52
53 /// Passes capsules to the firmware with both virtual and physical mapping.
54 /// Depending on the intended consumption, the firmware may process the capsule immediately.
55 /// If the payload should persist across a system reset, the reset value returned from
56 /// `queryCapsuleCapabilities` must be passed into resetSystem and will cause the capsule
57 /// to be processed by the firmware as part of the reset process.
58 updateCapsule: fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, scatter_gather_list: EfiPhysicalAddress) callconv(.C) Status,
4659
47 updateCapsule: Status, // TODO
48 queryCapsuleCapabilities: Status, // TODO
49 queryVariableInfo: Status, // TODO
60 /// Returns if the capsule can be supported via `updateCapsule`
61 queryCapsuleCapabilities: fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, maximum_capsule_size: *usize, resetType: ResetType) callconv(.C) Status,
62
63 /// Returns information about the EFI variables
64 queryVariableInfo: fn (attributes: *u32, maximum_variable_storage_size: *u64, remaining_variable_storage_size: *u64, maximum_variable_size: *u64) callconv(.C) Status,
5065
5166 pub const signature: u64 = 0x56524553544e5552;
5267};
5368
69const EfiPhysicalAddress = u64;
70
71pub const CapsuleHeader = extern struct {
72 capsuleGuid: Guid align(8),
73 headerSize: u32,
74 flags: u32,
75 capsuleImageSize: u32,
76};
77
78pub const UefiCapsuleBlockDescriptor = extern struct {
79 length: u64,
80 address: union {
81 dataBlock: EfiPhysicalAddress,
82 continuationPointer: EfiPhysicalAddress,
83 },
84};
85
5486pub const ResetType = enum(u32) {
5587 ResetCold,
5688 ResetWarm,