从内核模块向用户空间通知gpio中断 [英] Notify gpio interrupt to user space from a kernel module

查看:144
本文介绍了从内核模块向用户空间通知gpio中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码可以检测内核模块中的GPIO中断.现在,我正在寻找一种从内核模块检测到gpio中断时通知用户空间的机制.在不同的选择上是否有某些优点/缺点的示例/代码段?非常感谢您的回复.

I have a code which detects GPIO interrupt in a kernel module. Now,I am looking for a mechanism to notify user space upon detecting gpio interrupt from kernel module. Any example / code snippet with certain advantages/disadvantages over different options? I would appreciate your response.

推荐答案

您可以: (1)向用户应用程序发送信号,或者 (2)实现file_operations-> poll方法,在发生中断时使用poll_wait和wait队列唤醒用户应用程序.

You can: (1) Send a signal to the user application, or (2) implement file_operations->poll method, use poll_wait and wait queue to wake user application when interrupt occur.

这篇关于从内核模块向用户空间通知gpio中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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