Disallow offload IO mode for engines marked with FIO_NO_OFFLOAD
[fio.git] / arch / arch-x86.h
CommitLineData
ebac4655
JA
1#ifndef ARCH_X86_H
2#define ARCH_X86_H
3
6b13c710
JA
4static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
5 unsigned int *ecx, unsigned int *edx)
6{
7 asm volatile("xchgl %%ebx, %1\ncpuid\nxchgl %%ebx, %1"
8 : "=a" (*eax), "=r" (*ebx), "=c" (*ecx), "=d" (*edx)
9 : "0" (*eax)
10 : "memory");
11}
12
c473a9bd 13#include "arch-x86-common.h" /* IWYU pragma: export */
fa80feae 14
e12f4ede 15#define FIO_ARCH (arch_x86)
ebac4655 16
cb25df61
JA
17#define FIO_HUGE_PAGE 4194304
18
db6defc7 19#define nop __asm__ __volatile__("rep;nop": : :"memory")
44c47feb
JA
20#define read_barrier() __asm__ __volatile__("": : :"memory")
21#define write_barrier() __asm__ __volatile__("": : :"memory")
ebac4655 22
8f7e39dd
JA
23static inline unsigned long arch_ffz(unsigned long bitmask)
24{
25 __asm__("bsfl %1,%0" :"=r" (bitmask) :"r" (~bitmask));
26 return bitmask;
27}
c223da83
JA
28
29static inline unsigned long long get_cpu_clock(void)
30{
6eb9d1b9 31 unsigned long long ret;
c223da83
JA
32
33 __asm__ __volatile__("rdtsc" : "=A" (ret));
34 return ret;
35}
36
8f7e39dd 37#define ARCH_HAVE_FFZ
c223da83 38#define ARCH_HAVE_CPU_CLOCK
8f7e39dd 39
ebac4655 40#endif