4 extern cpumask_t cpu_initialized;
5 extern cpumask_t cpu_callin_map;
7 extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
12 #define raw_smp_processor_id() read_pda(cpunumber)
14 #define stack_smp_processor_id() \
16 struct thread_info *ti; \
17 asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \
22 * On x86 all CPUs are mapped 1:1 to the APIC space. This simplifies
23 * scheduling and IPI sending and compresses data structures.
25 static inline int num_booting_cpus(void)
27 return cpus_weight(cpu_callout_map);
30 #define safe_smp_processor_id() smp_processor_id()
31 #else /* CONFIG_SMP */
32 #define stack_smp_processor_id() 0
33 #define safe_smp_processor_id() 0
34 #endif /* !CONFIG_SMP */