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>
22 #define CPU_IRQ_REGION 1
23 #define TIMER_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 0)
24 #define IPI_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 1)
26 /* This should be 31 for PA1.1 binaries and 63 for PA-2.0 wide mode */
27 #define MAX_CPU_IRQ (BITS_PER_LONG - 1)
29 #if BITS_PER_LONG == 32
30 # define IRQ_REGION_SHIFT 5
32 # define IRQ_REGION_SHIFT 6
35 #define IRQ_PER_REGION (1 << IRQ_REGION_SHIFT)
36 #define NR_IRQ_REGS 16
37 #define NR_IRQS (NR_IRQ_REGS * IRQ_PER_REGION)
39 #define IRQ_REGION(irq) ((irq) >> IRQ_REGION_SHIFT)
40 #define IRQ_OFFSET(irq) ((irq) & ((1<<IRQ_REGION_SHIFT)-1))
41 #define IRQ_FROM_REGION(reg) ((reg) << IRQ_REGION_SHIFT)
43 #define EISA_IRQ_REGION 0 /* region 0 needs to be reserved for EISA */
44 #define EISA_MAX_IRQS 16 /* max. (E)ISA irq line */
46 struct irq_region_ops
{
47 void (*disable_irq
)(void *dev
, int irq
);
48 void (* enable_irq
)(void *dev
, int irq
);
49 void (* mask_irq
)(void *dev
, int irq
);
50 void (* unmask_irq
)(void *dev
, int irq
);
53 struct irq_region_data
{
57 unsigned int status
[IRQ_PER_REGION
]; /* IRQ status */
61 struct irq_region_ops ops
;
62 struct irq_region_data data
;
64 struct irqaction
*action
;
67 extern struct irq_region
*irq_region
[NR_IRQ_REGS
];
69 static __inline__
int irq_canonicalize(int irq
)
72 return (irq
== (IRQ_FROM_REGION(EISA_IRQ_REGION
)+2)
73 ? (IRQ_FROM_REGION(EISA_IRQ_REGION
)+9) : irq
);
79 extern void disable_irq(int);
80 #define disable_irq_nosync(i) disable_irq(i)
81 extern void enable_irq(int);
83 extern void do_irq(struct irqaction
*a
, int i
, struct pt_regs
*p
);
84 extern void do_irq_mask(unsigned long mask
, struct irq_region
*region
,
85 struct pt_regs
*regs
);
87 extern struct irq_region
*alloc_irq_region(int count
, struct irq_region_ops
*ops
,
88 const char *name
, void *dev
);
90 extern int txn_alloc_irq(void);
91 extern int txn_claim_irq(int);
92 extern unsigned int txn_alloc_data(int, unsigned int);
93 extern unsigned long txn_alloc_addr(int);
95 /* soft power switch support (power.c) */
96 extern struct tasklet_struct power_tasklet
;
98 #endif /* _ASM_PARISC_IRQ_H */