/*1*2* linux/arch/cris/kernel/irq.c3*4* Copyright (c) 2000,2007 Axis Communications AB5*6* Authors: Bjorn Wesen ([email protected])7*8* This file contains the code used by various IRQ handling routines:9* asking for different IRQs should be done through these routines10* instead of just grabbing them. Thus setups with different IRQ numbers11* shouldn't result in any weird surprises, and installing new handlers12* should be easier.13*14*/1516/*17* IRQs are in fact implemented a bit like signal handlers for the kernel.18* Naturally it's not a 1:1 relation, but there are similarities.19*/2021#include <linux/module.h>22#include <linux/ptrace.h>23#include <linux/irq.h>2425#include <linux/kernel_stat.h>26#include <linux/signal.h>27#include <linux/sched.h>28#include <linux/ioport.h>29#include <linux/interrupt.h>30#include <linux/timex.h>31#include <linux/random.h>32#include <linux/init.h>33#include <linux/seq_file.h>34#include <linux/errno.h>35#include <linux/spinlock.h>3637#include <asm/io.h>3839/* called by the assembler IRQ entry functions defined in irq.h40* to dispatch the interrupts to registered handlers41* interrupts are disabled upon entry - depending on if the42* interrupt was registered with IRQF_DISABLED or not, interrupts43* are re-enabled or not.44*/4546asmlinkage void do_IRQ(int irq, struct pt_regs * regs)47{48unsigned long sp;49struct pt_regs *old_regs = set_irq_regs(regs);50irq_enter();51sp = rdsp();52if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {53printk("do_IRQ: stack overflow: %lX\n", sp);54show_stack(NULL, (unsigned long *)sp);55}56generic_handle_irq(irq);57irq_exit();58set_irq_regs(old_regs);59}6061void weird_irq(void)62{63local_irq_disable();64printk("weird irq\n");65while(1);66}67686970