From 8ae9db92efe2ad02218a27d0a84261d26124af60 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 20 Jun 2019 16:21:48 +0100 Subject: [PATCH 187/237] linux, efi, arm*, fdt: break FDT extra allocation space out into a #define A certain amount of dynamic space is required for the handover from GRUB/Linux-EFI-stub. This entails things like initrd addresses, address-cells entries and associated strings. But move this into a proper centralised #define rather than live-code it in the loader. Signed-off-by: Leif Lindholm Reviewed-by: Daniel Kiper Signed-off-by: Peter Robinson --- grub-core/loader/arm64/linux.c | 2 +- include/grub/fdt.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index e1110749eb9..628b320618c 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -73,7 +73,7 @@ finalize_params_linux (void) grub_err_t err = GRUB_ERR_NONE; void *fdt; - fdt = grub_fdt_load (0x400); + fdt = grub_fdt_load (GRUB_EFI_LINUX_FDT_EXTRA_SPACE); if (!fdt) { err = grub_error(GRUB_ERR_BAD_OS, "failed to load FDT"); diff --git a/include/grub/fdt.h b/include/grub/fdt.h index e34644631e1..2041341fd68 100644 --- a/include/grub/fdt.h +++ b/include/grub/fdt.h @@ -24,6 +24,9 @@ #include #include +/* Space required when preparing the /chosen node after boot has been called. */ +#define GRUB_EFI_LINUX_FDT_EXTRA_SPACE 0x400 + #define FDT_MAGIC 0xD00DFEED typedef struct { -- 2.26.2