Files
mango/arch/x86_64/include/arch/msr.h
Max Wash dbe117135b x86_64: implement proper user/kernel %gs base switching
the %gs base address is now always set to the current cpu block while
in kernel-mode, and is switched back to the userspace %gs base
when returning to user-mode.
2026-02-23 18:26:21 +00:00

22 lines
326 B
C

#ifndef ARCH_MSR_H_
#define ARCH_MSR_H_
#include <stdint.h>
#define MSR_GS_BASE 0xC0000101
#define MSR_KERNEL_GS_BASE 0xC0000102
#ifdef __cplusplus
extern "C" {
#endif
/* defined in cpu_ctrl.S */
extern uint64_t rdmsr(uint32_t id);
extern void wrmsr(uint32_t id, uint64_t val);
#ifdef __cplusplus
}
#endif
#endif