diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-29 01:28:58 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-29 01:28:58 -0400 |
commit | 6b6133186d9eb1fb076e63013b1ed3bdaebea973 (patch) | |
tree | 5b7a7367f6a7ee3ae99a733740db470bc9d8c365 /sys/include/arch/amd64/asm.h | |
parent | 3f6a668013d3c5b18d11ad5f10b1b56ff74d9424 (diff) |
kernel/amd64: Facilitate IA32_FS_BASE reads/writes
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/asm.h')
-rw-r--r-- | sys/include/arch/amd64/asm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/asm.h b/sys/include/arch/amd64/asm.h index e85dd87..04d5e42 100644 --- a/sys/include/arch/amd64/asm.h +++ b/sys/include/arch/amd64/asm.h @@ -70,6 +70,18 @@ amd64_read_gs_base(void) return rdmsr(IA32_KERNEL_GS_BASE); } +static inline void +amd64_write_fs_base(uintptr_t val) +{ + wrmsr(IA32_FS_BASE, val); +} + +static inline uintptr_t +amd64_read_fs_base(uintptr_t val) +{ + return rdmsr(IA32_FS_BASE); +} + static inline uint64_t amd64_read_cr0(void) { |