1 #include <linux/types.h>
4 #include <hwregs/intr_vect.h>
5 #include <hwregs/intr_vect_defs.h>
6 #include <asm/tlbflush.h>
7 #include <asm/mmu_context.h>
14 #include <linux/timex.h>
15 #include <linux/sched.h>
16 #include <linux/kernel.h>
19 #include <linux/module.h>
21 #define IPI_SCHEDULE 1
23 #define IPI_FLUSH_TLB 4
26 #define FLUSH_ALL (void*)0xffffffff
55 static unsigned long flush_addr;
58 static unsigned long irq_regs[
NR_CPUS] = {
66 .handler = crisv32_ipi_interrupt,
83 for (i = 0; i < max_cpus; i++)
84 cpumask_set_cpu(i, &phys_cpu_present_map);
101 cpumask_set_cpu(0, &phys_cpu_present_map);
116 cpumask_clear(&cpu_mask);
125 cpumask_set_cpu(cpuid, &cpu_mask);
130 for (timeout = 0; timeout < 10000; timeout++) {
133 smp_init_current_idle_thread =
NULL;
165 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
169 notify_cpu_starting(cpu);
180 asm volatile(
"halt");
211 cpumask_clear(&cpu_mask);
212 cpumask_set_cpu(cpu, &cpu_mask);
234 spin_unlock_irqrestore(&tlbstate_lock, flags);
248 cpumask_clear(mm_cpumask(mm));
274 cpumask_and(&cpu_mask, &cpu_mask, cpu_online_mask);
280 REG_WR(intr_vect, irq_regs[i], rw_ipi, ipi);
287 for (j = 0 ; j < 1000; j++) {
288 ipi =
REG_RD(intr_vect, irq_regs[i], rw_ipi);
315 cpumask_setall(&cpu_mask);
324 spin_lock(&call_lock);
327 spin_unlock(&call_lock);