From 89a5c8478b2bb282f1fee880954f4af14dd9be9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=90=89?= Date: Sun, 22 Sep 2024 11:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Driscv64=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄吉 --- src/storage/gstor/zekernel/common/cm_memory.h | 2 +- src/storage/gstor/zekernel/common/cm_spinlock.h | 2 +- src/storage/gstor/zekernel/common/cm_thread.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/gstor/zekernel/common/cm_memory.h b/src/storage/gstor/zekernel/common/cm_memory.h index 8db1ffa..8472d3f 100644 --- a/src/storage/gstor/zekernel/common/cm_memory.h +++ b/src/storage/gstor/zekernel/common/cm_memory.h @@ -66,7 +66,7 @@ extern "C" { __asm__ volatile("mfence" :: \ : "memory"); \ } -#elif defined(__loongarch__) +#elif defined(__loongarch__) || defined(__riscv) #define CM_MFENCE \ { \ __asm__ volatile("" :: \ diff --git a/src/storage/gstor/zekernel/common/cm_spinlock.h b/src/storage/gstor/zekernel/common/cm_spinlock.h index 6f70862..d0d3a9b 100644 --- a/src/storage/gstor/zekernel/common/cm_spinlock.h +++ b/src/storage/gstor/zekernel/common/cm_spinlock.h @@ -69,7 +69,7 @@ typedef struct st_recursive_lock { uint16 r_cnt; } recursive_lock_t; -#if defined(__arm__) || defined(__aarch64__) || defined(__loongarch__) +#if defined(__arm__) || defined(__aarch64__) || defined(__loongarch__) || defined(__riscv) #define fas_cpu_pause() \ { \ __asm__ volatile("nop"); \ diff --git a/src/storage/gstor/zekernel/common/cm_thread.c b/src/storage/gstor/zekernel/common/cm_thread.c index 8007d05..7d3eb48 100644 --- a/src/storage/gstor/zekernel/common/cm_thread.c +++ b/src/storage/gstor/zekernel/common/cm_thread.c @@ -320,7 +320,7 @@ uint32 cm_get_current_thread_id() #define __SYS_GET_SPID 186 #elif (defined __aarch64__) #define __SYS_GET_SPID 178 -#elif (defined __loongarch__) +#elif (defined __loongarch__) || (defined __riscv) #include #define __SYS_GET_SPID SYS_gettid #endif -- Gitee