6 typedef unsigned int reg32;
7 typedef unsigned short reg16;
19 } __attribute__((packed)) gp_regs;
29 } __attribute__((packed)) sg_reg;
32 cpu_get_brand(char* brand_out);
37 #pragma GCC diagnostic push
38 #pragma GCC diagnostic ignored "-Wreturn-type"
43 asm volatile("movl %%cr0,%0" : "=r" (val));
51 asm volatile("movl %%cr2,%0" : "=r" (val));
59 asm volatile("movl %%cr3,%0" : "=r" (val));
73 #pragma GCC diagnostic pop
78 asm("mov %0, %%cr0" ::"r"(v));
84 asm("mov %0, %%cr2" ::"r"(v));
90 asm("mov %0, %%cr3" ::"r"(v));
96 asm volatile("invlpg (%0)" ::"r"((uintptr_t)va) : "memory");
100 cpu_enable_interrupt()
106 cpu_disable_interrupt()
115 asm("movl %%cr3, %0\n"
122 cpu_rdmsr(uint32_t msr_idx, uint32_t* reg_high, uint32_t* reg_low);
125 cpu_wrmsr(uint32_t msr_idx, uint32_t reg_high, uint32_t reg_low);