zig/lib/std/os/uefi/tables/runtime_services.zig
Andrew Kelley d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00

63 lines
2.2 KiB
Zig

const uefi = @import("std").os.uefi;
const Guid = uefi.Guid;
const TableHeader = uefi.tables.TableHeader;
const Time = uefi.Time;
const TimeCapabilities = uefi.TimeCapabilities;
const Status = uefi.Status;
/// Runtime services are provided by the firmware before and after exitBootServices has been called.
///
/// As the runtime_services table may grow with new UEFI versions, it is important to check hdr.header_size.
///
/// Some functions may not be supported. Check the RuntimeServicesSupported variable using getVariable.
/// getVariable is one of the functions that may not be supported.
///
/// Some functions may not be called while other functions are running.
pub const RuntimeServices = extern struct {
hdr: TableHeader,
/// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
getTime: fn (*uefi.Time, ?*TimeCapabilities) callconv(.C) Status,
setTime: Status, // TODO
getWakeupTime: Status, // TODO
setWakeupTime: Status, // TODO
setVirtualAddressMap: Status, // TODO
convertPointer: Status, // TODO
/// Returns the value of a variable.
getVariable: fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) callconv(.C) Status,
/// Enumerates the current variable names.
getNextVariableName: fn (*usize, [*:0]u16, *align(8) Guid) callconv(.C) Status,
/// Sets the value of a variable.
setVariable: fn ([*:0]const u16, *align(8) const Guid, u32, usize, *c_void) callconv(.C) Status,
getNextHighMonotonicCount: Status, // TODO
/// Resets the entire platform.
resetSystem: fn (ResetType, Status, usize, ?*const c_void) callconv(.C) noreturn,
updateCapsule: Status, // TODO
queryCapsuleCapabilities: Status, // TODO
queryVariableInfo: Status, // TODO
pub const signature: u64 = 0x56524553544e5552;
};
pub const ResetType = enum(u32) {
ResetCold,
ResetWarm,
ResetShutdown,
ResetPlatformSpecific,
};
pub const global_variable align(8) = Guid{
.time_low = 0x8be4df61,
.time_mid = 0x93ca,
.time_high_and_version = 0x11d2,
.clock_seq_high_and_reserved = 0xaa,
.clock_seq_low = 0x0d,
.node = [_]u8{ 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c },
};