authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2025-03-02 23:13:58+00:00
committergravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2025-03-02 23:16:34+00:00
log1a03b8c8992d1a739363f289566334ba2a970cca
tree6931d9df23ff8256e9b6c2a30d12df92d7f389a6
parent6378295b771b2e621918d20e45debf91ee114eac

std.os.uefi: Fix two padding mistakes in the Time struct

```c //************************************************ //EFI_TIME //************************************************ // This represents the current time information typedef struct { UINT16 Year; // 1900 - 9999 UINT8 Month; // 1 - 12 UINT8 Day; // 1 - 31 UINT8 Hour; // 0 - 23 UINT8 Minute; // 0 - 59 UINT8 Second; // 0 - 59 UINT8 Pad1; UINT32 Nanosecond; // 0 - 999,999,999 INT16 TimeZone; // —1440 to 1440 or 2047 UINT8 Daylight; UINT8 Pad2; } EFI_TIME; ```

1 files changed, 11 insertions(+), 3 deletions(-)

lib/std/os/uefi.zig+11-3
......@@ -113,22 +113,30 @@ pub const Time = extern struct {
113113 /// 0 - 59
114114 second: u8,
115115
116 _pad1: u8,
117
116118 /// 0 - 999999999
117119 nanosecond: u32,
118120
119121 /// The time's offset in minutes from UTC.
120122 /// Allowed values are -1440 to 1440 or unspecified_timezone
121123 timezone: i16,
122 daylight: packed struct {
123 _pad1: u6,
124
124 daylight: packed struct(u8) {
125125 /// If true, the time has been adjusted for daylight savings time.
126126 in_daylight: bool,
127127
128128 /// If true, the time is affected by daylight savings time.
129129 adjust_daylight: bool,
130
131 _: u6,
130132 },
131133
134 _pad2: u8,
135
136 comptime {
137 std.debug.assert(@sizeOf(Time) == 16);
138 }
139
132140 /// Time is to be interpreted as local time
133141 pub const unspecified_timezone: i16 = 0x7ff;
134142