Path: blob/master/arch/mips/pmc-sierra/msp71xx/msp_smp.c
15118 views
/*1* Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.2* Copyright (C) 2001 Ralf Baechle3* Copyright (C) 2010 PMC-Sierra, Inc.4*5* VSMP support for MSP platforms . Derived from malta vsmp support.6*7* This program is free software; you can distribute it and/or modify it8* under the terms of the GNU General Public License (Version 2) as9* published by the Free Software Foundation.10*11* This program is distributed in the hope it will be useful, but WITHOUT12* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or13* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License14* for more details.15*16* You should have received a copy of the GNU General Public License along17* with this program; if not, write to the Free Software Foundation, Inc.,18* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.19*20*/21#include <linux/smp.h>22#include <linux/interrupt.h>2324#ifdef CONFIG_MIPS_MT_SMP25#define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */26#define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for call */272829static void ipi_resched_dispatch(void)30{31do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ);32}3334static void ipi_call_dispatch(void)35{36do_IRQ(MIPS_CPU_IPI_CALL_IRQ);37}3839static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)40{41return IRQ_HANDLED;42}4344static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)45{46smp_call_function_interrupt();4748return IRQ_HANDLED;49}5051static struct irqaction irq_resched = {52.handler = ipi_resched_interrupt,53.flags = IRQF_DISABLED | IRQF_PERCPU,54.name = "IPI_resched"55};5657static struct irqaction irq_call = {58.handler = ipi_call_interrupt,59.flags = IRQF_DISABLED | IRQF_PERCPU,60.name = "IPI_call"61};6263void __init arch_init_ipiirq(int irq, struct irqaction *action)64{65setup_irq(irq, action);66irq_set_handler(irq, handle_percpu_irq);67}6869void __init msp_vsmp_int_init(void)70{71set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);72set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);73arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ, &irq_resched);74arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ, &irq_call);75}76#endif /* CONFIG_MIPS_MT_SMP */777879