代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gnu-efi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。