Blame SOURCES/0137-Fix-build-error-with-the-fdt-module-on-risc-v.patch

8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Javier Martinez Canillas <javierm@redhat.com>
8e15ce
Date: Tue, 27 Aug 2019 10:34:24 +0200
8e15ce
Subject: [PATCH] Fix build error with the fdt module on risc-v
8e15ce
8e15ce
The risc-v architecture also uses Device Trees, but the symbols in the
8e15ce
fdt header aren't defined for this arch which lead to following error:
8e15ce
8e15ce
BUILDSTDERR: ../../grub-core/loader/efi/fdt.c: In function 'grub_fdt_load':
8e15ce
BUILDSTDERR: ../../grub-core/loader/efi/fdt.c:48:39: warning: implicit declaration of function 'grub_fdt_get_totalsize' [-Wimplicit-function-declaration]
8e15ce
BUILDSTDERR:    48 |       size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt));
8e15ce
8e15ce
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
8e15ce
---
8e15ce
 include/grub/fdt.h | 6 ++++--
8e15ce
 1 file changed, 4 insertions(+), 2 deletions(-)
8e15ce
8e15ce
diff --git a/include/grub/fdt.h b/include/grub/fdt.h
8e15ce
index 2041341fd68..3514aa4a5b6 100644
8e15ce
--- a/include/grub/fdt.h
8e15ce
+++ b/include/grub/fdt.h
8e15ce
@@ -19,7 +19,8 @@
8e15ce
 #ifndef GRUB_FDT_HEADER
8e15ce
 #define GRUB_FDT_HEADER	1
8e15ce
 
8e15ce
-#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__aarch64__))
8e15ce
+#if !defined(GRUB_MACHINE_EMU) && \
8e15ce
+    (defined(__arm__) || defined(__aarch64__) || defined(__riscv))
8e15ce
 
8e15ce
 #include <grub/types.h>
8e15ce
 #include <grub/symbol.h>
8e15ce
@@ -146,6 +147,7 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch
8e15ce
   grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16);  \
8e15ce
 })
8e15ce
 
8e15ce
-#endif /* defined(__arm__) || defined(__aarch64__) */
8e15ce
+#endif /* !defined(GRUB_MACHINE_EMU) && \
8e15ce
+          (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) */
8e15ce
 
8e15ce
 #endif	/* ! GRUB_FDT_HEADER */