git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restructure the interrupt vector distribution for better matching of their inherit...
[lunaix-os.git]
/
lunaix-os
/
includes
/
hal
/
cpu.h
diff --git
a/lunaix-os/includes/hal/cpu.h
b/lunaix-os/includes/hal/cpu.h
index 1a3173bb2771079c9c564aa9392b1aa75eb3d6aa..bdb07c467267c56aa911bf3f37795b10b0747fc1 100644
(file)
--- a/
lunaix-os/includes/hal/cpu.h
+++ b/
lunaix-os/includes/hal/cpu.h
@@
-31,6
+31,9
@@
typedef struct
void
cpu_get_brand(char* brand_out);
void
cpu_get_brand(char* brand_out);
+int
+cpu_has_apic();
+
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
static inline reg32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
static inline reg32
@@
-73,19
+76,19
@@
cpu_lcr3(reg32 v)
static inline void
cpu_invplg(void* va)
{
static inline void
cpu_invplg(void* va)
{
- asm("invlpg (%0)" ::"r"((uintptr_t)va) : "memory");
+ asm
volatile
("invlpg (%0)" ::"r"((uintptr_t)va) : "memory");
}
static inline void
cpu_enable_interrupt()
{
}
static inline void
cpu_enable_interrupt()
{
- asm("sti");
+ asm
volatile
("sti");
}
static inline void
cpu_disable_interrupt()
{
}
static inline void
cpu_disable_interrupt()
{
- asm("cli");
+ asm
volatile
("cli");
}
static inline void
}
static inline void
@@
-98,4
+101,10
@@
cpu_invtlb()
: "r"(interm));
}
: "r"(interm));
}
+void
+cpu_rdmsr(uint32_t msr_idx, uint32_t* reg_high, uint32_t* reg_low);
+
+void
+cpu_wrmsr(uint32_t msr_idx, uint32_t reg_high, uint32_t reg_low);
+
#endif
\ No newline at end of file
#endif
\ No newline at end of file