1 Star 0 Fork 43

陈亚强/spdk

forked from src-openEuler/spdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0041-barrier-LOONGARCH-memory-barriers.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
Xue Liu 提交于 2023-09-01 15:51 . Add support for LOONGARCH
From 2d686707df37b8752f31684db16b689637ba141d Mon Sep 17 00:00:00 2001
From: Xue Liu <[email protected]>
Date: Thu, 1 Dec 2022 18:37:21 +0800
Subject: [PATCH 1/3] barrier: LOONGARCH memory barriers
Implement memory barrier for LOONGARCH platforms.
Change-Id: I44f5e63e6eb3f8bf98e965a22fb86f94e727061d
Signed-off-by: Xue Liu <[email protected]>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16082
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Changpeng Liu <[email protected]>
---
include/spdk/barrier.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/spdk/barrier.h b/include/spdk/barrier.h
index acae360..1ee7240 100644
--- a/include/spdk/barrier.h
+++ b/include/spdk/barrier.h
@@ -97,6 +97,15 @@ extern "C" {
#define _spdk_smp_mb() __asm volatile("lock addl $0, -128(%%esp); " ::: "memory");
#endif
+#elif defined(__loongarch__)
+
+#define _spdk_rmb() __asm volatile("dbar 0" ::: "memory")
+#define _spdk_wmb() __asm volatile("dbar 0" ::: "memory")
+#define _spdk_mb() __asm volatile("dbar 0" ::: "memory")
+#define _spdk_smp_rmb() __asm volatile("dbar 0" ::: "memory")
+#define _spdk_smp_wmb() __asm volatile("dbar 0" ::: "memory")
+#define _spdk_smp_mb() __asm volatile("dbar 0" ::: "memory")
+
#else
#define _spdk_rmb()
--
2.20.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaqiangchen/spdk.git
[email protected]:yaqiangchen/spdk.git
yaqiangchen
spdk
spdk
master

搜索帮助