#include #include #include #include errno_t arch_archctl(uintptr_t op, uintptr_t arg) { switch (op) { case __ARCHCTL_SET_FSBASE: asm_wrmsr(MSR_FS_BASE, arg); return 0; case __ARCHCTL_SET_GSBASE: // Update the inactive GSBASE MSR, not ours. asm_wrmsr(MSR_KERNEL_GS_BASE, arg); return 0; default: return EINVAL; } }