Make SH port work for packagers that don't differentiate between SH4 and SH4A
[fio.git] / arch / arch-x86_64.h
index b49fd5f..f2dcf49 100644 (file)
 #define FIO_HAVE_SYSLET
 
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
-#define read_barrier() asm volatile("lfence":::"memory")
+#define read_barrier() __asm__ __volatile__("lfence":::"memory")
+#define write_barrier()        __asm__ __volatile__("sfence":::"memory")
+
+static inline unsigned long arch_ffz(unsigned long 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