powerpc: harden the clock ATB probe a bit
[fio.git] / arch / arch-x86_64.h
CommitLineData
ebac4655
JA
1#ifndef ARCH_X86_64_h
2#define ARCH_X86_64_h
3
fa80feae
JA
4#include "arch-x86-common.h"
5
cca84643 6#define FIO_ARCH (arch_x86_64)
ebac4655
JA
7
8#ifndef __NR_ioprio_set
9#define __NR_ioprio_set 251
10#define __NR_ioprio_get 252
11#endif
12
13#ifndef __NR_fadvise64
14#define __NR_fadvise64 221
15#endif
16
8756e4d4
JA
17#ifndef __NR_sys_splice
18#define __NR_sys_splice 275
19#define __NR_sys_tee 276
20#define __NR_sys_vmsplice 278
21#endif
22
cb25df61
JA
23#define FIO_HUGE_PAGE 2097152
24
db6defc7 25#define nop __asm__ __volatile__("rep;nop": : :"memory")
44c47feb
JA
26#define read_barrier() __asm__ __volatile__("lfence":::"memory")
27#define write_barrier() __asm__ __volatile__("sfence":::"memory")
ebac4655 28
0ce8b119 29static inline unsigned long arch_ffz(unsigned long bitmask)
8f7e39dd 30{
0ce8b119 31 __asm__("bsf %1,%0" :"=r" (bitmask) :"r" (~bitmask));
8f7e39dd
JA
32 return bitmask;
33}
c223da83
JA
34
35static inline unsigned long long get_cpu_clock(void)
36{
37 unsigned int lo, hi;
38
39 __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi));
40 return ((unsigned long long) hi << 32ULL) | lo;
41}
42
21df44a2 43#define ARCH_HAVE_FFZ
2f68124f 44#define ARCH_HAVE_SSE4_2
c223da83 45#define ARCH_HAVE_CPU_CLOCK
8f7e39dd 46
ebac4655 47#endif