summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-04-18 05:47:56 +0000
committerjeff <jeff@FreeBSD.org>2008-04-18 05:47:56 +0000
commitb82673ba4013eb3ba1119759eae545aea4599a33 (patch)
tree20907530b877615853105653b47e518194e874d0 /sys/i386/include/cpufunc.h
parent710f14abddab8d6ceeac136f46a2ac3a2550461d (diff)
downloadFreeBSD-src-b82673ba4013eb3ba1119759eae545aea4599a33.zip
FreeBSD-src-b82673ba4013eb3ba1119759eae545aea4599a33.tar.gz
- Add inlines for the monitor and mwait instructions.
Sponsored by: Nokia
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r--sys/i386/include/cpufunc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index f3f6715..85b3f3d 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -106,6 +106,19 @@ enable_intr(void)
__asm __volatile("sti");
}
+static inline void
+cpu_monitor(const void *addr, int extensions, int hints)
+{
+ __asm __volatile("monitor;"
+ : :"a" (addr), "c" (extensions), "d"(hints));
+}
+
+static inline void
+cpu_mwait(int extensions, int hints)
+{
+ __asm __volatile("mwait;" : :"a" (hints), "c" (extensions));
+}
+
#ifdef _KERNEL
#define HAVE_INLINE_FFS
OpenPOWER on IntegriCloud