Skip to content

Instantly share code, notes, and snippets.

@crowell
Created December 8, 2015 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crowell/160ee45a93b946c10039 to your computer and use it in GitHub Desktop.
Save crowell/160ee45a93b946c10039 to your computer and use it in GitHub Desktop.
diff --git a/crypto/cpu-intel.c b/crypto/cpu-intel.c
index 924bab0..cb48bb3 100644
--- a/crypto/cpu-intel.c
+++ b/crypto/cpu-intel.c
@@ -116,7 +116,7 @@ static uint64_t OPENSSL_xgetbv(uint32_t xcr) {
return (uint64_t)_xgetbv(xcr);
#else
uint32_t eax, edx;
- __asm__ volatile ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr));
+ __asm__ volatile (".byte 0x0f,0x01,0xd0" : "=a"(eax), "=d"(edx) : "c"(xcr));
return (((uint64_t)edx) << 32) | eax;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment