Commit | Line | Data |
---|---|---|
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 | ||
78c8831e DK |
11 | #define nop do { __asm__ __volatile__ ("yield"); } while (0) |
12 | #define read_barrier() do { __sync_synchronize(); } while (0) | |
13 | #define write_barrier() do { __sync_synchronize(); } while (0) | |
14 | ||
15 | static inline int arch_ffz(unsigned long bitmask) | |
16 | { | |
17 | unsigned long count, reversed_bits; | |
18 | if (~bitmask == 0) /* ffz() in lib/ffz.h does this. */ | |
19 | return 63; | |
20 | ||
21 | __asm__ __volatile__ ("rbit %1, %2\n" | |
22 | "clz %0, %1\n" : | |
23 | "=r"(count), "=&r"(reversed_bits) : | |
24 | "r"(~bitmask)); | |
25 | return count; | |
26 | } | |
27 | ||
28 | #define ARCH_HAVE_FFZ | |
29 | ||
214e2d56 | 30 | #ifdef ARCH_HAVE_CRC_CRYPTO |
31 | #define ARCH_HAVE_ARM64_CRC_CRYPTO | |
32 | #endif | |
33 | ||
78c8831e | 34 | #endif |