4 #include <lunaix/types.h>
7 * @brief Get processor ID string
12 cpu_get_id(char* id_out);
18 cpu_trap_panic(char* message);
22 * @brief Load current processor state
30 asm volatile("pushf\n"
37 * @brief Load current processor config
45 asm volatile("movl %%cr0,%0" : "=r"(val));
50 * @brief Change current processor state
55 cpu_chconfig(u32_t val)
57 asm("mov %0, %%cr0" ::"r"(val));
61 * @brief Load current virtual memory space
69 asm volatile("movl %%cr3,%0" : "=r"(val));
74 * @brief Change current virtual memory space
79 cpu_chvmspace(u32_t val)
81 asm("mov %0, %%cr3" ::"r"(val));
85 * @brief Flush a certain TLB record
90 cpu_flush_page(ptr_t va)
92 asm volatile("invlpg (%0)" ::"r"(va) : "memory");
96 * @brief Flush entire TLB
102 asm("movl %%cr3, %%eax\n"
103 "movl %%eax, %%cr3" ::
108 cpu_enable_interrupt()
114 cpu_disable_interrupt()
126 * @brief Read exeception address
134 asm volatile("movl %%cr2,%0" : "=r"(val));
138 #endif /* __LUNAIX_CPU_H */