From 030243f200cd23e98a0d441cb19fdb61bc7c2709 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 7 Apr 2011 20:30:23 +0200 Subject: [PATCH] introduce the hlt instruction --- arch/x86/include/asm/processor.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 27294236..63c5b08c 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -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) {