/* * SMP support for J2 processor * * Copyright (C) 2015-2016 Smart Energy Instruments, Inc. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include #include #include #include #include #include DEFINE_PER_CPU(unsigned, j2_ipi_messages); extern u32 *sh2_cpuid_addr; static u32 *j2_ipi_trigger; static int j2_ipi_irq; static irqreturn_t j2_ipi_interrupt_handler(int irq, void *arg) { unsigned cpu = hard_smp_processor_id(); volatile unsigned *pmsg = &per_cpu(j2_ipi_messages, cpu); unsigned messages, i; do messages = *pmsg; while (cmpxchg(pmsg, messages, 0) != messages); if (!messages) return IRQ_NONE; for (i=0; i