mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Correct cpu_monitor() and cpu_mwait() for amd64. These instructions take
%rcx as "extensions" in long mode. If any unused bit is set in %rcx, these instructions cause general protection fault. Fix style nits and synchronize i386 with amd64.
This commit is contained in:
parent
2e569926f8
commit
f0b28f005e
2 changed files with 14 additions and 10 deletions
|
|
@ -467,16 +467,18 @@ load_es(u_short sel)
|
|||
}
|
||||
|
||||
static __inline void
|
||||
cpu_monitor(const void *addr, int extensions, int hints)
|
||||
cpu_monitor(const void *addr, u_long extensions, u_int hints)
|
||||
{
|
||||
__asm __volatile("monitor;"
|
||||
: :"a" (addr), "c" (extensions), "d"(hints));
|
||||
|
||||
__asm __volatile("monitor"
|
||||
: : "a" (addr), "c" (extensions), "d" (hints));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
cpu_mwait(int extensions, int hints)
|
||||
cpu_mwait(u_long extensions, u_int hints)
|
||||
{
|
||||
__asm __volatile("mwait;" : :"a" (hints), "c" (extensions));
|
||||
|
||||
__asm __volatile("mwait" : : "a" (hints), "c" (extensions));
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
|
|
|||
|
|
@ -133,16 +133,18 @@ enable_intr(void)
|
|||
}
|
||||
|
||||
static __inline void
|
||||
cpu_monitor(const void *addr, int extensions, int hints)
|
||||
cpu_monitor(const void *addr, u_long extensions, u_int hints)
|
||||
{
|
||||
__asm __volatile("monitor;"
|
||||
: :"a" (addr), "c" (extensions), "d"(hints));
|
||||
|
||||
__asm __volatile("monitor"
|
||||
: : "a" (addr), "c" (extensions), "d" (hints));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
cpu_mwait(int extensions, int hints)
|
||||
cpu_mwait(u_long extensions, u_int hints)
|
||||
{
|
||||
__asm __volatile("mwait;" : :"a" (hints), "c" (extensions));
|
||||
|
||||
__asm __volatile("mwait" : : "a" (hints), "c" (extensions));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
|
|
|
|||
Loading…
Reference in a new issue