Skip to content

Commit

Permalink
arch: add loongarch64 support.
Browse files Browse the repository at this point in the history
This patch adds support for loongarch64 for fio.  This is tested by building
FIO on an loongarch64 Debian 10 system.

Signed-off-by: wangguofeng <[email protected]>
  • Loading branch information
cnmushiba committed Aug 12, 2021
1 parent 5431966 commit a1d409d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions arch/arch-loongarch64.h
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions arch/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum {
arch_hppa,
arch_mips,
arch_aarch64,
arch_loongarch64,

arch_generic,

Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions os/os-linux-syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1d409d

Please sign in to comment.