1 Star 0 Fork 24

dpd/gnu-efi

forked from src-openEuler/gnu-efi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-gnu-efi-add-CHAR16-for-loongarch64.patch 2.30 KB
一键复制 编辑 原始数据 按行查看 历史
dpd 提交于 2023-07-06 14:30 . gnu-efi add CHAR16 for loongarch64
From fa8ec7665759ac492e7d4f5371acdab4f866e2b0 Mon Sep 17 00:00:00 2001
From: doupengda <doupengda@loongson.cn>
Date: Thu, 6 Jul 2023 06:22:38 +0000
Subject: [PATCH] gnu-efi add CHAR16 for loongarch64
---
Make.defaults | 5 +++++
apps/AllocPages.c | 4 ++++
apps/FreePages.c | 5 ++++-
inc/loongarch64/efibind.h | 6 ++++++
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/Make.defaults b/Make.defaults
index 1277d14..434a44e 100755
--- a/Make.defaults
+++ b/Make.defaults
@@ -149,6 +149,11 @@ ifeq ($(ARCH),mips64el)
ARCH3264 = -mabi=64
endif
+ifeq ($(ARCH),loongarch64)
+ CFLAGS += -march=loongarch64
+ ARCH3264 = -mabi=lp64d
+endif
+
#
# Set HAVE_EFI_OBJCOPY if objcopy understands --target efi-[app|bsdrv|rtdrv],
# otherwise we need to compose the PE/COFF header using the assembler
diff --git a/apps/AllocPages.c b/apps/AllocPages.c
index bb81849..b475355 100644
--- a/apps/AllocPages.c
+++ b/apps/AllocPages.c
@@ -92,7 +92,11 @@ BS_Code 0000000071902000-00000000721FEFFF 00000000000008FD 000000000000000F
#define MAX_NUM_PAGES 0x000000000F000000
+#ifdef __loongarch64
+#define MAX_ADDR (((9ULL << 60) | (0xC << 28)) -1)
+#else
#define MAX_ADDR ((1ULL << 46) - 1)
+#endif
#ifdef DEBUG
diff --git a/apps/FreePages.c b/apps/FreePages.c
index 247c75d..020f17c 100644
--- a/apps/FreePages.c
+++ b/apps/FreePages.c
@@ -67,8 +67,11 @@ Available 00000000709FC000-00000000710E3FFF 00000000000006E8 000000000000000F
*/
#define MAX_NUM_PAGES 0x000000000F000000
-
+#ifdef __loongarch64
+#define MAX_ADDR (((9ULL << 60) | (0xC << 28)) -1)
+#else
#define MAX_ADDR ((1ULL << 46) - 1)
+#endif
#ifdef DEBUG
#undef DEBUG
diff --git a/inc/loongarch64/efibind.h b/inc/loongarch64/efibind.h
index aaf3fb7..23178a0 100644
--- a/inc/loongarch64/efibind.h
+++ b/inc/loongarch64/efibind.h
@@ -46,6 +46,10 @@ typedef int64_t intptr_t;
# define __WCHAR_TYPE__ short
#endif
+#ifndef __CHAR16_TYPE__
+# define __CHAR16_TYPE__ unsigned short
+#endif
+
typedef uint64_t UINT64;
typedef int64_t INT64;
@@ -54,8 +58,10 @@ typedef int32_t INT32;
typedef uint16_t UINT16;
typedef int16_t INT16;
+typedef __CHAR16_TYPE__ CHAR16;
typedef uint8_t UINT8;
typedef int8_t INT8;
+typedef char CHAR8;
typedef __WCHAR_TYPE__ WCHAR;
#undef VOID
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dpdwaj/gnu-efi.git
git@gitee.com:dpdwaj/gnu-efi.git
dpdwaj
gnu-efi
gnu-efi
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385