Turnstone Operating System
Loading...
Searching...
No Matches
crx.h File Reference

defines crx registers detailed More...

#include <types.h>

Classes

union  cpu_reg_cr0_t
 
union  cpu_reg_cr4_u
 cr4 register bit fields More...
 

Macros

#define ___CPU_CRX_H   0
 
#define CPU_MSR_EFER   0xC0000080
 extended feature register
 
#define CPU_MSR_STAR   0xC0000081
 system call target address register
 
#define CPU_MSR_LSTAR   0xC0000082
 system call target address register
 
#define CPU_MSR_FMASK   0xC0000084
 system call rflags mask register
 
#define CPU_MSR_IA32_FS_BASE   0xC0000100
 fs base address
 
#define CPU_MSR_IA32_GS_BASE   0xC0000101
 gs base address
 
#define CPU_MSR_IA32_KERNEL_GS_BASE   0xC0000102
 kernel gs base address
 

Typedefs

typedef union cpu_reg_cr0_t cpu_reg_cr0_t
 shard hand for struct cpu_reg_cr0_s
 
typedef union cpu_reg_cr4_u cpu_reg_cr4_t
 short hand for union cpu_reg_cr4_u
 

Functions

 _Static_assert (sizeof(cpu_reg_cr4_t)==8, "cpu_reg_cr4_t size must be 8")
 
cpu_reg_cr4_t cpu_read_cr4 (void)
 reads cr4 register More...
 
void cpu_write_cr4 (cpu_reg_cr4_t cr4)
 writes cr4 register More...
 
cpu_reg_cr0_t cpu_read_cr0 (void)
 reads cr0 register More...
 
void cpu_write_cr0 (cpu_reg_cr0_t cr0)
 writes cr0 register More...
 
void cpu_toggle_cr0_wp (void)
 toggles write protect bit cr0, when setted kernel can not modify readonly pages
 
void cpu_cr0_disable_wp (void)
 disables write protect bit cr0, when setted kernel can not modify readonly pages
 
void cpu_cr0_enable_wp (void)
 enables write protect bit cr0, when setted kernel can not modify readonly pages
 
void cpu_enable_sse (void)
 enables sse support, modifies cr4 register
 

Detailed Description

defines crx registers detailed

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Macro Definition Documentation

◆ ___CPU_CRX_H

#define ___CPU_CRX_H   0

prevent duplicate header error macro

Function Documentation

◆ cpu_read_cr0()

cpu_reg_cr0_t cpu_read_cr0 ( void  )

reads cr0 register

Returns
cr0 value

◆ cpu_read_cr4()

cpu_reg_cr4_t cpu_read_cr4 ( void  )

reads cr4 register

Returns
cr4 value

◆ cpu_write_cr0()

void cpu_write_cr0 ( cpu_reg_cr0_t  cr0)

writes cr0 register

Parameters
[in]cr0cr0 value

◆ cpu_write_cr4()

void cpu_write_cr4 ( cpu_reg_cr4_t  cr4)

writes cr4 register

Parameters
[in]cr4cr4 value