summaryrefslogtreecommitdiff
path: root/lib/uefi.c3l/uefi/uefi.c3i
blob: ab215c2bd5b79148b7368e41e689c215c8763544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module uefi;

alias EfiHandle = void*;
typedef EfiEvent = void*;

struct TableHeader {
    ulong signature;
    uint revision;
    uint headerSize;
    uint crc32;
    uint reserved;
}

struct ConfigurationTable {
	EfiGuid vendorGuid;
	void* vendorTable;
}

struct SystemTable {
    TableHeader header;
    EfiString firmwareVendor;
    uint firmwareRevision;
    EfiHandle consoleInHandle;
    SimpleTextInputProtocol* conIn;
    EfiHandle consoleOutHandle;
    SimpleTextOutputProtocol* conOut;
    EfiHandle standardErrorHandle;
    SimpleTextOutputProtocol* stdErr;
    RuntimeServices* runtimeServices;
    BootServices* bootServices;
    ulong numberOfTableEntries;
	ConfigurationTable* configurationTable;
}

alias WChar = ushort;
typedef EfiString = inline WChar*;
typedef WString = inline WChar[];
macro WString @w(String $string) @builtin @public => $$wstr16($string);

// Time related definitions
struct EfiTime @packed {
    ushort      year;
    char        month;
    char        day;
    char        hour;
    char        minute;
    char        second;
    char        _pad1;
    uint        nanosecond;
    short       timezone;
    EfiDaylightFlags daylight;
    char        _pad2;
}

bitstruct EfiDaylightFlags : char {
    bool        adjust          : 0;
    bool        in_daylight     : 1;
    char        reserved        : 2..7;
}