2 * linux/include/asm-arm/mach/irq.h
4 * Copyright (C) 1995-2000 Russell King.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #ifndef __ASM_ARM_MACH_IRQ_H
11 #define __ASM_ARM_MACH_IRQ_H
17 typedef void (*irq_handler_t
)(unsigned int, struct irqdesc
*, struct pt_regs
*);
18 typedef void (*irq_control_t
)(unsigned int);
22 * Acknowledge the IRQ.
23 * If this is a level-based IRQ, then it is expected to mask the IRQ
26 void (*ack
)(unsigned int);
28 * Mask the IRQ in hardware.
30 void (*mask
)(unsigned int);
32 * Unmask the IRQ in hardware.
34 void (*unmask
)(unsigned int);
36 * Ask the hardware to re-trigger the IRQ.
37 * Note: This method _must_ _not_ call the interrupt handler.
38 * If you are unable to retrigger the interrupt, do not
39 * provide a function, or if you do, return non-zero.
41 int (*retrigger
)(unsigned int);
43 * Set the type of the IRQ.
45 int (*type
)(unsigned int, unsigned int);
47 * Set wakeup-enable on the selected IRQ
49 int (*wake
)(unsigned int, unsigned int);
53 * Route an interrupt to a CPU
55 void (*set_cpu
)(struct irqdesc
*desc
, unsigned int irq
, unsigned int cpu
);
62 struct irqaction
*action
;
63 struct list_head pend
;
66 unsigned int disable_depth
;
68 unsigned int triggered
: 1; /* IRQ has occurred */
69 unsigned int running
: 1; /* IRQ is running */
70 unsigned int pending
: 1; /* IRQ is pending */
71 unsigned int probing
: 1; /* IRQ in use for a probe */
72 unsigned int probe_ok
: 1; /* IRQ can be used for probe */
73 unsigned int valid
: 1; /* IRQ claimable */
74 unsigned int noautoenable
: 1; /* don't automatically enable IRQ */
75 unsigned int unused
:25;
77 struct proc_dir_entry
*procdir
;
92 extern struct irqdesc irq_desc
[];
95 * This is internal. Do not use it.
97 extern void (*init_arch_irq
)(void);
98 extern void init_FIQ(void);
99 extern int show_fiq_list(struct seq_file
*, void *);
100 void __set_irq_handler(unsigned int irq
, irq_handler_t
, int);
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)
111 void set_irq_chip(unsigned int irq
, struct irqchip
*);
112 void set_irq_flags(unsigned int irq
, unsigned int flags
);
114 #define IRQF_VALID (1 << 0)
115 #define IRQF_PROBE (1 << 1)
116 #define IRQF_NOAUTOEN (1 << 2)
119 * Built-in IRQ handlers.
121 void do_level_IRQ(unsigned int irq
, struct irqdesc
*desc
, struct pt_regs
*regs
);
122 void do_edge_IRQ(unsigned int irq
, struct irqdesc
*desc
, struct pt_regs
*regs
);
123 void do_simple_IRQ(unsigned int irq
, struct irqdesc
*desc
, struct pt_regs
*regs
);
124 void do_bad_IRQ(unsigned int irq
, struct irqdesc
*desc
, struct pt_regs
*regs
);
125 void dummy_mask_unmask_irq(unsigned int irq
);