4 #include <lunaix/types.h>
7 * @brief Get processor ID string
12 cpu_get_id(char* id_out);
18 cpu_trap_panic(char* message);
24 asm("movl %%ebp, %0" : "=r"(val)::);
29 * @brief Load current processor state
37 asm volatile("pushf\n"
44 * @brief Load current processor config
52 asm volatile("movl %%cr0,%0" : "=r"(val));
57 * @brief Change current processor state
62 cpu_chconfig(u32_t val)
64 asm("mov %0, %%cr0" ::"r"(val));
68 * @brief Load current virtual memory space
76 asm volatile("movl %%cr3,%0" : "=r"(val));
81 * @brief Change current virtual memory space
86 cpu_chvmspace(u32_t val)
88 asm("mov %0, %%cr3" ::"r"(val));
92 * @brief Flush a certain TLB record
97 cpu_flush_page(ptr_t va)
99 asm volatile("invlpg (%0)" ::"r"(va) : "memory");
103 * @brief Flush entire TLB
109 asm("movl %%cr3, %%eax\n"
110 "movl %%eax, %%cr3" ::
115 cpu_enable_interrupt()
121 cpu_disable_interrupt()
133 * @brief Read exeception address
141 asm volatile("movl %%cr2,%0" : "=r"(val));
145 #endif /* __LUNAIX_CPU_H */