Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/amd64/sys/amd64_get_gsbase.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
amd64_get_gsbase_syscall(void **addr) | amd64_get_gsbase_syscall(void **addr) | ||||
{ | { | ||||
return (sysarch(AMD64_GET_GSBASE, addr)); | return (sysarch(AMD64_GET_GSBASE, addr)); | ||||
} | } | ||||
DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) | DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **)) | ||||
{ | { | ||||
if (__getosreldate() >= P_OSREL_WRFSBASE && | if (__getosreldate() >= P_OSREL_WRFSBASE && | ||||
(cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) | (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) | ||||
return (amd64_get_gsbase_cpu); | return (amd64_get_gsbase_cpu); | ||||
return (amd64_get_gsbase_syscall); | return (amd64_get_gsbase_syscall); | ||||
} | } |