X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=arch%2Farch-x86_64.h;h=3ea8070ee619b9bf22476da4d54e792d8bf4c269;hp=4e0ad5f6e36ab0dcc3e1c37a461a65470a42a3dd;hb=2995607f86b7cfc918b3c140f481c5809fc3306c;hpb=317b95d07d4921d2594a1be6e014c9c2d062fe75 diff --git a/arch/arch-x86_64.h b/arch/arch-x86_64.h index 4e0ad5f6..3ea8070e 100644 --- a/arch/arch-x86_64.h +++ b/arch/arch-x86_64.h @@ -19,23 +19,36 @@ #endif #ifndef __NR_async_exec -#define __NR_async_exec 280 -#define __NR_async_wait 281 -#define __NR_umem_add 282 -#define __NR_async_thread 283 +#define __NR_async_exec 286 +#define __NR_async_wait 287 +#define __NR_umem_add 288 +#define __NR_async_thread 289 #endif #define FIO_HUGE_PAGE 2097152 #define FIO_HAVE_SYSLET -#define nop __asm__ __volatile__("rep;nop": : :"memory") +#define nop __asm__ __volatile__("rep;nop": : :"memory") +#define read_barrier() __asm__ __volatile__("lfence":::"memory") +#define write_barrier() __asm__ __volatile__("sfence":::"memory") -static inline unsigned long ffz(unsigned long bitmask) +static inline unsigned int arch_ffz(unsigned int bitmask) { - __asm__("bsfq %1,%0" :"=r" (bitmask) :"r" (~bitmask)); + __asm__("bsfl %1,%0" :"=r" (bitmask) :"r" (~bitmask)); return bitmask; } +static inline unsigned long long get_cpu_clock(void) +{ + unsigned int lo, hi; + + __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi)); + return ((unsigned long long) hi << 32ULL) | lo; +} + +#define ARCH_HAVE_FFZ +#define ARCH_HAVE_SSE +#define ARCH_HAVE_CPU_CLOCK #endif