linux, efi, arm*, fdt: break FDT extra allocation space out into a #define

Message ID 20190122165941.3034-1-leif.lindholm@linaro.org
State New
Headers show
Series
  • linux, efi, arm*, fdt: break FDT extra allocation space out into a #define
Related show

Commit Message

Leif Lindholm Jan. 22, 2019, 4:59 p.m.
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 <leif.lindholm@linaro.org>

---

There are many possible locations for the #define. This one felt least bad.

 grub-core/loader/arm64/linux.c | 2 +-
 include/grub/fdt.h             | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

-- 
2.11.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Comments

Daniel Kiper Jan. 23, 2019, 10:17 a.m. | #1
On Tue, Jan 22, 2019 at 04:59:41PM +0000, Leif Lindholm wrote:
> 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 <leif.lindholm@linaro.org>


Pushed. Thanks!

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Patch

diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
index c37295c0b..7c6d8daa1 100644
--- a/grub-core/loader/arm64/linux.c
+++ b/grub-core/loader/arm64/linux.c
@@ -71,7 +71,7 @@  finalize_params_linux (void)
 
   void *fdt;
 
-  fdt = grub_fdt_load (0x400);
+  fdt = grub_fdt_load (GRUB_EFI_LINUX_FDT_EXTRA_SPACE);
 
   if (!fdt)
     goto failure;
diff --git a/include/grub/fdt.h b/include/grub/fdt.h
index 158b1bc4b..e609c7e41 100644
--- a/include/grub/fdt.h
+++ b/include/grub/fdt.h
@@ -22,6 +22,9 @@ 
 #include <grub/types.h>
 #include <grub/symbol.h>
 
+/* 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 {