X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=include%2Fasm-x86%2Fsmp_64.h;h=c46585e09ea1cd596e4c10f4a4cc3ba535acff23;hb=2ba95bcbe68d692f549fb10809f15681a25ff6fb;hp=e0a75519ad216e714a1d5430d183c2608dd1a3c4;hpb=70ec75c5b8e0bda7a16fb387f91e08545f379a0e;p=~andy%2Flinux diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h index e0a75519ad2..c46585e09ea 100644 --- a/include/asm-x86/smp_64.h +++ b/include/asm-x86/smp_64.h @@ -13,54 +13,20 @@ #include #include -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 u16 __initdata x86_cpu_to_apicid_init[]; -extern u16 __initdata x86_bios_cpu_apicid_init[]; -extern void *x86_cpu_to_apicid_early_ptr; -extern void *x86_bios_cpu_apicid_early_ptr; - -DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); -DECLARE_PER_CPU(cpumask_t, cpu_core_map); -DECLARE_PER_CPU(u16, cpu_llc_id); -DECLARE_PER_CPU(u16, x86_cpu_to_apicid); -DECLARE_PER_CPU(u16, x86_bios_cpu_apicid); - -static inline int cpu_present_to_apicid(int mps_cpu) -{ - if (cpu_present(mps_cpu)) - return (int)per_cpu(x86_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; \ }) @@ -73,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 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