x86: Centaur Isaiah processor to use sysenter in 64-bit compatibility mode rather...
[linux-2.6/mini2440.git] / include / asm-x86 / smp_64.h
blobc53a011bb91c42512ae005bebc6951463f6a3ce7
1 #ifndef __ASM_SMP_H
2 #define __ASM_SMP_H
4 #include <linux/cpumask.h>
5 #include <linux/init.h>
7 /*
8 * We need the APIC definitions automatically as part of 'smp.h'
9 */
10 #include <asm/apic.h>
11 #include <asm/io_apic.h>
12 #include <asm/mpspec.h>
13 #include <asm/pda.h>
14 #include <asm/thread_info.h>
16 extern cpumask_t cpu_initialized;
17 extern cpumask_t cpu_callin_map;
19 extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
20 void *info, int wait);
22 #ifdef CONFIG_SMP
24 #define raw_smp_processor_id() read_pda(cpunumber)
26 #define stack_smp_processor_id() \
27 ({ \
28 struct thread_info *ti; \
29 asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \
30 ti->cpu; \
34 * On x86 all CPUs are mapped 1:1 to the APIC space. This simplifies
35 * scheduling and IPI sending and compresses data structures.
37 static inline int num_booting_cpus(void)
39 return cpus_weight(cpu_callout_map);
42 #else /* CONFIG_SMP */
43 #define stack_smp_processor_id() 0
45 #endif /* !CONFIG_SMP */
47 #define safe_smp_processor_id() smp_processor_id()
49 static inline int logical_smp_processor_id(void)
51 /* we don't want to mark this access volatile - bad code generation */
52 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
55 #include <mach_apicdef.h>
56 static inline int hard_smp_processor_id(void)
58 /* we don't want to mark this access volatile - bad code generation */
59 return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
62 #endif