diff options
author | jeff <jeff@FreeBSD.org> | 2008-04-18 05:47:56 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-04-18 05:47:56 +0000 |
commit | b82673ba4013eb3ba1119759eae545aea4599a33 (patch) | |
tree | 20907530b877615853105653b47e518194e874d0 /sys/amd64/include | |
parent | 710f14abddab8d6ceeac136f46a2ac3a2550461d (diff) | |
download | FreeBSD-src-b82673ba4013eb3ba1119759eae545aea4599a33.zip FreeBSD-src-b82673ba4013eb3ba1119759eae545aea4599a33.tar.gz |
- Add inlines for the monitor and mwait instructions.
Sponsored by: Nokia
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/cpufunc.h | 13 |
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 |