summaryrefslogtreecommitdiff
path: root/arch/arch-x86-common.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-12-18 19:54:40 +0100
committerJens Axboe <axboe@kernel.dk>2012-12-18 19:54:40 +0100
commit267339ff794d41af0f3714483c7ab75985d8a85f (patch)
treef34d096856371c6f6a38b68610130256284fe4bd /arch/arch-x86-common.h
parent2e4717eabbbb5a27f88e4d8212cb5af3634d7f62 (diff)
downloadfio-267339ff794d41af0f3714483c7ab75985d8a85f.tar.gz
fio-267339ff794d41af0f3714483c7ab75985d8a85f.tar.bz2
Fixup CPUID for 32-bit x86
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'arch/arch-x86-common.h')
-rw-r--r--arch/arch-x86-common.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/arch-x86-common.h b/arch/arch-x86-common.h
index 1e623544..d533d22d 100644
--- a/arch/arch-x86-common.h
+++ b/arch/arch-x86-common.h
@@ -4,24 +4,17 @@
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
- unsigned int id = *eax;
-
- asm("movl %4, %%eax;"
- "cpuid;"
- "movl %%eax, %0;"
- "movl %%ebx, %1;"
- "movl %%ecx, %2;"
- "movl %%edx, %3;"
- : "=r" (*eax), "=r" (*ebx), "=r" (*ecx), "=r" (*edx)
- : "r" (id)
- : "eax", "ebx", "ecx", "edx");
+ asm volatile("cpuid"
+ : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+ : "0" (*eax), "2" (*ecx)
+ : "memory");
}
#define ARCH_HAVE_INIT
extern int tsc_reliable;
static inline int arch_init(char *envp[])
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx = 0, edx;
/*
* Check for TSC