]> git.ipfire.org Git - thirdparty/linux.git/blame - arch/cris/kernel/irq.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/linux.git] / arch / cris / kernel / irq.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1da177e4
LT
2/*
3 *
4 * linux/arch/cris/kernel/irq.c
5 *
eb2746dd 6 * Copyright (c) 2000,2007 Axis Communications AB
1da177e4
LT
7 *
8 * Authors: Bjorn Wesen (bjornw@axis.com)
9 *
10 * This file contains the code used by various IRQ handling routines:
49b4ff33 11 * asking for different IRQs should be done through these routines
1da177e4
LT
12 * instead of just grabbing them. Thus setups with different IRQ numbers
13 * shouldn't result in any weird surprises, and installing new handlers
14 * should be easier.
15 *
1da177e4
LT
16 */
17
18/*
49b4ff33 19 * IRQs are in fact implemented a bit like signal handlers for the kernel.
1da177e4
LT
20 * Naturally it's not a 1:1 relation, but there are similarities.
21 */
22
1da177e4
LT
23#include <linux/module.h>
24#include <linux/ptrace.h>
2e0cea1d 25#include <linux/irq.h>
b17b0153 26#include <linux/sched/debug.h>
1da177e4
LT
27
28#include <linux/kernel_stat.h>
29#include <linux/signal.h>
30#include <linux/sched.h>
31#include <linux/ioport.h>
32#include <linux/interrupt.h>
33#include <linux/timex.h>
1da177e4
LT
34#include <linux/random.h>
35#include <linux/init.h>
36#include <linux/seq_file.h>
37#include <linux/errno.h>
2e0cea1d 38#include <linux/spinlock.h>
1da177e4
LT
39
40#include <asm/io.h>
b1a154db 41#include <arch/system.h>
1da177e4 42
1da177e4 43/* called by the assembler IRQ entry functions defined in irq.h
49b4ff33 44 * to dispatch the interrupts to registered handlers
1da177e4
LT
45 */
46
47asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
48{
2e0cea1d 49 unsigned long sp;
444e0c28
RV
50 struct pt_regs *old_regs;
51
52 trace_hardirqs_off();
53
54 old_regs = set_irq_regs(regs);
2e0cea1d
MS
55 irq_enter();
56 sp = rdsp();
57 if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
58 printk("do_IRQ: stack overflow: %lX\n", sp);
59 show_stack(NULL, (unsigned long *)sp);
1da177e4 60 }
c84077ac
TG
61 generic_handle_irq(irq);
62 irq_exit();
eb2746dd 63 set_irq_regs(old_regs);
1da177e4
LT
64}
65
1da177e4
LT
66void weird_irq(void)
67{
68 local_irq_disable();
69 printk("weird irq\n");
70 while(1);
71}
72