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.
22 lines
326 B
C
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
|