From fbc211a25582648a10654392d7c2b55934deb041 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Tue, 4 Jan 2022 18:29:45 +0100 Subject: [PATCH] efi: fix alignment for block device protocol efi_block_io_media struct needs padding on x86. uint64_t is aligned on 4 bytes in Haiku toolchain for 32-bit EFI loader. But the EFI firmware expects it to be aligned on 8 bytes. Same padding in u-boot: https://github.com/u-boot/u-boot/blob/v2021.10/include/efi_api.h#L638 and in Illumos: https://github.com/illumos/illumos-gate/commit/feff18a41e45afb02478e67d56fad5027334f115 Change-Id: I1b95cbe4cc1e7d96fde3ba52862a05f8a94aab79 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4840 Reviewed-by: Fredrik Holmqvist --- headers/private/kernel/platform/efi/protocol/block-io.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/headers/private/kernel/platform/efi/protocol/block-io.h b/headers/private/kernel/platform/efi/protocol/block-io.h index 6f1c52b8d2..695bb29fd1 100644 --- a/headers/private/kernel/platform/efi/protocol/block-io.h +++ b/headers/private/kernel/platform/efi/protocol/block-io.h @@ -43,8 +43,10 @@ struct efi_block_io_media { bool LogicalPartition; bool ReadOnly; bool WriteCaching; + uint8_t pad1[3]; uint32_t BlockSize; uint32_t IoAlign; + uint8_t pad2[4]; uint64_t LastBlock; // present in rev2