11 #include <linux/sched.h>
14 #include <asm/cacheflush.h>
15 #include <asm/switch_to.h>
16 #include <asm/tlbflush.h>
17 #include <asm/timer.h>
18 #include <asm/oplib.h>
23 #define IRQ_IPI_SINGLE 12
24 #define IRQ_IPI_MASK 13
25 #define IRQ_IPI_RESCHED 14
26 #define IRQ_CROSS_CALL 15
28 static inline unsigned long
29 swap_ulong(
volatile unsigned long *
ptr,
unsigned long val)
31 __asm__ __volatile__(
"swap [%1], %0\n\t" :
32 "=&r" (val),
"=&r" (ptr) :
33 "0" (val),
"1" (ptr));
41 local_ops->cache_all();
44 notify_cpu_starting(cpuid);
46 register_percpu_ce(cpuid);
51 local_ops->cache_all();
64 local_ops->cache_all();
68 __asm__ __volatile__(
"ld [%0], %%g6\n\t"
90 local_ops->cache_all();
95 unsigned long *
entry = &sun4m_cpu_startup;
103 entry += ((i - 1) * 3);
116 local_ops->cache_all();
120 for (timeout = 0; timeout < 10000; timeout++) {
131 local_ops->cache_all();
148 local_ops->cache_all();
153 static void sun4m_send_ipi(
int cpu,
int level)
158 static void sun4m_ipi_resched(
int cpu)
163 static void sun4m_ipi_single(
int cpu)
168 static void sun4m_ipi_mask_one(
int cpu)
173 static struct smp_funcall {
188 unsigned long arg2,
unsigned long arg3,
191 register int ncpus = SUN4M_NCPUS;
197 ccall_info.func =
func;
198 ccall_info.arg1 =
arg1;
199 ccall_info.arg2 =
arg2;
200 ccall_info.arg3 =
arg3;
201 ccall_info.arg4 =
arg4;
209 cpumask_and(&mask, cpu_online_mask, &mask);
210 for (i = 0; i <
ncpus; i++) {
212 ccall_info.processors_in[
i] = 0;
213 ccall_info.processors_out[
i] = 0;
216 ccall_info.processors_in[
i] = 1;
217 ccall_info.processors_out[
i] = 1;
229 while (!ccall_info.processors_in[i])
231 }
while (++i < ncpus);
237 while (!ccall_info.processors_out[i])
239 }
while (++i < ncpus);
241 spin_unlock_irqrestore(&cross_call_lock, flags);
249 ccall_info.processors_in[
i] = 1;
250 ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3,
251 ccall_info.arg4, ccall_info.arg5);
252 ccall_info.processors_out[
i] = 1;
258 struct clock_event_device *
ce;
261 old_regs = set_irq_regs(regs);
263 ce = &
per_cpu(sparc32_clockevent, cpu);
265 if (ce->mode & CLOCK_EVT_MODE_PERIODIC)
271 ce->event_handler(ce);
274 set_irq_regs(old_regs);
278 .cross_call = sun4m_cross_call,
279 .resched = sun4m_ipi_resched,
280 .single = sun4m_ipi_single,
281 .mask_one = sun4m_ipi_mask_one,