2 * linux/include/asm-parisc/irq.h
4 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar,
5 * Copyright 1999 SuSE GmbH
7 * IRQ/IPI changes taken from work by Thomas Radke
8 * <tomsoft@informatik.tu-chemnitz.de>
11 #ifndef _ASM_PARISC_IRQ_H
12 #define _ASM_PARISC_IRQ_H
14 #include <asm/ptrace.h>
15 #include <asm/types.h>
16 #include <asm/errno.h>
18 #include <linux/string.h>
19 #include <linux/interrupt.h>
20 #include <linux/config.h>
23 #define CPU_IRQ_REGION 1
24 #define TIMER_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 0)
25 #define IPI_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 1)
27 /* This should be 31 for PA1.1 binaries and 63 for PA-2.0 wide mode */
28 #define MAX_CPU_IRQ (BITS_PER_LONG - 1)
30 #if BITS_PER_LONG == 32
31 # define IRQ_REGION_SHIFT 5
33 # define IRQ_REGION_SHIFT 6
36 #define IRQ_PER_REGION (1 << IRQ_REGION_SHIFT)
37 #define NR_IRQ_REGS 16
38 #define NR_IRQS (NR_IRQ_REGS * IRQ_PER_REGION)
40 #define IRQ_REGION(irq) ((irq) >> IRQ_REGION_SHIFT)
41 #define IRQ_OFFSET(irq) ((irq) & ((1<<IRQ_REGION_SHIFT)-1))
42 #define IRQ_FROM_REGION(reg) ((reg) << IRQ_REGION_SHIFT)
44 #define EISA_IRQ_REGION 0 /* region 0 needs to be reserved for EISA */
45 #define EISA_MAX_IRQS 16 /* max. (E)ISA irq line */
47 struct irq_region_ops
{
48 void (*disable_irq
)(void *dev
, int irq
);
49 void (* enable_irq
)(void *dev
, int irq
);
50 void (* mask_irq
)(void *dev
, int irq
);
51 void (* unmask_irq
)(void *dev
, int irq
);
54 struct irq_region_data
{
58 unsigned int status
[IRQ_PER_REGION
]; /* IRQ status */
62 struct irq_region_ops ops
;
63 struct irq_region_data data
;
65 struct irqaction
*action
;
68 extern struct irq_region
*irq_region
[NR_IRQ_REGS
];
70 static __inline__
int irq_canonicalize(int irq
)
73 return (irq
== (IRQ_FROM_REGION(EISA_IRQ_REGION
)+2)
74 ? (IRQ_FROM_REGION(EISA_IRQ_REGION
)+9) : irq
);
80 extern void disable_irq(int);
81 #define disable_irq_nosync(i) disable_irq(i)
82 extern void enable_irq(int);
84 extern void do_irq(struct irqaction
*a
, int i
, struct pt_regs
*p
);
85 extern void do_irq_mask(unsigned long mask
, struct irq_region
*region
,
86 struct pt_regs
*regs
);
88 extern struct irq_region
*alloc_irq_region(int count
, struct irq_region_ops
*ops
,
89 const char *name
, void *dev
);
91 extern int txn_alloc_irq(void);
92 extern int txn_claim_irq(int);
93 extern unsigned int txn_alloc_data(int, unsigned int);
94 extern unsigned long txn_alloc_addr(int);
96 /* soft power switch support (power.c) */
97 extern struct tasklet_struct power_tasklet
;
100 int handle_IRQ_event(unsigned int, struct pt_regs
*, struct irqaction
*);
102 #endif /* _ASM_PARISC_IRQ_H */