曲径通幽论坛

标题: free_irq() | 注销中断服务函数 [打印本页]

作者: beyes    时间: 2009-10-16 01:45
标题: free_irq() | 注销中断服务函数
当不再使用已注册的中断服务时,使用 free_irq() 函数将其从内核注销掉。该函数在 2.4 内核和 2.6 内核中原型相同。

原型
#include <linux/interrupt.h>
void free_irq (unsigned int irq, void *dev_id);

参数
irq  是将要注销掉的中断服务函数的中断号;
dev_id  值指定与 request_irq() 函数中使用的 dev_id 值相同的值。

示例代码片段
int xxx_release (struct inode *inode, struct file *filp)
{
     /*硬件中断禁止处理程序*/
     ... ...
     free_irq (XXX_IRQ, NULL);

     return (0);
}





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2