1 #ifndef _ASM_IRQ_H
2 #define _ASM_IRQ_H
3
4 #include <linux/string.h>
5 #include <asm/ptrace.h>
6 #include <linux/interrupt.h>
7
8 #include <asm/types.h>
9 /*
10 * linux/include/asm/irq.h
11 *
12 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar,
13 * Copyright 1999 SuSE GmbH
14 *
15 * IRQ/IPI changes taken from work by Thomas Radke
16 * <tomsoft@informatik.tu-chemnitz.de>
17 */
18
19 #define CPU_IRQ_REGION 1
20 #define TIMER_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 0)
21 #define IPI_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 1)
22
23 /* This should be 31 for PA1.1 binaries and 63 for PA-2.0 wide mode) */
24 #define MAX_CPU_IRQ (BITS_PER_LONG - 1)
25
26 #if 1 /* set to 1 to get the new irq offsets, or ... */
27 # if BITS_PER_LONG == 32
28 # define IRQ_REGION_SHIFT 5
29 # else
30 # define IRQ_REGION_SHIFT 6
31 # endif
32 #else /* 256 irq-entries per region (wastes memory, maybe gains speed? :-))*/
33 # define IRQ_REGION_SHIFT 8
34 #endif
35
36 #define IRQ_PER_REGION (1 << IRQ_REGION_SHIFT)
37 #define NR_IRQ_REGS 8
38 #define NR_IRQS (NR_IRQ_REGS * IRQ_PER_REGION)
39
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)
43
44 #define IRQ_REG_DIS 1 /* support disable_irq / enable_irq */
45 #define IRQ_REG_MASK 2 /* require IRQs to be masked */
46
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);
52 };
53
54 struct irq_region_data {
55 void *dev;
56 const char *name;
57 unsigned flags;
58 int irqbase;
59 };
60
61 struct irq_region {
62 struct irq_region_ops ops;
63 struct irq_region_data data;
64
65 struct irqaction *action;
66 };
67
68 extern struct irq_region *irq_region[NR_IRQ_REGS];
69
70 static __inline__ int irq_cannonicalize(int irq)
71 {
72 return irq;
73 }
74
75 extern void disable_irq(int);
76 extern void enable_irq(int);
77
78 extern void do_irq_mask(unsigned long mask, struct irq_region *region,
79 struct pt_regs *regs);
80
81 extern struct irq_region *alloc_irq_region(int count, struct irq_region_ops *ops,
82 unsigned long flags, const char *name, void *dev);
83
84 extern int txn_alloc_irq(void);
85 extern int txn_claim_irq(int);
86 extern unsigned int txn_alloc_data(int, unsigned int);
87 extern unsigned long txn_alloc_addr(int);
88
89 #endif /* _ASM_IRQ_H */
90
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.