From: Glauber Costa Date: Mon, 3 Mar 2008 17:12:48 +0000 (-0300) Subject: x86: provide hlt_works function. X-Git-Tag: v2.6.26-rc1~1154^2~466 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d3f487c58ef1ece714af280b29411960908149c;p=linux-2.6 x86: provide hlt_works function. In x86_64, hlt always work. in i386, we'll query the cpuinfo associated with this cpu Signed-off-by: Glauber Costa Signed-off-by: Ingo Molnar --- diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 9054734589..8bec23c155 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h @@ -144,6 +144,15 @@ DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); #define current_cpu_data boot_cpu_data #endif +static inline int hlt_works(int cpu) +{ +#ifdef CONFIG_X86_32 + return cpu_data(cpu).hlt_works_ok; +#else + return 1; +#endif +} + #define cache_line_size() (boot_cpu_data.x86_cache_alignment) extern void cpu_detect(struct cpuinfo_x86 *c);