4.调用irq_desc[irq]->handle 5.irq_desc[irq]->handle过程s3c_irqext_ack(unsigned int irqno)主要清中断{ mask = __raw_readl(S3C24XX_EINTMASK);读中断掩码__raw_writel(bit, S3C24XX_EINTPEND);清零req = __raw_readl(S3C24XX_EINTPEND);再读req &= ~mask;}irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action){do {trace_irq_handler_entry(irq, action);根据中断号取出链表中成员ret = action->handler(irq, action->dev_id);执行处理函数trace_irq_handler_exit(irq, action, ret);}}struct irq_chip {底层一些函数操作const char *name;unsigned int (*startup)(unsigned int irq);void (*shutdown)(unsigned int irq);void (*enable)(unsigned int irq);void (*disable)(unsigned int irq);void (*ack)(unsigned int irq);void (*mask)(unsigned int irq);void (*mask_ack)(unsigned int irq);void (*unmask)(unsigned int irq);void (*eoi)(unsigned int irq);void (*end)(unsigned int irq);void (*set_affinity)(unsigned int irq,const struct cpumask *dest);int (*retrigger)(unsigned int irq);int (*set_type)(unsigned int irq, unsigned int flow_type);int (*set_wake)(unsigned int irq, unsigned int on);}int request_irq(unsigned int irq,irq_handler_t handler,unsigned long irqflags, const char * devname, void *dev_id){分配action 结构action = kmalloc(sizeof(struct irqaction),GFP_ATOMIC)把中断加入链表设置actionaction->handler = handler;action->flags = irqflags;action->name = devname;action->next = NULL;action->dev_id = dev_id;然后指向action;*actionp = action;配置中断引脚开始中断__enable_irq(irq);}free_irq把中断出连,然后禁止中断
学习笔记中断处理过程
最新推荐文章于 2023-02-17 00:31:17 发布