Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
msr.h File Reference
#include <type.h>

Go to the source code of this file.

Macros

#define MSR_STAR   0xC0000081
 
#define MSR_LSTAR   0xC0000082
 
#define MSR_FMASK   0xC0000084
 
#define MSR_EFER   0xC0000080
 
#define MSR_FS_BASE   0xC0000100
 
#define MSR_GS_BASE   0xC0000101
 
#define MSR_KERNEL_GS_BASE   0xC0000102
 

Functions

void vxWRSR (uint32_t msr, uint64_t value)
 
uint64_t vxRDMSR (uint32_t msr)
 
void msrSetFSBase (uint64_t base)
 
void msrSetGSBase (uint64_t base)
 
void msrSetKernelGSBase (uint64_t base)
 
uintptr_t msrReadGSBase ()
 
uintptr_t msrReadFSBase ()
 
uintptr_t msrReadKernelGSBase ()
 

Macro Definition Documentation

◆ MSR_EFER

#define MSR_EFER   0xC0000080

Definition at line 9 of file msr.h.

Referenced by syscall_init().

◆ MSR_FMASK

#define MSR_FMASK   0xC0000084

Definition at line 8 of file msr.h.

Referenced by syscall_init().

◆ MSR_FS_BASE

#define MSR_FS_BASE   0xC0000100

Definition at line 10 of file msr.h.

Referenced by msrReadFSBase(), and msrSetFSBase().

◆ MSR_GS_BASE

#define MSR_GS_BASE   0xC0000101

Definition at line 11 of file msr.h.

Referenced by msrReadGSBase(), and msrSetGSBase().

◆ MSR_KERNEL_GS_BASE

#define MSR_KERNEL_GS_BASE   0xC0000102

Definition at line 12 of file msr.h.

Referenced by msrReadKernelGSBase(), and msrSetKernelGSBase().

◆ MSR_LSTAR

#define MSR_LSTAR   0xC0000082

Definition at line 7 of file msr.h.

Referenced by syscall_init().

◆ MSR_STAR

#define MSR_STAR   0xC0000081

Definition at line 6 of file msr.h.

Referenced by syscall_init().

Function Documentation

◆ msrReadFSBase()

uintptr_t msrReadFSBase ( )

Definition at line 27 of file msr.c.

References MSR_FS_BASE, and vxRDMSR().

◆ msrReadGSBase()

uintptr_t msrReadGSBase ( )

Definition at line 31 of file msr.c.

References MSR_GS_BASE, and vxRDMSR().

Referenced by get_current_core_data().

◆ msrReadKernelGSBase()

uintptr_t msrReadKernelGSBase ( )

Definition at line 35 of file msr.c.

References MSR_KERNEL_GS_BASE, and vxRDMSR().

◆ msrSetFSBase()

void msrSetFSBase ( uint64_t base)

Definition at line 19 of file msr.c.

References base, MSR_FS_BASE, and vxWRSR().

Referenced by sch_restore_to_next_thread(), syscall_arch_prctl(), and vxSchedulerTick().

◆ msrSetGSBase()

void msrSetGSBase ( uint64_t base)

Definition at line 23 of file msr.c.

References base, MSR_GS_BASE, and vxWRSR().

Referenced by update_core_gs().

◆ msrSetKernelGSBase()

void msrSetKernelGSBase ( uint64_t base)

Definition at line 40 of file msr.c.

References base, MSR_KERNEL_GS_BASE, and vxWRSR().

Referenced by syscall_arch_prctl(), and update_core_gs().

◆ vxRDMSR()

◆ vxWRSR()

void vxWRSR ( uint32_t msr,
uint64_t value )