summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/cpufunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64/include/cpufunc.h')
-rw-r--r--sys/arch/amd64/include/cpufunc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/amd64/include/cpufunc.h b/sys/arch/amd64/include/cpufunc.h
index 23f1d51d6b9..b5eeacaec53 100644
--- a/sys/arch/amd64/include/cpufunc.h
+++ b/sys/arch/amd64/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.11 2014/03/29 18:09:28 guenther Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.12 2015/03/21 20:42:38 kettenis Exp $ */
/* $NetBSD: cpufunc.h,v 1.3 2003/05/08 10:27:43 fvdl Exp $ */
/*-
@@ -309,6 +309,16 @@ mwait(u_long extensions, u_int hints)
__asm volatile("mwait" : : "a" (hints), "c" (extensions));
}
+static __inline void
+xsetbv(uint32_t reg, uint64_t mask)
+{
+ uint32_t lo, hi;
+
+ lo = mask;
+ hi = mask >> 32;
+ __asm volatile("xsetbv" :: "c" (reg), "a" (lo), "d" (hi) : "memory");
+}
+
/* Break into DDB/KGDB. */
static __inline void
breakpoint(void)