refactor: decouple i386 specific instruction invocation
[lunaix-os.git] / lunaix-os / includes / hal / cpu.h
1 #ifndef __LUNAIX_CPU_H
2 #define __LUNAIX_CPU_H
3
4 #include <lunaix/types.h>
5
6 /**
7  * @brief Get processor ID string
8  *
9  * @param id_out
10  */
11 void
12 cpu_get_id(char* id_out);
13
14 /**
15  * @brief Load current processor state
16  *
17  * @return u32_t
18  */
19 u32_t
20 cpu_ldstate();
21
22 /**
23  * @brief Load current processor config
24  *
25  * @return u32_t
26  */
27 u32_t
28 cpu_ldconfig();
29
30 /**
31  * @brief Change current processor state
32  *
33  * @return u32_t
34  */
35 void
36 cpu_chconfig(u32_t val);
37
38 /**
39  * @brief Load current virtual memory space
40  *
41  * @return u32_t
42  */
43 u32_t
44 cpu_ldvmspace();
45
46 /**
47  * @brief Change current virtual memory space
48  *
49  * @return u32_t
50  */
51 void
52 cpu_chvmspace(u32_t val);
53
54 /**
55  * @brief Flush TLB
56  *
57  * @return u32_t
58  */
59 void
60 cpu_flush_page(ptr_t va);
61
62 void
63 cpu_flush_vmspace();
64
65 void
66 cpu_enable_interrupt();
67
68 void
69 cpu_disable_interrupt();
70
71 void
72 cpu_trap_sched();
73
74 void
75 cpu_trap_panic(char* message);
76
77 void
78 cpu_wait();
79
80 ptr_t
81 cpu_ldeaddr();
82
83 #endif /* __LUNAIX_CPU_H */