From 4ddb4993c8a59783d25afed635c07105d57da8d7 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Tue, 11 Jan 2022 18:01:40 +0100 Subject: [PATCH] kernel/x86: fix HPET ACPI table alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vendor_id shall come after the bitfields Move hpet_address to separate struct definition so we can apply the correct packed flags. see also: https://wiki.osdev.org/HPET Change-Id: Iced005846fedd4b895910e9b61137d5349db5b41 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4859 Reviewed-by: Jérôme Duval Tested-by: Commit checker robot --- headers/private/kernel/arch/x86/arch_hpet.h | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/headers/private/kernel/arch/x86/arch_hpet.h b/headers/private/kernel/arch/x86/arch_hpet.h index 163ed42882..e49003fa79 100644 --- a/headers/private/kernel/arch/x86/arch_hpet.h +++ b/headers/private/kernel/arch/x86/arch_hpet.h @@ -95,21 +95,24 @@ struct hpet_regs { }; +typedef struct acpi_hpet_addr { + uint8 address_space; + uint8 register_width; + uint8 register_offset; + uint8 reserved; + uint64 address; +} _PACKED acpi_hpet_addr; + + typedef struct acpi_hpet { acpi_descriptor_header header; /* "HPET" signature and acpi header */ - uint16 vendor_id; - uint8 legacy_capable : 1; - uint8 reserved1 : 1; - uint8 countersize : 1; - uint8 comparators : 5; uint8 hw_revision; - struct hpet_addr { - uint8 address_space; - uint8 register_width; - uint8 register_offset; - uint8 reserved; - uint64 address; - } hpet_address; + uint8 comparators : 5; + uint8 countersize : 1; + uint8 reserved1 : 1; + uint8 legacy_capable : 1; + uint16 vendor_id; + acpi_hpet_addr hpet_address; uint8 number; uint16 min_tick; } _PACKED acpi_hpet;