vserver 1.9.3
[linux-2.6.git] / include / asm-x86_64 / smp.h
index c210e39..03841be 100644 (file)
@@ -110,9 +110,13 @@ static inline int cpu_present_to_apicid(int mps_cpu)
 
 #endif
 #define INT_DELIVERY_MODE 1     /* logical delivery */
-#define TARGET_CPUS 1
 
 #ifndef ASSEMBLY
+#ifdef CONFIG_SMP
+#define TARGET_CPUS cpu_online_map
+#else
+#define TARGET_CPUS cpumask_of_cpu(0)
+#endif
 static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
        return cpus_addr(cpumask)[0];
@@ -133,5 +137,13 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 })
 #endif
 
+#ifndef __ASSEMBLY__
+static __inline int logical_smp_processor_id(void)
+{
+       /* we don't want to mark this access volatile - bad code generation */
+       return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
+}
+#endif
+
 #endif