代码拉取完成,页面将自动刷新
From 560380189ff29687e011eada93774af59452f2c5 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <[email protected]>
Date: Wed, 6 Mar 2024 03:28:59 +0000
Subject: [PATCH] add loongarch suopport for abseil-cpp
---
absl/base/internal/direct_mmap.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 1beb2ee..80fcbbb 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -80,7 +80,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
(defined(__PPC__) && !defined(__PPC64__)) || \
(defined(__riscv) && __riscv_xlen == 32) || \
(defined(__s390__) && !defined(__s390x__)) || \
- (defined(__sparc__) && !defined(__arch64__))
+ (defined(__sparc__) && !defined(__arch64__)) || \
+ defined(__loongarch64)
// On these architectures, implement mmap with mmap2.
static int pagesize = 0;
if (pagesize == 0) {
@@ -99,6 +100,10 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
// Workaround by invoking __mmap2() instead.
return __mmap2(start, length, prot, flags, fd,
static_cast<size_t>(offset / pagesize));
+#elif defined(__loongarch64)
+ return reinterpret_cast<void*>(
+ syscall(SYS_mmap, start, length, prot, flags, fd,
+ static_cast<unsigned long>(offset / pagesize))); // NOLINT
#else
return reinterpret_cast<void*>(
syscall(SYS_mmap2, start, length, prot, flags, fd,
--
2.43.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。