Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/cpufunc.h
Show First 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | |||||
static __inline void | static __inline void | ||||
cpu_mwait(u_long extensions, u_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 uint32_t | |||||
rdpkru(void) | |||||
{ | |||||
uint32_t res; | |||||
__asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); | |||||
return (res); | |||||
} | |||||
static __inline void | |||||
wrpkru(uint32_t mask) | |||||
{ | |||||
__asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); | |||||
} | |||||
#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 | ||||
#define MSR_FSBASE 0xc0000100 | #define MSR_FSBASE 0xc0000100 | ||||
#endif | #endif | ||||
static __inline void | static __inline void | ||||
load_fs(u_short sel) | load_fs(u_short sel) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 394 Lines • Show Last 20 Lines |