6 typedef unsigned int reg32;
7 typedef unsigned short reg16;
19 } __attribute__((packed)) gp_regs;
27 } __attribute__((packed)) sg_reg;
30 cpu_get_brand(char* brand_out);
35 #pragma GCC diagnostic push
36 #pragma GCC diagnostic ignored "-Wreturn-type"
41 asm volatile("movl %%cr0,%0" : "=r"(val));
49 asm volatile("movl %%cr2,%0" : "=r"(val));
57 asm volatile("movl %%cr3,%0" : "=r"(val));
65 asm volatile("pushf\n"
70 #pragma GCC diagnostic pop
75 asm("mov %0, %%cr0" ::"r"(v));
81 asm("mov %0, %%cr2" ::"r"(v));
87 asm("mov %0, %%cr3" ::"r"(v));
93 asm volatile("invlpg (%0)" ::"r"((uintptr_t)va) : "memory");
97 cpu_enable_interrupt()
103 cpu_disable_interrupt()
112 asm("movl %%cr3, %0\n"
119 cpu_rdmsr(uint32_t msr_idx, uint32_t* reg_high, uint32_t* reg_low);
122 cpu_wrmsr(uint32_t msr_idx, uint32_t reg_high, uint32_t reg_low);