]> Pileus Git - ~andy/linux/blobdiff - include/asm-x86/smp_64.h
x86: provide bogus hard_smp_processor_id
[~andy/linux] / include / asm-x86 / smp_64.h
index 2feddda91e1277ec75b3a22bb43bd69e9ee379ad..c46585e09ea1cd596e4c10f4a4cc3ba535acff23 100644 (file)
 #include <asm/pda.h>
 #include <asm/thread_info.h>
 
-extern cpumask_t cpu_callout_map;
 extern cpumask_t cpu_initialized;
-
-extern int smp_num_siblings;
-extern unsigned int num_processors;
-
-extern void smp_alloc_memory(void);
-extern void lock_ipi_call_lock(void);
-extern void unlock_ipi_call_lock(void);
+extern cpumask_t cpu_callin_map;
 
 extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
                                  void *info, int wait);
 
-extern u8 __initdata x86_cpu_to_apicid_init[];
-extern void *x86_cpu_to_apicid_ptr;
-extern u8 bios_cpu_apicid[];
-
-DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
-DECLARE_PER_CPU(cpumask_t, cpu_core_map);
-DECLARE_PER_CPU(u8, cpu_llc_id);
-DECLARE_PER_CPU(u8, x86_cpu_to_apicid);
-
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (mps_cpu < NR_CPUS)
-               return (int)bios_cpu_apicid[mps_cpu];
-       else
-               return BAD_APICID;
-}
-
 #ifdef CONFIG_SMP
 
-#define SMP_TRAMPOLINE_BASE 0x6000
-
-extern int __cpu_disable(void);
-extern void __cpu_die(unsigned int cpu);
-extern void prefill_possible_map(void);
-extern unsigned __cpuinitdata disabled_cpus;
-
 #define raw_smp_processor_id() read_pda(cpunumber)
-#define cpu_physical_id(cpu)   per_cpu(x86_cpu_to_apicid, cpu)
 
 #define stack_smp_processor_id()                                       \
-       ({                                                              \
+({                                                                     \
        struct thread_info *ti;                                         \
-       __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK));      \
+       asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK));  \
        ti->cpu;                                                        \
 })
 
@@ -71,29 +39,39 @@ static inline int num_booting_cpus(void)
        return cpus_weight(cpu_callout_map);
 }
 
-extern void smp_send_reschedule(int cpu);
-
 #else /* CONFIG_SMP */
-
-extern unsigned int boot_cpu_id;
-#define cpu_physical_id(cpu)   boot_cpu_id
 #define stack_smp_processor_id() 0
 
 #endif /* !CONFIG_SMP */
 
 #define safe_smp_processor_id()                smp_processor_id()
 
-static __inline int logical_smp_processor_id(void)
+#ifdef CONFIG_X86_LOCAL_APIC
+
+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(*(u32 *)(APIC_BASE + APIC_LDR));
 }
 
+# ifdef APIC_DEFINITION
+extern int hard_smp_processor_id(void);
+# else
+#  include <mach_apicdef.h>
 static inline int hard_smp_processor_id(void)
 {
        /* we don't want to mark this access volatile - bad code generation */
        return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
 }
+# endif /* APIC_DEFINITION */
+
+#else /* CONFIG_X86_LOCAL_APIC */
+
+# ifndef CONFIG_SMP
+#  define hard_smp_processor_id()      0
+# endif
+
+#endif /* CONFIG_X86_LOCAL_APIC */
 
 #endif