summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-03-25 20:59:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-03-25 20:59:31 +0000
commiteb804332c18179d86dc26dc997591d2687a19d81 (patch)
treeb24c18f83e397fe548b35815c75111e53ab3f81b /sys/arch/amd64/include
parentb5d6cc96904f2b6133eb487992b34efff2bf8434 (diff)
Mark CPUID_LEAF inline asm as volatile to prevent the compiler from reordering
it with respect to other instructions. ok gunether@, mlarkin@
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r--sys/arch/amd64/include/specialreg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/amd64/include/specialreg.h b/sys/arch/amd64/include/specialreg.h
index f10ced1bae5..23a4656e4de 100644
--- a/sys/arch/amd64/include/specialreg.h
+++ b/sys/arch/amd64/include/specialreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: specialreg.h,v 1.33 2015/03/21 20:42:38 kettenis Exp $ */
+/* $OpenBSD: specialreg.h,v 1.34 2015/03/25 20:59:30 kettenis Exp $ */
/* $NetBSD: specialreg.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */
/* $NetBSD: x86/specialreg.h,v 1.2 2003/04/25 21:54:30 fvdl Exp $ */
@@ -256,11 +256,11 @@
#define CPUID2STEPPING(cpuid) ((cpuid) & 15)
#define CPUID(code, eax, ebx, ecx, edx) \
- __asm("cpuid" \
+ __asm volatile("cpuid" \
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
: "a" (code));
#define CPUID_LEAF(code, leaf, eax, ebx, ecx, edx) \
- __asm("cpuid" \
+ __asm volatile("cpuid" \
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
: "a" (code), "c" (leaf));