After copying the FDT into a new larger buffer, adjust the FDT size to
authorkettenis <kettenis@openbsd.org>
Tue, 22 Mar 2022 10:32:10 +0000 (10:32 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 22 Mar 2022 10:32:10 +0000 (10:32 +0000)
reflect the size of the new buffer like we do on arm64.

ok patrick@

sys/arch/armv7/stand/efiboot/efiboot.c

index 5d7b121..134c021 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: efiboot.c,v 1.38 2021/12/12 22:54:35 jsg Exp $        */
+/*     $OpenBSD: efiboot.c,v 1.39 2022/03/22 10:32:10 kettenis Exp $   */
 
 /*
  * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -507,6 +507,7 @@ efi_makebootargs(char *bootargs, int howto)
        if (BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
            EFI_SIZE_TO_PAGES(len), &addr) == EFI_SUCCESS) {
                memcpy((void *)addr, fdt, fdt_get_size(fdt));
+               ((struct fdt_head *)addr)->fh_size = htobe32(len);
                fdt = (void *)addr;
        }