From: patrick Date: Tue, 23 Mar 2021 09:41:12 +0000 (+0000) Subject: Pack the SPCR struct definition since the struct isn't naturally aligned X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eeb8d4725bb547b9e48e7cf690b06be1f2f06587;p=openbsd Pack the SPCR struct definition since the struct isn't naturally aligned or padded, and hence e. g. the access to the PCI vendor/device id would be broken. The structs for the other tables all seem to be packed as well. ok kettenis@ --- diff --git a/sys/arch/arm64/stand/efiboot/efiacpi.c b/sys/arch/arm64/stand/efiboot/efiacpi.c index 4256a7fbfdb..4b315cc8c1c 100644 --- a/sys/arch/arm64/stand/efiboot/efiacpi.c +++ b/sys/arch/arm64/stand/efiboot/efiacpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiacpi.c,v 1.10 2021/03/11 11:16:56 jsg Exp $ */ +/* $OpenBSD: efiacpi.c,v 1.11 2021/03/23 09:41:12 patrick Exp $ */ /* * Copyright (c) 2018 Mark Kettenis @@ -340,7 +340,7 @@ struct acpi_spcr { uint32_t pci_flags; uint8_t pci_segment; uint32_t reserved3; -}; +} __packed; /* We'll never see ACPI 1.0 tables on ARM. */ static EFI_GUID acpi_guid = ACPI_20_TABLE_GUID; diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h index 0c80c31d044..f2ff1f02564 100644 --- a/sys/dev/acpi/acpireg.h +++ b/sys/dev/acpi/acpireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpireg.h,v 1.54 2021/03/15 22:40:23 patrick Exp $ */ +/* $OpenBSD: acpireg.h,v 1.55 2021/03/23 09:41:12 patrick Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Marco Peereboom @@ -448,7 +448,7 @@ struct acpi_spcr { uint32_t pci_flags; uint8_t pci_segment; uint32_t reserved3; -}; +} __packed; struct acpi_facs { uint8_t signature[4];