Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
irq.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3  * Author: Fuxin Zhang, [email protected]
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  */
10 #include <linux/interrupt.h>
11 
12 #include <asm/irq_cpu.h>
13 #include <asm/i8259.h>
14 
15 #include <loongson.h>
16 
17 static void i8259_irqdispatch(void)
18 {
19  int irq;
20 
21  irq = i8259_irq();
22  if (irq >= 0)
23  do_IRQ(irq);
24  else
26 }
27 
28 asmlinkage void mach_irq_dispatch(unsigned int pending)
29 {
30  if (pending & CAUSEF_IP7)
32  else if (pending & CAUSEF_IP6) /* perf counter loverflow */
33  do_perfcnt_IRQ();
34  else if (pending & CAUSEF_IP5)
35  i8259_irqdispatch();
36  else if (pending & CAUSEF_IP2)
38  else
40 }
41 
42 static struct irqaction cascade_irqaction = {
43  .handler = no_action,
44  .name = "cascade",
45  .flags = IRQF_NO_THREAD,
46 };
47 
49 {
50  /* init all controller
51  * 0-15 ------> i8259 interrupt
52  * 16-23 ------> mips cpu interrupt
53  * 32-63 ------> bonito irq
54  */
55 
56  /* most bonito irq should be level triggered */
59 
60  /* Sets the first-level interrupt dispatcher. */
64 
65  /* bonito irq at IP2 */
66  setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction);
67  /* 8259 irq at IP5 */
68  setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction);
69 }