diff --git a/arch/arch-loongarch64.h b/arch/arch-loongarch64.h new file mode 100644 index 0000000000..94704ce383 --- /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__("nop") + +#endif diff --git a/arch/arch.h b/arch/arch.h index a25779d4fd..7ec3a613f0 100644 --- a/arch/arch.h +++ b/arch/arch.h @@ -19,6 +19,7 @@ enum { arch_hppa, arch_mips, arch_aarch64, + arch_loongarch64, arch_generic, @@ -77,6 +78,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/os/os-linux-syscall.h b/os/os-linux-syscall.h index c399b2fa99..b09ab9445d 100644 --- a/os/os-linux-syscall.h +++ b/os/os-linux-syscall.h @@ -263,8 +263,8 @@ #define __NR_sys_vmsplice 294 #endif -/* Linux syscalls for aarch64 */ -#elif defined(ARCH_AARCH64_H) +/* Linux syscalls for aarch64 and loongarch64 */ +#elif defined(ARCH_AARCH64_H) || defined(ARCH_LOONGARCH64_H) #ifndef __NR_ioprio_set #define __NR_ioprio_set 30 #define __NR_ioprio_get 31