- Add inlines for the monitor and mwait instructions.
Sponsored by: Nokia
This commit is contained in:
parent
6bdf667b51
commit
66247efa5a
@ -514,6 +514,19 @@ load_es(u_int sel)
|
|||||||
__asm __volatile("movl %0,%%es" : : "rm" (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
|
#ifdef _KERNEL
|
||||||
/* This is defined in <machine/specialreg.h> but is too painful to get to */
|
/* This is defined in <machine/specialreg.h> but is too painful to get to */
|
||||||
#ifndef MSR_FSBASE
|
#ifndef MSR_FSBASE
|
||||||
|
@ -106,6 +106,19 @@ enable_intr(void)
|
|||||||
__asm __volatile("sti");
|
__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
|
#ifdef _KERNEL
|
||||||
|
|
||||||
#define HAVE_INLINE_FFS
|
#define HAVE_INLINE_FFS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user