xref: /OK3568_Linux_fs/kernel/arch/alpha/include/asm/irq.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _ALPHA_IRQ_H
3*4882a593Smuzhiyun #define _ALPHA_IRQ_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun /*
6*4882a593Smuzhiyun  *	linux/include/alpha/irq.h
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *	(C) 1994 Linus Torvalds
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/linkage.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #if   defined(CONFIG_ALPHA_GENERIC)
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun /* Here NR_IRQS is not exact, but rather an upper bound.  This is used
16*4882a593Smuzhiyun    many places throughout the kernel to size static arrays.  That's ok,
17*4882a593Smuzhiyun    we'll use alpha_mv.nr_irqs when we want the real thing.  */
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun /* When LEGACY_START_ADDRESS is selected, we leave out:
20*4882a593Smuzhiyun      TITAN
21*4882a593Smuzhiyun      WILDFIRE
22*4882a593Smuzhiyun      MARVEL
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun    This helps keep the kernel object size reasonable for the majority
25*4882a593Smuzhiyun    of machines.
26*4882a593Smuzhiyun */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun # if defined(CONFIG_ALPHA_LEGACY_START_ADDRESS)
29*4882a593Smuzhiyun #  define NR_IRQS      (128)           /* max is RAWHIDE/TAKARA */
30*4882a593Smuzhiyun # else
31*4882a593Smuzhiyun #  define NR_IRQS      (32768 + 16)    /* marvel - 32 pids */
32*4882a593Smuzhiyun # endif
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_CABRIOLET) || \
35*4882a593Smuzhiyun       defined(CONFIG_ALPHA_EB66P)     || \
36*4882a593Smuzhiyun       defined(CONFIG_ALPHA_EB164)     || \
37*4882a593Smuzhiyun       defined(CONFIG_ALPHA_PC164)     || \
38*4882a593Smuzhiyun       defined(CONFIG_ALPHA_LX164)
39*4882a593Smuzhiyun # define NR_IRQS	35
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_EB66)      || \
42*4882a593Smuzhiyun       defined(CONFIG_ALPHA_EB64P)     || \
43*4882a593Smuzhiyun       defined(CONFIG_ALPHA_MIKASA)
44*4882a593Smuzhiyun # define NR_IRQS	32
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_ALCOR)     || \
47*4882a593Smuzhiyun       defined(CONFIG_ALPHA_MIATA)     || \
48*4882a593Smuzhiyun       defined(CONFIG_ALPHA_RUFFIAN)   || \
49*4882a593Smuzhiyun       defined(CONFIG_ALPHA_RX164)     || \
50*4882a593Smuzhiyun       defined(CONFIG_ALPHA_NORITAKE)
51*4882a593Smuzhiyun # define NR_IRQS	48
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_SABLE)     || \
54*4882a593Smuzhiyun       defined(CONFIG_ALPHA_SX164)
55*4882a593Smuzhiyun # define NR_IRQS	40
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_DP264) || \
58*4882a593Smuzhiyun       defined(CONFIG_ALPHA_LYNX)  || \
59*4882a593Smuzhiyun       defined(CONFIG_ALPHA_SHARK)
60*4882a593Smuzhiyun # define NR_IRQS	64
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_TITAN)
63*4882a593Smuzhiyun #define NR_IRQS		80
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_RAWHIDE) || \
66*4882a593Smuzhiyun       defined(CONFIG_ALPHA_TAKARA) || \
67*4882a593Smuzhiyun       defined(CONFIG_ALPHA_EIGER)
68*4882a593Smuzhiyun # define NR_IRQS	128
69*4882a593Smuzhiyun 
70*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_WILDFIRE)
71*4882a593Smuzhiyun # define NR_IRQS	2048 /* enuff for 8 QBBs */
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun #elif defined(CONFIG_ALPHA_MARVEL)
74*4882a593Smuzhiyun # define NR_IRQS	(32768 + 16) 	/* marvel - 32 pids*/
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun #else /* everyone else */
77*4882a593Smuzhiyun # define NR_IRQS	16
78*4882a593Smuzhiyun #endif
79*4882a593Smuzhiyun 
irq_canonicalize(int irq)80*4882a593Smuzhiyun static __inline__ int irq_canonicalize(int irq)
81*4882a593Smuzhiyun {
82*4882a593Smuzhiyun 	/*
83*4882a593Smuzhiyun 	 * XXX is this true for all Alpha's?  The old serial driver
84*4882a593Smuzhiyun 	 * did it this way for years without any complaints, so....
85*4882a593Smuzhiyun 	 */
86*4882a593Smuzhiyun 	return ((irq == 2) ? 9 : irq);
87*4882a593Smuzhiyun }
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun struct pt_regs;
90*4882a593Smuzhiyun extern void (*perf_irq)(unsigned long, struct pt_regs *);
91*4882a593Smuzhiyun 
92*4882a593Smuzhiyun #endif /* _ALPHA_IRQ_H */
93