test
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <zinnia/errno.h>
|
||||
#include <uapi/archctl.h>
|
||||
#include <x86_64/asm.h>
|
||||
#include <x86_64/defs.h>
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user