生成和处理软件中断 [英] Generate and handle software interupt

查看:22
本文介绍了生成和处理软件中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能教我如何在Linux下产生软件中断,然后用request_irq处理?

could somebody show me how to generate software interrupt under Linux and then handle it with request_irq?

也许这是不可能的.

推荐答案

您可以改用 softirq.您可以通过编辑 include/linux/interrupt.h 来定义您的 sofirq.然后使用函数 rasie_softirq() 而不是 reuqest_irq(),后者通知内核有软中断需要处理.然后内核将在适当的软件中断上下文中执行它.

You can use softirq instead. You can define your sofirq via editing include/linux/interrupt.h. and then use function rasie_softirq() instead of reuqest_irq(),which notify the kernel there is softirq needs to be processed. then kernel will execute it at a appropriate in software interrupt context.

示例 API

1. open_softwareirq();
2. raise_softirq();

这篇关于生成和处理软件中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆