integrate C/LDFLAGS into LunaBuild flow
[lunaix-os.git] / lunaix-os / arch / i386 / includes / sys / cpu.h
index a4be798b698a777d89ed69b97b7875b36e095606..ca7080a028ce1a6db0a4fdc3233346df017880a0 100644 (file)
@@ -21,9 +21,9 @@ cpu_trap_panic(char* message);
 /**
  * @brief Load current processor state
  *
 /**
  * @brief Load current processor state
  *
- * @return u32_t
+ * @return reg_t
  */
  */
-static inline u32_t
+static inline reg_t
 cpu_ldstate()
 {
     ptr_t val;
 cpu_ldstate()
 {
     ptr_t val;
@@ -36,12 +36,12 @@ cpu_ldstate()
 /**
  * @brief Load current processor config
  *
 /**
  * @brief Load current processor config
  *
- * @return u32_t
+ * @return reg_t
  */
  */
-static inline u32_t
+static inline reg_t
 cpu_ldconfig()
 {
 cpu_ldconfig()
 {
-    ptr_t val;
+    reg_t val;
     asm volatile("movl %%cr0,%0" : "=r"(val));
     return val;
 }
     asm volatile("movl %%cr0,%0" : "=r"(val));
     return val;
 }
@@ -49,61 +49,25 @@ cpu_ldconfig()
 /**
  * @brief Change current processor state
  *
 /**
  * @brief Change current processor state
  *
- * @return u32_t
+ * @return reg_t
  */
 static inline void
  */
 static inline void
-cpu_chconfig(u32_t val)
+cpu_chconfig(reg_t val)
 {
     asm("mov %0, %%cr0" ::"r"(val));
 }
 
 {
     asm("mov %0, %%cr0" ::"r"(val));
 }
 
-/**
- * @brief Load current virtual memory space
- *
- * @return u32_t
- */
-static inline u32_t
-cpu_ldvmspace()
-{
-    ptr_t val;
-    asm volatile("movl %%cr3,%0" : "=r"(val));
-    return val;
-}
-
 /**
  * @brief Change current virtual memory space
  *
 /**
  * @brief Change current virtual memory space
  *
- * @return u32_t
+ * @return reg_t
  */
 static inline void
  */
 static inline void
-cpu_chvmspace(u32_t val)
+cpu_chvmspace(reg_t val)
 {
     asm("mov %0, %%cr3" ::"r"(val));
 }
 
 {
     asm("mov %0, %%cr3" ::"r"(val));
 }
 
-/**
- * @brief Flush a certain TLB record
- *
- * @return u32_t
- */
-static inline void
-cpu_flush_page(ptr_t va)
-{
-    asm volatile("invlpg (%0)" ::"r"(va) : "memory");
-}
-
-/**
- * @brief Flush entire TLB
- *
- */
-static inline void
-cpu_flush_vmspace()
-{
-    asm("movl %%cr3, %%eax\n"
-        "movl %%eax, %%cr3" ::
-          : "eax");
-}
-
 static inline void
 cpu_enable_interrupt()
 {
 static inline void
 cpu_enable_interrupt()
 {