1 Star 0 Fork 31

dpd/fio_euler

forked from src-openEuler/fio 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Add-support-for-loongarch64.patch 2.38 KB
一键复制 编辑 原始数据 按行查看 历史
dpd 提交于 2023-07-05 10:37 . Add support for loongarch64
From 602997d492f2338b337a25d9b738d2bb3053f6ce Mon Sep 17 00:00:00 2001
From: doupengda <doupengda@loongson.cn>
Date: Wed, 5 Jul 2023 02:30:53 +0000
Subject: [PATCH] Add support for loongarch64
---
arch/arch-loongarch64.h | 10 ++++++++++
arch/arch.h | 3 +++
configure | 3 +++
libfio.c | 3 ++-
os/os-linux-syscall.h | 7 +++++++
5 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 arch/arch-loongarch64.h
diff --git a/arch/arch-loongarch64.h b/arch/arch-loongarch64.h
new file mode 100644
index 0000000..43ea83b
--- /dev/null
+++ b/arch/arch-loongarch64.h
@@ -0,0 +1,10 @@
+#ifndef ARCH_LOONGARCH64_H
+#define ARCH_LOONGARCH64_H
+
+#define FIO_ARCH (arch_loongarch64)
+
+#define read_barrier() __asm__ __volatile__("dbar 0": : :"memory")
+#define write_barrier() __asm__ __volatile__("dbar 0": : :"memory")
+#define nop __asm__ __volatile__("dbar 0": : :"memory")
+
+#endif
diff --git a/arch/arch.h b/arch/arch.h
index fca003b..2c11c0f 100644
--- a/arch/arch.h
+++ b/arch/arch.h
@@ -27,6 +27,7 @@ enum {
arch_generic,
arch_nr,
+ arch_loongarch64,
};
enum {
@@ -97,6 +98,8 @@ extern unsigned long arch_flags;
#include "arch-hppa.h"
#elif defined(__aarch64__)
#include "arch-aarch64.h"
+#elif defined(__loongarch64)
+#include "arch-loongarch64.h"
#else
#warning "Unknown architecture, attempting to use generic model."
#include "arch-generic.h"
diff --git a/configure b/configure
index 45d10a3..46d6d9a 100755
--- a/configure
+++ b/configure
@@ -523,6 +523,9 @@ case "$cpu" in
mips*)
cpu="mips"
;;
+ loongarch64)
+ cpu="loongarch64"
+ ;;
sparc|sun4[cdmuv])
cpu="sparc"
;;
diff --git a/libfio.c b/libfio.c
index a52014c..d2227f4 100644
--- a/libfio.c
+++ b/libfio.c
@@ -74,7 +74,8 @@ static const char *fio_arch_strings[arch_nr] = {
"hppa",
"mips",
"aarch64",
- "generic"
+ "generic",
+ "loongarch64"
};
static void reset_io_counters(struct thread_data *td, int all)
diff --git a/os/os-linux-syscall.h b/os/os-linux-syscall.h
index c399b2f..3524966 100644
--- a/os/os-linux-syscall.h
+++ b/os/os-linux-syscall.h
@@ -270,6 +270,13 @@
#define __NR_ioprio_get 31
#endif
+/* Linux syscalls for loongarch64 */
+#elif defined(ARCH_LOONGARCH64_H)
+#ifndef __NR_ioprio_set
+#define __NR_ioprio_set 30
+#define __NR_ioprio_get 31
+#endif
+
#else
#warning "Unknown architecture"
#endif
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dpdwaj/fio_euler.git
git@gitee.com:dpdwaj/fio_euler.git
dpdwaj
fio_euler
fio_euler
master

搜索帮助