Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright (C) 2011-12 Synopsys, Inc. (www.synopsys.com)
0004  */
0005 
0006 #include <linux/interrupt.h>
0007 #include <linux/irqchip.h>
0008 #include <asm/mach_desc.h>
0009 
0010 #include <asm/irq_regs.h>
0011 #include <asm/smp.h>
0012 
0013 /*
0014  * Late Interrupt system init called from start_kernel for Boot CPU only
0015  *
0016  * Since slab must already be initialized, platforms can start doing any
0017  * needed request_irq( )s
0018  */
0019 void __init init_IRQ(void)
0020 {
0021     /*
0022      * process the entire interrupt tree in one go
0023      * Any external intc will be setup provided DT chains them
0024      * properly
0025      */
0026     irqchip_init();
0027 
0028 #ifdef CONFIG_SMP
0029     /* a SMP H/w block could do IPI IRQ request here */
0030     if (plat_smp_ops.init_per_cpu)
0031         plat_smp_ops.init_per_cpu(smp_processor_id());
0032 #endif
0033 
0034     if (machine_desc->init_per_cpu)
0035         machine_desc->init_per_cpu(smp_processor_id());
0036 }
0037 
0038 /*
0039  * "C" Entry point for any ARC ISR, called from low level vector handler
0040  * @irq is the vector number read from ICAUSE reg of on-chip intc
0041  */
0042 void arch_do_IRQ(unsigned int hwirq, struct pt_regs *regs)
0043 {
0044     struct pt_regs *old_regs;
0045 
0046     irq_enter();
0047     old_regs = set_irq_regs(regs);
0048     generic_handle_domain_irq(NULL, hwirq);
0049     set_irq_regs(old_regs);
0050     irq_exit();
0051 }