mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
- Moved MSR code to separate files with an enum class - Implemented syscall_enable in C++ using new MSR calls
28 lines
585 B
C
28 lines
585 B
C
#pragma once
|
|
/// \file msr.h
|
|
/// Routines and definitions for dealing with Model-Specific Registers
|
|
|
|
#include <stdint.h>
|
|
|
|
enum class msr : uint32_t
|
|
{
|
|
ia32_efer = 0xc0000080,
|
|
ia32_star = 0xc0000081,
|
|
ia32_lstar = 0xc0000082,
|
|
ia32_fmask = 0xc0000084,
|
|
|
|
ia32_gs_base = 0xc0000101,
|
|
ia32_kernel_gs_base = 0xc0000102
|
|
};
|
|
|
|
/// Read the value of a MSR
|
|
/// \arg addr The MSR address
|
|
/// \returns The current value of the MSR
|
|
uint64_t rdmsr(msr addr);
|
|
|
|
/// Write to a MSR
|
|
/// \arg addr The MSR address
|
|
/// \arg value The value to write
|
|
void wrmsr(msr addr, uint64_t value);
|
|
|