io_uring: Enable io_uring ioengine on aarch64 arch
[fio.git] / arch / arch-aarch64.h
CommitLineData
78c8831e
DK
1#ifndef ARCH_AARCH64_H
2#define ARCH_AARCH64_H
3
4#include <unistd.h>
5#include <stdlib.h>
6#include <sys/types.h>
7#include <sys/wait.h>
8
9#define FIO_ARCH (arch_aarch64)
10
aae515f4
ZY
11#define ARCH_HAVE_IOURING
12
13#ifndef __NR_sys_io_uring_setup
14#define __NR_sys_io_uring_setup 425
15#endif
16#ifndef __NR_sys_io_uring_enter
17#define __NR_sys_io_uring_enter 426
18#endif
19#ifndef __NR_sys_io_uring_register
20#define __NR_sys_io_uring_register 427
21#endif
22
78c8831e
DK
23#define nop do { __asm__ __volatile__ ("yield"); } while (0)
24#define read_barrier() do { __sync_synchronize(); } while (0)
25#define write_barrier() do { __sync_synchronize(); } while (0)
26
27static inline int arch_ffz(unsigned long bitmask)
28{
29 unsigned long count, reversed_bits;
30 if (~bitmask == 0) /* ffz() in lib/ffz.h does this. */
31 return 63;
32
33 __asm__ __volatile__ ("rbit %1, %2\n"
34 "clz %0, %1\n" :
35 "=r"(count), "=&r"(reversed_bits) :
36 "r"(~bitmask));
37 return count;
38}
39
40#define ARCH_HAVE_FFZ
41
42#endif