Browse Source

register header

master
Mathieu Serandour 1 year ago
parent
commit
9365fa785c
  1. 15
      kernel/registers.h
  2. 9
      kernel/regs.h
  3. 2
      kernel/regs.s

15
kernel/registers.h

@ -10,6 +10,12 @@ u16 _es(void);
u16 _fs(void);
u16 _gs(void);
uint64_t get_rflags(void);
uint64_t get_cr0(void);
uint64_t _cr2(void);
uint64_t _cr3(void);
uint64_t get_cr4(void);
u16 set_cs(void);
u16 set_ds(void);
@ -18,4 +24,13 @@ u16 set_es(void);
u16 set_fs(void);
u16 set_gs(void);
void set_rflags(void);
void set_cr0(void);
void set_cr4(void);
uint64_t read_msr(uint32_t addr);
uint64_t write_msr(uint32_t addr, uint64_t value);
#endif// REGISTERS_H

9
kernel/regs.h

@ -1,9 +0,0 @@
#pragma once
#include <stdint.h>
uint64_t _ds(void);
uint64_t _ss(void);
uint64_t _cs(void);
uint64_t _es(void);
uint64_t _fs(void);
uint64_t _gs(void);

2
kernel/regs.s

@ -136,7 +136,7 @@ read_msr:
ret
; read_msr(uint32_t addr, uint64_t value)
; write_msr(uint32_t addr, uint64_t value)
write_msr:
push rbp
mov rbp, rsp

Loading…
Cancel
Save