git://wimlib.net
/
wimlib
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
719a063
)
x86_cpu_features.c: xgetbv fix for old binutils
author
Eric Biggers
<ebiggers3@gmail.com>
Sat, 22 Aug 2015 16:47:15 +0000
(11:47 -0500)
committer
Eric Biggers
<ebiggers3@gmail.com>
Sat, 22 Aug 2015 16:47:50 +0000
(11:47 -0500)
src/x86_cpu_features.c
patch
|
blob
|
history
diff --git
a/src/x86_cpu_features.c
b/src/x86_cpu_features.c
index aab200ffe5f2bb9b682592f8c4dee461234c2dbd..5e434f9f0b18cfcb36ca9559baed4d671d0ec1c7 100644
(file)
--- a/
src/x86_cpu_features.c
+++ b/
src/x86_cpu_features.c
@@
-47,7
+47,9
@@
read_xcr(u32 index)
{
u32 edx, eax;
- __asm__ ("xgetbv" : "=d" (edx), "=a" (eax) : "c" (index));
+ /* Execute the "xgetbv" instruction. Old versions of binutils do not
+ * recognize this instruction, so list the raw bytes instead. */
+ __asm__ (".byte 0x0f, 0x01, 0xd0" : "=d" (edx), "=a" (eax) : "c" (index));
return ((u64)edx << 32) | eax;
}