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