Add -Wdeclaration-after-statement to compiler flags
[fio.git] / arch / arch-x86.h
index 679ec2816992a3c7fa82a00b520cd24a82a936ca..49e64dd3cfa74c39570f4aabb99fe511e5e4e855 100644 (file)
@@ -1,6 +1,15 @@
 #ifndef ARCH_X86_H
 #define ARCH_X86_H
 
+static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
+                           unsigned int *ecx, unsigned int *edx)
+{
+       asm volatile("xchgl %%ebx, %1\ncpuid\nxchgl %%ebx, %1"
+               : "=a" (*eax), "=r" (*ebx), "=c" (*ecx), "=d" (*edx)
+               : "0" (*eax)
+               : "memory");
+}
+
 #include "arch-x86-common.h"
 
 #define FIO_ARCH       (arch_i386)
 #define __NR_sys_vmsplice      316
 #endif
 
+#ifndef __NR_shmget
+#define __NR_shmget 29
+#define __NR_shmat 30
+#define __NR_shmctl 31
+#endif
+
 #define        FIO_HUGE_PAGE           4194304
 
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
@@ -34,7 +49,7 @@ static inline unsigned long arch_ffz(unsigned long bitmask)
 
 static inline unsigned long long get_cpu_clock(void)
 {
-       unsigned long ret;
+       unsigned long long ret;
 
        __asm__ __volatile__("rdtsc" : "=A" (ret));
        return ret;