introduce the hlt instruction
This commit is contained in:
parent
6b86f3c572
commit
030243f200
1 changed files with 5 additions and 12 deletions
|
@ -71,14 +71,6 @@ inline static void cpuid(uint32_t code, uint32_t* a, uint32_t* b, uint32_t* c, u
|
|||
asm volatile ("cpuid" : "=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d) : "0"(code));
|
||||
}
|
||||
|
||||
inline static void flush_pipeline(void) {
|
||||
uint32_t low = 0;
|
||||
uint32_t high = 0;
|
||||
uint32_t code = 0;
|
||||
|
||||
asm volatile ("cpuid" : "=a"(low), "=d"(high) : "0"(code) : "%ebx", "%ecx");
|
||||
}
|
||||
|
||||
inline static uint64_t rdmsr(uint32_t msr) {
|
||||
uint32_t low, high;
|
||||
|
||||
|
@ -135,10 +127,11 @@ static inline uint32_t read_eflags(void)
|
|||
|
||||
uint32_t read_eip(void);
|
||||
|
||||
#define NOP1 asm volatile ("nop")
|
||||
#define NOP2 asm volatile ("nop;nop")
|
||||
#define NOP4 asm volatile ("nop;nop;nop;nop")
|
||||
#define NOP8 asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop")
|
||||
#define NOP1 asm volatile ("nop")
|
||||
#define NOP2 asm volatile ("nop;nop")
|
||||
#define NOP4 asm volatile ("nop;nop;nop;nop")
|
||||
#define NOP8 asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop")
|
||||
#define HALT asm volatile ("hlt");
|
||||
|
||||
inline static int system_init(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue