summaryrefslogtreecommitdiffstats
path: root/src/cpuid.h
diff options
context:
space:
mode:
authorRick Lei <ricklei@gmail.com>2015-01-14 15:11:43 +0100
committerRick Lei <ricklei@gmail.com>2015-01-14 15:11:43 +0100
commitc4378784ae2caec57634f9f04bcb3dcddc673f36 (patch)
tree70bbdb1c348803006a7cbf2092da65312720a386 /src/cpuid.h
parent133cee578e04e561bb17e37393bbf7e427522560 (diff)
downloadfastd-c4378784ae2caec57634f9f04bcb3dcddc673f36.tar
fastd-c4378784ae2caec57634f9f04bcb3dcddc673f36.zip
Add Android 4.1+ support. See doc/README-Android.md for build HOWTO.
* Update CMake files to work with android-cmake * Use unix domain socket for communicating with Android GUI * May also run standalone but requires rooted Android device
Diffstat (limited to 'src/cpuid.h')
-rw-r--r--src/cpuid.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpuid.h b/src/cpuid.h
index 9382156..671be87 100644
--- a/src/cpuid.h
+++ b/src/cpuid.h
@@ -50,7 +50,7 @@
static inline uint64_t fastd_cpuid(void) {
unsigned eax, ebx, ecx, edx;
- __asm__("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (1));
+ __asm__ __volatile__ ("mov %%ebx, %%edi;" "cpuid;" "xchgl %%ebx, %%edi;" : "=a" (eax), "=D" (ebx), "=c" (ecx), "=d" (edx) : "a" (1));
return ((uint64_t)ecx) << 32 | edx;
}