Blame view

arch/cris/kernel/irq.c 1.68 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
  /*
   *
   *	linux/arch/cris/kernel/irq.c
   *
eb2746ddc   Jesper Nilsson   cris build fixes:...
5
   *      Copyright (c) 2000,2007 Axis Communications AB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
7
8
9
   *
   *      Authors: Bjorn Wesen (bjornw@axis.com)
   *
   * This file contains the code used by various IRQ handling routines:
49b4ff330   Simon Arlott   spelling fixes: a...
10
   * asking for different IRQs should be done through these routines
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
14
   * instead of just grabbing them. Thus setups with different IRQ numbers
   * shouldn't result in any weird surprises, and installing new handlers
   * should be easier.
   *
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15
16
17
   */
  
  /*
49b4ff330   Simon Arlott   spelling fixes: a...
18
   * IRQs are in fact implemented a bit like signal handlers for the kernel.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
   * Naturally it's not a 1:1 relation, but there are similarities.
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
  #include <linux/module.h>
  #include <linux/ptrace.h>
2e0cea1de   Mikael Starvik   [PATCH] CRIS upda...
23
  #include <linux/irq.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
24
25
26
27
28
29
30
  
  #include <linux/kernel_stat.h>
  #include <linux/signal.h>
  #include <linux/sched.h>
  #include <linux/ioport.h>
  #include <linux/interrupt.h>
  #include <linux/timex.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31
32
33
34
  #include <linux/random.h>
  #include <linux/init.h>
  #include <linux/seq_file.h>
  #include <linux/errno.h>
2e0cea1de   Mikael Starvik   [PATCH] CRIS upda...
35
  #include <linux/spinlock.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
36
37
  
  #include <asm/io.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
38
  /* called by the assembler IRQ entry functions defined in irq.h
49b4ff330   Simon Arlott   spelling fixes: a...
39
   * to dispatch the interrupts to registered handlers
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
40
   * interrupts are disabled upon entry - depending on if the
49b4ff330   Simon Arlott   spelling fixes: a...
41
   * interrupt was registered with IRQF_DISABLED or not, interrupts
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
42
43
44
45
46
   * are re-enabled or not.
   */
  
  asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
  {
2e0cea1de   Mikael Starvik   [PATCH] CRIS upda...
47
  	unsigned long sp;
eb2746ddc   Jesper Nilsson   cris build fixes:...
48
  	struct pt_regs *old_regs = set_irq_regs(regs);
2e0cea1de   Mikael Starvik   [PATCH] CRIS upda...
49
50
51
52
53
54
  	irq_enter();
  	sp = rdsp();
  	if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
  		printk("do_IRQ: stack overflow: %lX
  ", sp);
  		show_stack(NULL, (unsigned long *)sp);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
  	}
c84077ac2   Thomas Gleixner   cris: Use irq han...
56
57
  	generic_handle_irq(irq);
  	irq_exit();
eb2746ddc   Jesper Nilsson   cris build fixes:...
58
  	set_irq_regs(old_regs);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
60
61
62
63
64
65
66
  void weird_irq(void)
  {
  	local_irq_disable();
  	printk("weird irq
  ");
  	while(1);
  }