上一节讲了如何实现运行中断,这些都是系统给做好的,当我们想自己写个中断处理程序,去执行自己的代码,就需要写irq_desc->action->handler,然后通过request_irq()来向内核申请注册中断...本节目标:
分析request_irq()如何申请注册中断,free_irq()如何注销中断
1.request_irq()位于kernel/irq/ manage .c,函数原型如下:
int...,就是(irq_desc+ irq )->action->handler
unsigned long irqflags: 触发中断的参数,比如边沿触发, 定义在linux/interrupt.h。 ...)如何设置irq_ desc[irq]->action的:
int setup_irq(unsigned int irq, struct irqaction *new)
{
struct...为例,来看看它是如何初始化中断引脚的:
s3c_irqext_type(unsigned int irq, unsigned int type)
{
void __iomem *extint_reg