This source file includes following definitions.
- ia64_get_lid
- cpu_logical_id
- min_xtp
- normal_xtp
- max_xtp
1
2
3
4
5
6
7
8
9
10
11 #ifndef _ASM_IA64_SMP_H
12 #define _ASM_IA64_SMP_H
13
14 #include <linux/init.h>
15 #include <linux/threads.h>
16 #include <linux/kernel.h>
17 #include <linux/cpumask.h>
18 #include <linux/bitops.h>
19 #include <linux/irqreturn.h>
20
21 #include <asm/io.h>
22 #include <asm/param.h>
23 #include <asm/processor.h>
24 #include <asm/ptrace.h>
25
26 static inline unsigned int
27 ia64_get_lid (void)
28 {
29 union {
30 struct {
31 unsigned long reserved : 16;
32 unsigned long eid : 8;
33 unsigned long id : 8;
34 unsigned long ignored : 32;
35 } f;
36 unsigned long bits;
37 } lid;
38
39 lid.bits = ia64_getreg(_IA64_REG_CR_LID);
40 return lid.f.id << 8 | lid.f.eid;
41 }
42
43 #define hard_smp_processor_id() ia64_get_lid()
44
45 #ifdef CONFIG_SMP
46
47 #define XTP_OFFSET 0x1e0008
48
49 #define SMP_IRQ_REDIRECTION (1 << 0)
50 #define SMP_IPI_REDIRECTION (1 << 1)
51
52 #define raw_smp_processor_id() (current_thread_info()->cpu)
53
54 extern struct smp_boot_data {
55 int cpu_count;
56 int cpu_phys_id[NR_CPUS];
57 } smp_boot_data __initdata;
58
59 extern char no_int_routing;
60
61 extern cpumask_t cpu_core_map[NR_CPUS];
62 DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map);
63 extern int smp_num_siblings;
64 extern void __iomem *ipi_base_addr;
65 extern unsigned char smp_int_redirect;
66
67 extern volatile int ia64_cpu_to_sapicid[];
68 #define cpu_physical_id(i) ia64_cpu_to_sapicid[i]
69
70 extern unsigned long ap_wakeup_vector;
71
72
73
74
75
76 static inline int
77 cpu_logical_id (int cpuid)
78 {
79 int i;
80
81 for (i = 0; i < NR_CPUS; ++i)
82 if (cpu_physical_id(i) == cpuid)
83 break;
84 return i;
85 }
86
87
88
89
90
91
92
93
94 static inline void
95 min_xtp (void)
96 {
97 if (smp_int_redirect & SMP_IRQ_REDIRECTION)
98 writeb(0x00, ipi_base_addr + XTP_OFFSET);
99 }
100
101 static inline void
102 normal_xtp (void)
103 {
104 if (smp_int_redirect & SMP_IRQ_REDIRECTION)
105 writeb(0x08, ipi_base_addr + XTP_OFFSET);
106 }
107
108 static inline void
109 max_xtp (void)
110 {
111 if (smp_int_redirect & SMP_IRQ_REDIRECTION)
112 writeb(0x0f, ipi_base_addr + XTP_OFFSET);
113 }
114
115
116 extern int __cpu_disable (void);
117 extern void __cpu_die (unsigned int cpu);
118 extern void cpu_die (void) __attribute__ ((noreturn));
119 extern void __init smp_build_cpu_map(void);
120
121 extern void __init init_smp_config (void);
122 extern void smp_do_timer (struct pt_regs *regs);
123
124 extern irqreturn_t handle_IPI(int irq, void *dev_id);
125 extern void smp_send_reschedule (int cpu);
126 extern void identify_siblings (struct cpuinfo_ia64 *);
127 extern int is_multithreading_enabled(void);
128
129 extern void arch_send_call_function_single_ipi(int cpu);
130 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
131
132 #else
133
134 #define cpu_logical_id(i) 0
135 #define cpu_physical_id(i) ia64_get_lid()
136
137 #endif
138 #endif