x86: provide hlt_works function.
authorGlauber Costa <gcosta@redhat.com>
Mon, 3 Mar 2008 17:12:48 +0000 (14:12 -0300)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:40:55 +0000 (17:40 +0200)
In x86_64, hlt always work. in i386, we'll query the cpuinfo associated
with this cpu

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/asm-x86/processor.h

index 9054734589fe390b9d3061a9b429785869038e52..8bec23c15527e2dbd52b181912d89f9dd6101f77 100644 (file)
@@ -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);