wait_event_interruptible 在驱动中的应用
2015-10-16 21:59
369 查看
前言:
看了很多网上的 wait_event_interruptible(queue, condition)介绍文字,感觉没有几个真正搞懂他的两个参数是怎么用的。
wait_event_interruptible 是linux驱动设计中断的重要函数,他有什么用呢?
用在驱动里面会休眠当前的进程。
1 queue 的中断队列里面有对应的中断产生
在linux kernel 里面 , wait.h 里面有个宏定义 : DECLARE_WAIT_QUEUE_HEAD 就是一个wait 等待的队列结构体
DECLARE_WAIT_QUEUE_HEAD queue 就是定义了一个等待的队列
2 condition设定条件符合
然后,呢被休眠的进程如何重新启动呢?
wake_up_interruptible(&queue)
ref:
1 wait_event_interruptible(queue, condition) 使用方法
http://blog.csdn.net/allen6268198/article/details/8112551
by makin email to : 28044280@qq.com for discusstion.
看了很多网上的 wait_event_interruptible(queue, condition)介绍文字,感觉没有几个真正搞懂他的两个参数是怎么用的。
wait_event_interruptible 是linux驱动设计中断的重要函数,他有什么用呢?
1 有什么用?
就是进程休眠,等待中断:用在驱动里面会休眠当前的进程。
2 两个参数怎么用?
wait_event_interruptible(queue, condition)1 queue 的中断队列里面有对应的中断产生
在linux kernel 里面 , wait.h 里面有个宏定义 : DECLARE_WAIT_QUEUE_HEAD 就是一个wait 等待的队列结构体
DECLARE_WAIT_QUEUE_HEAD queue 就是定义了一个等待的队列
2 condition设定条件符合
然后,呢被休眠的进程如何重新启动呢?
3 如何唤醒
在中断进程里加入,或者别的进程里面加入wake_up_interruptible(&queue)
ref:
1 wait_event_interruptible(queue, condition) 使用方法
http://blog.csdn.net/allen6268198/article/details/8112551
by makin email to : 28044280@qq.com for discusstion.
相关文章推荐
- TIME_WAIT是什么?
- 系统关键字 retain assign copy
- [Leetcode]Container With Most Water
- 合成存取器中copy和retain的区别
- Codeforces Round #325 (Div. 2) D. Phillip and Trains (BFS)
- E-Mail notifications in MS Dynamics AX 2012
- 查看Wait信息
- Leetcode100: Container With Most Water
- Dubbo错误No provider available for the service
- E - Fibonacci Again(找规律)
- 关于ttserver, mongodb, couchbase. ssdb ,tair, leveldb的一点使用体验
- 对Pedestrian Detection aided by Deep Learning Semantic Tasks的小结
- process launch failed: Security
- UVA 11076 Add Again(有重复元素的全排列问题)
- 线程间通信的实现 wait()和notify()方法
- Failure [INSTALL_FAILED_OLDER_SDK]
- <LeetCode><Easy> 172 Factorial Trailing Zeroes
- MegaCli 监控raid状态
- 安装virtualbox失败 提示WinVerifyTrust failed
- 让ecshop用户名、手机号、email登陆方法