refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <zinnia/archctl.h>
|
||||
#include <zinnia/status.h>
|
||||
#include <common/compiler.h>
|
||||
#include <kernel/arch.h>
|
||||
#include <kernel/init.h>
|
||||
#include <kernel/percpu.h>
|
||||
#include <x86_64/apic.h>
|
||||
@@ -9,7 +10,7 @@
|
||||
#include <x86_64/gdt.h>
|
||||
|
||||
[[__init, __naked, __used]]
|
||||
void _start() {
|
||||
void arch_start() {
|
||||
asm volatile(
|
||||
"lea rsp, [rip + %0]\n"
|
||||
"jmp %1"
|
||||
@@ -25,6 +26,10 @@ zn_status_t arch_archctl(zn_archctl_t op, uintptr_t arg) {
|
||||
case ZN_ARCHCTL_SET_FSBASE:
|
||||
asm_wrmsr(MSR_FS_BASE, arg);
|
||||
return 0;
|
||||
case ZN_ARCHCTL_SET_GSBASE:
|
||||
// Slightly misleading, but KERNEL_GS_BASE is the currently inactive register.
|
||||
asm_wrmsr(MSR_KERNEL_GS_BASE, arg);
|
||||
return 0;
|
||||
default:
|
||||
return ZN_ERR_INVALID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user