X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/c1811aecaae88bc006ce20bd301a6519dd89abda..7804c2dae30700296c3205aaf7f546f491999bf4:/lunaix-os/includes/hal/cpu.h diff --git a/lunaix-os/includes/hal/cpu.h b/lunaix-os/includes/hal/cpu.h index af8863e..c68bb95 100644 --- a/lunaix-os/includes/hal/cpu.h +++ b/lunaix-os/includes/hal/cpu.h @@ -1,36 +1,83 @@ #ifndef __LUNAIX_CPU_H #define __LUNAIX_CPU_H -typedef unsigned int reg32; -typedef unsigned short reg16; +#include -typedef struct { - reg32 edi; - reg32 esi; - reg32 ebp; - reg32 esp; - reg32 ebx; - reg32 edx; - reg32 ecx; - reg32 eax; -} __attribute__((packed)) registers; +/** + * @brief Get processor ID string + * + * @param id_out + */ +void +cpu_get_id(char* id_out); -reg32 cpu_r_cr0(); +/** + * @brief Load current processor state + * + * @return u32_t + */ +u32_t +cpu_ldstate(); -reg32 cpu_r_cr2(); +/** + * @brief Load current processor config + * + * @return u32_t + */ +u32_t +cpu_ldconfig(); -reg32 cpu_r_cr3(); +/** + * @brief Change current processor state + * + * @return u32_t + */ +void +cpu_chconfig(u32_t val); -void cpu_w_cr0(reg32 v); +/** + * @brief Load current virtual memory space + * + * @return u32_t + */ +u32_t +cpu_ldvmspace(); -void cpu_w_cr2(reg32 v); +/** + * @brief Change current virtual memory space + * + * @return u32_t + */ +void +cpu_chvmspace(u32_t val); -void cpu_w_cr3(reg32 v); +/** + * @brief Flush TLB + * + * @return u32_t + */ +void +cpu_flush_page(ptr_t va); -void cpu_get_model(char* model_out); +void +cpu_flush_vmspace(); -int cpu_brand_string_supported(); +void +cpu_enable_interrupt(); -void cpu_get_brand(char* brand_out); +void +cpu_disable_interrupt(); + +void +cpu_trap_sched(); + +void +cpu_trap_panic(char* message); + +void +cpu_wait(); + +ptr_t +cpu_ldeaddr(); #endif /* __LUNAIX_CPU_H */