X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=arch%2Farch-x86_64.h;h=cea0451d8ba6f3788e7658508a27863f494ac590;hp=4f75addc1be14fd35d46e9631a57b50978bb6023;hb=62443342646df1c4984475f4bf1e09ae1e2a97c6;hpb=36ddbc093ed56f510645b4021cea74b2e0d1401b diff --git a/arch/arch-x86_64.h b/arch/arch-x86_64.h index 4f75addc..cea0451d 100644 --- a/arch/arch-x86_64.h +++ b/arch/arch-x86_64.h @@ -1,7 +1,9 @@ #ifndef ARCH_X86_64_h #define ARCH_X86_64_h -#define ARCH (arch_x86_64) +#include "arch-x86-common.h" + +#define FIO_ARCH (arch_x86_64) #ifndef __NR_ioprio_set #define __NR_ioprio_set 251 @@ -18,24 +20,28 @@ #define __NR_sys_vmsplice 278 #endif -#ifndef __NR_async_exec -#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 fio_ffz(unsigned long bitmask) +static inline unsigned long arch_ffz(unsigned long bitmask) { - __asm__("bsfq %1,%0" :"=r" (bitmask) :"r" (~bitmask)); + __asm__("bsf %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_SSE4_2 +#define ARCH_HAVE_CPU_CLOCK #endif