summaryrefslogtreecommitdiffstats
path: root/sys/amd64
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/amd64
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/amd64')
-rw-r--r--sys/amd64/include/cpufunc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 2c5fcb2..ac0db87 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -514,6 +514,19 @@ load_es(u_int sel)
__asm __volatile("movl %0,%%es" : : "rm" (sel));
}
+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
/* This is defined in <machine/specialreg.h> but is too painful to get to */
#ifndef MSR_FSBASE
OpenPOWER on IntegriCloud