File: irq.c

package info (click to toggle)
kernel-source-2.4.14 2.4.14-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 139,160 kB
  • ctags: 428,423
  • sloc: ansic: 2,435,554; asm: 141,119; makefile: 8,258; sh: 3,099; perl: 2,561; yacc: 1,177; cpp: 755; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (84 lines) | stat: -rw-r--r-- 1,884 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 *  linux/arch/arm/mach-anakin/irq.c
 *
 *  Copyright (C) 2001 Aleph One Ltd. for Acunia N.V.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *  Changelog:
 *   10-Apr-2001 TTC	Created
 */

#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/init.h>

#include <asm/irq.h>
#include <asm/mach/irq.h>

extern unsigned int anakin_irq_mask, anakin_active_irqs;
extern void do_IRQ(int, struct pt_regs *);

static void
anakin_mask_irq(unsigned int irq)
{
	anakin_irq_mask &= ~(1 << irq);
}

static void
anakin_unmask_irq(unsigned int irq)
{
	anakin_irq_mask |= (1 << irq);
}

/*
 * This is a faked interrupt to deal with parallel interrupt requests
 * on the Anakin.  Make sure that its interrupt number is not in any
 * way conflicting with the hardware interrupt numbers!  Check
 * IRQ_ANAKIN in linux/include/asm-arm/arch-anakin/irqs.h.
 */
static void
anakin_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
	for (irq = 0; irq < NR_IRQS; irq++)
		if (anakin_active_irqs & (1 << irq))
			do_IRQ(irq, regs);
}

static struct irqaction anakin_irq = {
	name:		"Anakin IRQ",
	handler:	anakin_interrupt,
	flags:		SA_INTERRUPT
};
 
void __init
irq_init_irq(void)
{
	unsigned int irq;

	for (irq = 0; irq < NR_IRQS; irq++) {
		switch (irq) {
		case IRQ_UART0:
		case IRQ_UART1:
		case IRQ_UART2:
		case IRQ_TICK:
		case IRQ_CODEC:
		case IRQ_UART4:
		case IRQ_TOUCHSCREEN:
		case IRQ_UART3:
		case IRQ_FIFO:
		case IRQ_CAN:
		case IRQ_COMPACTFLASH:
		case IRQ_BOSH:
		case IRQ_ANAKIN:
			irq_desc[irq].valid = 1;
			irq_desc[irq].mask_ack = anakin_mask_irq;
			irq_desc[irq].mask = anakin_mask_irq;
			irq_desc[irq].unmask = anakin_unmask_irq;
		}
	}
	setup_arm_irq(IRQ_ANAKIN, &anakin_irq);
}