diff --git a/src/storage/gstor/zekernel/common/cm_memory.h b/src/storage/gstor/zekernel/common/cm_memory.h index 8db1ffaaa3c9c36c13ae245f2e95c230372d180a..8472d3fdd3ef7d29560b90f9eaca5168f3d570e1 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 6f708626ca5e038cf8eecf2ed973af4326374f36..d0d3a9b3fd9bbcfb338a6c2d24e3119708bf853e 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 8007d058f3f79367b5d32b796ceb7c782bfa370d..7d3eb48ad0f36bd73396f1a306f6beb38b745097 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