1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
7  * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle
8  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9  * Copyright (C) 2001 Kanoj Sarcar
10  */
11 #ifndef _ASM_IRQ_H
12 #define _ASM_IRQ_H
13 
14 #include <linux/config.h>
15 #include <linux/linkage.h>
16 #include <asm/sn/arch.h>
17 
18 #define NR_IRQS 256
19 
20 /*
21  * Number of levels in INT_PEND0. Can be set to 128 if we also
22  * consider INT_PEND1.
23  */
24 #define PERNODE_LEVELS	64
25 
26 extern int node_level_to_irq[MAX_COMPACT_NODES][PERNODE_LEVELS];
27 
28 /*
29  * we need to map irq's up to at least bit 7 of the INT_MASK0_A register
30  * since bits 0-6 are pre-allocated for other purposes.
31  */
32 #define LEAST_LEVEL	7
33 #define FAST_IRQ_TO_LEVEL(i)	((i) + LEAST_LEVEL)
34 #define LEVEL_TO_IRQ(c, l) \
35 			(node_level_to_irq[CPUID_TO_COMPACT_NODEID(c)][(l)])
36 
37 #ifdef CONFIG_I8259
irq_cannonicalize(int irq)38 static inline int irq_cannonicalize(int irq)
39 {
40 	return ((irq == 2) ? 9 : irq);
41 }
42 #else
43 #define irq_cannonicalize(irq) (irq)	/* Sane hardware, sane code ... */
44 #endif
45 
46 extern void disable_irq(unsigned int);
47 extern void disable_irq_nosync(unsigned int);
48 extern void enable_irq(unsigned int);
49 
50 struct pt_regs;
51 extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
52 
53 /* Machine specific interrupt initialization  */
54 extern void (*irq_setup)(void);
55 
56 extern void init_generic_irq(void);
57 
58 #endif /* _ASM_IRQ_H */
59