zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 908b431abeb1df5d3c3ad34d9299e720c3e06a9d (tree)
parent b8329351b18ebaf24ad66819e05d91888c7dc886
Author: Nameless <truemedian@gmail.com>
Date:   Sun, 27 Jun 2021 13:34:44 -0500

std/os/uefi: fix packed struct bitfields

Diffstat:
Mlib/std/os/uefi/protocols/absolute_pointer_protocol.zig | 8++++++--
Mlib/std/os/uefi/protocols/edid_override_protocol.zig | 4+++-
Mlib/std/os/uefi/protocols/simple_network_protocol.zig | 8++++++--
Mlib/std/os/uefi/tables/boot_services.zig | 11++++++++---
4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/lib/std/os/uefi/protocols/absolute_pointer_protocol.zig b/lib/std/os/uefi/protocols/absolute_pointer_protocol.zig @@ -45,7 +45,9 @@ pub const AbsolutePointerMode = extern struct { attributes: packed struct { supports_alt_active: bool, supports_pressure_as_z: bool, - _pad1: u30, + _pad1: u6, + _pad2: u8, + _pad3: u16, }, }; @@ -56,6 +58,8 @@ pub const AbsolutePointerState = extern struct { active_buttons: packed struct { touch_active: bool, alt_active: bool, - _pad1: u30, + _pad1: u6, + _pad2: u8, + _pad3: u16, }, }; diff --git a/lib/std/os/uefi/protocols/edid_override_protocol.zig b/lib/std/os/uefi/protocols/edid_override_protocol.zig @@ -31,5 +31,7 @@ pub const EdidOverrideProtocol = extern struct { pub const EdidOverrideProtocolAttributes = packed struct { dont_override: bool, enable_hot_plug: bool, - _pad1: u30, + _pad1: u6, + _pad2: u8, + _pad3: u16, }; diff --git a/lib/std/os/uefi/protocols/simple_network_protocol.zig b/lib/std/os/uefi/protocols/simple_network_protocol.zig @@ -131,7 +131,9 @@ pub const SimpleNetworkReceiveFilter = packed struct { receive_broadcast: bool, receive_promiscuous: bool, receive_promiscuous_multicast: bool, - _pad: u27 = undefined, + _pad1: u3 = undefined, + _pad2: u8 = undefined, + _pad3: u16 = undefined, }; pub const SimpleNetworkState = enum(u32) { @@ -174,5 +176,7 @@ pub const SimpleNetworkInterruptStatus = packed struct { transmit_interrupt: bool, command_interrupt: bool, software_interrupt: bool, - _pad: u28, + _pad1: u4, + _pad2: u8, + _pad3: u16, }; diff --git a/lib/std/os/uefi/tables/boot_services.zig b/lib/std/os/uefi/tables/boot_services.zig @@ -193,7 +193,8 @@ pub const MemoryDescriptor = extern struct { wt: bool, wb: bool, uce: bool, - _pad1: u7, + _pad1: u3, + _pad2: u4, wp: bool, rp: bool, xp: bool, @@ -202,7 +203,9 @@ pub const MemoryDescriptor = extern struct { ro: bool, sp: bool, cpu_crypto: bool, - _pad2: u43, + _pad3: u4, + _pad4: u32, + _pad5: u7, memory_runtime: bool, }, }; @@ -220,7 +223,9 @@ pub const OpenProtocolAttributes = packed struct { by_child_controller: bool = false, by_driver: bool = false, exclusive: bool = false, - _pad: u26 = undefined, + _pad1: u2 = undefined, + _pad2: u8 = undefined, + _pad3: u16 = undefined, }; pub const ProtocolInformationEntry = extern struct {