## provide extern IRQ handler interface of irq_desc
## provide extern Handling irq action chains of irq_desc
struct irq_desc {};
extern struct irq_desc irq_desc[NR_IRQS];
extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
static inline void set_irq_handler(unsigned int irq, irq_flow_handler_t handle);
set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, irq_flow_handler_t handle);
set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, irq_flow_handler_t handle, const char *name);
extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
extern int set_irq_data(unsigned int irq, void *data);
extern int set_irq_chip_data(unsigned int irq, void *data);
extern int setup_irq(unsigned int irq, struct irqaction *new);
extern void remove_irq(unsigned int irq, struct irqaction *act);
\include\linux\irqnr.h
extern struct irq_desc *irq_to_desc(unsigned int irq);
\kernel\irq\chip.c
## irq_handler (handle_irq of irq_desc)
## irq chip (chip of irq_desc)
## irq handler flow function (handle_irq of irq_desc)
int set_irq_chip(unsigned int irq, struct irq_chip *chip);
__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,const char *name);
void set_irq_probe(unsigned int irq);
int set_irq_type(unsigned int irq, unsigned int type);
int set_irq_data(unsigned int irq, void *data);
static inline void mask_ack_irq(struct irq_desc *desc, int irq);
static inline void mask_irq(struct irq_desc *desc, int irq);
static inline void unmask_irq(struct irq_desc *desc, int irq);
void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
void handle_level_irq(unsigned int irq, struct irq_desc *desc);
\kernel\irq\handle.c
## interrupt action flow
## __do_IRQ flow
irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
unsigned int __do_IRQ(unsigned int irq);
\kernel\irq\irqdesc.c in v2.6.37
struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {initial data};
// do action->handler(irq, action->dev_id);
struct irq_desc *irq_to_desc(unsigned int irq);
struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
kernel\irq\manage.c
## provide operation interface irq_desc
## add/remove irqaction list of irq_desc table
setup_irq(unsigned int irq, struct irqaction* act);
void remove_irq(unsigned int irq, struct irqaction *act);
void disable_irq(unsigned int irq);
void enable_irq(unsigned int irq);
include\linux\interrupt.h
static inline int __must_check
request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
const char *name, void *dev)
{
return request_threaded_irq(irq, handler, NULL, flags, name, dev);
}
沒有留言:
張貼留言