1 Star 0 Fork 99

src-NestOS/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0175-Fix-build-error-with-the-fdt-module-on-risc-v.patch 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From 0982a417f60eeb8f117ae4d2931947c0f4515934 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Tue, 27 Aug 2019 10:34:24 +0200
Subject: [PATCH 175/220] Fix build error with the fdt module on risc-v
The risc-v architecture also uses Device Trees, but the symbols in the
fdt header aren't defined for this arch which lead to following error:
BUILDSTDERR: ../../grub-core/loader/efi/fdt.c: In function 'grub_fdt_load':
BUILDSTDERR: ../../grub-core/loader/efi/fdt.c:48:39: warning: implicit declaration of function 'grub_fdt_get_totalsize' [-Wimplicit-function-declaration]
BUILDSTDERR: 48 | size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt));
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
include/grub/fdt.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/grub/fdt.h b/include/grub/fdt.h
index 2041341..3514aa4 100644
--- a/include/grub/fdt.h
+++ b/include/grub/fdt.h
@@ -19,7 +19,8 @@
#ifndef GRUB_FDT_HEADER
#define GRUB_FDT_HEADER 1
-#if !defined(GRUB_MACHINE_EMU) && (defined(__arm__) || defined(__aarch64__))
+#if !defined(GRUB_MACHINE_EMU) && \
+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv))
#include <grub/types.h>
#include <grub/symbol.h>
@@ -146,6 +147,7 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch
grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \
})
-#endif /* defined(__arm__) || defined(__aarch64__) */
+#endif /* !defined(GRUB_MACHINE_EMU) && \
+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) */
#endif /* ! GRUB_FDT_HEADER */
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-nest-os/grub2.git
git@gitee.com:src-nest-os/grub2.git
src-nest-os
grub2
grub2
master

搜索帮助