1
2
3
4
5
6
7
8
9
10#ifndef __ASM_ARM_MACH_IRQ_H
11#define __ASM_ARM_MACH_IRQ_H
12
13struct irqdesc;
14struct pt_regs;
15struct seq_file;
16
17typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
18typedef void (*irq_control_t)(unsigned int);
19
20struct irqchip {
21
22
23
24
25
26 void (*ack)(unsigned int);
27
28
29
30 void (*mask)(unsigned int);
31
32
33
34 void (*unmask)(unsigned int);
35
36
37
38
39
40
41 int (*retrigger)(unsigned int);
42
43
44
45 int (*type)(unsigned int, unsigned int);
46
47
48
49 int (*wake)(unsigned int, unsigned int);
50
51#ifdef CONFIG_SMP
52
53
54
55 void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu);
56#endif
57};
58
59struct irqdesc {
60 irq_handler_t handle;
61 struct irqchip *chip;
62 struct irqaction *action;
63 struct list_head pend;
64 void *chipdata;
65 void *data;
66 unsigned int disable_depth;
67
68 unsigned int triggered: 1;
69 unsigned int running : 1;
70 unsigned int pending : 1;
71 unsigned int probing : 1;
72 unsigned int probe_ok : 1;
73 unsigned int valid : 1;
74 unsigned int noautoenable : 1;
75 unsigned int unused :25;
76
77 struct proc_dir_entry *procdir;
78
79#ifdef CONFIG_SMP
80 cpumask_t affinity;
81 unsigned int cpu;
82#endif
83
84
85
86
87 unsigned int lck_cnt;
88 unsigned int lck_pc;
89 unsigned int lck_jif;
90};
91
92extern struct irqdesc irq_desc[];
93
94
95
96
97extern void (*init_arch_irq)(void);
98extern void init_FIQ(void);
99extern int show_fiq_list(struct seq_file *, void *);
100void __set_irq_handler(unsigned int irq, irq_handler_t, int);
101
102
103
104
105#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
106#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
107#define set_irq_data(irq,d) do { irq_desc[irq].data = d; } while (0)
108#define set_irq_chipdata(irq,d) do { irq_desc[irq].chipdata = d; } while (0)
109#define get_irq_chipdata(irq) (irq_desc[irq].chipdata)
110
111void set_irq_chip(unsigned int irq, struct irqchip *);
112void set_irq_flags(unsigned int irq, unsigned int flags);
113
114#define IRQF_VALID (1 << 0)
115#define IRQF_PROBE (1 << 1)
116#define IRQF_NOAUTOEN (1 << 2)
117
118
119
120
121void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
122void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
123void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
124void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
125void dummy_mask_unmask_irq(unsigned int irq);
126
127#endif
128