123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #include <linux/smp.h>
- #include <linux/interrupt.h>
- #ifdef CONFIG_MIPS_MT_SMP
- #define MIPS_CPU_IPI_RESCHED_IRQ 0
- #define MIPS_CPU_IPI_CALL_IRQ 1
- static void ipi_resched_dispatch(void)
- {
- do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ);
- }
- static void ipi_call_dispatch(void)
- {
- do_IRQ(MIPS_CPU_IPI_CALL_IRQ);
- }
- static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
- {
- return IRQ_HANDLED;
- }
- static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
- {
- generic_smp_call_function_interrupt();
- return IRQ_HANDLED;
- }
- static struct irqaction irq_resched = {
- .handler = ipi_resched_interrupt,
- .flags = IRQF_PERCPU,
- .name = "IPI_resched"
- };
- static struct irqaction irq_call = {
- .handler = ipi_call_interrupt,
- .flags = IRQF_PERCPU,
- .name = "IPI_call"
- };
- void __init arch_init_ipiirq(int irq, struct irqaction *action)
- {
- setup_irq(irq, action);
- irq_set_handler(irq, handle_percpu_irq);
- }
- void __init msp_vsmp_int_init(void)
- {
- set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
- set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
- arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ, &irq_resched);
- arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ, &irq_call);
- }
- #endif
|