From 2db2b2123bf807aa7d812d0b15438c74bf3124f3 Mon Sep 17 00:00:00 2001 From: Han Pengfei Date: Sun, 18 Apr 2021 22:30:02 +0800 Subject: [PATCH] headers: Make structure padding explicit in efi_memory_descriptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EFI memory descriptor 64-bit aligns PhysicalStart on both 32- and 64-bit platforms. Make the padding explicit for arm efi and referring 32-bits platform. - Same fix in FreeBSD: https://reviews.freebsd.org/rS320234 - Confirmed with NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/gnu-efi/dist/inc/efidef.h#L191 - Confirmed with Linux: https://github.com/torvalds/linux/blob/5ee96fa9dd78b2dc81b587e33074d877002d7605/include/linux/efi.h#L137 - Confirmed with Zircon: https://github.com/vsrinivas/fuchsia/blob/master/zircon/kernel/lib/efi/include/efi/boot-services.h#L34 The Early Zircon/Fuchsia version has the same problem we have, apparently they did not test their header on 32bit platforms either, now They have got it fixed. Signed-off-by: Han Pengfei Change-Id: I0c685d41420c4a63773a7bb39b7d2fdd61e932c4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3875 Reviewed-by: Adrien Destugues Reviewed-by: Jérôme Duval Reviewed-by: Alex von Gluck IV Reviewed-by: Fredrik Holmqvist --- headers/private/kernel/platform/efi/boot-services.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/private/kernel/platform/efi/boot-services.h b/headers/private/kernel/platform/efi/boot-services.h index 8cc5f44cef..1f29105a47 100644 --- a/headers/private/kernel/platform/efi/boot-services.h +++ b/headers/private/kernel/platform/efi/boot-services.h @@ -27,6 +27,7 @@ typedef enum { typedef struct { uint32_t Type; + uint32_t Padding; efi_physical_addr PhysicalStart; efi_virtual_addr VirtualStart; uint64_t NumberOfPages;