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));
97 cpu_flush_page(ptr_t va)
99 asm volatile("invlpg (%0)" ::"r"(va) : "memory");
105 asm("movl %%cr3, %%eax\n"
106 "movl %%eax, %%cr3" ::
111 cpu_enable_interrupt()
117 cpu_disable_interrupt()
132 asm volatile("movl %%cr2,%0" : "=r"(val));
136 #endif /* __LUNAIX_CPU_H */