Reference to “current” task in Linux Interrupt Context

人盡茶涼 提交于 2021-02-11 08:15:43

问题


As I was going through the Interrupt Handling in Linux, I had this question if we can make reference to the current macro pointing to the interrupted task, while the core is in hard-irq mode? Also, if this referencing is possible whatwill happen if we make a call to semaphore "down", though this is highly discouraged.?


回答1:


I believe it's possible to do, at least on x86, in the sense that it won't cause an immediate panic.

It is however ALWAYS wrong to do this. An interrupt is not associated with any task, there's no link between the interrupt and a certain task running, so there's no sensible reason to try to do this anyway. What good it the current task if it could be any task on the system?



来源:https://stackoverflow.com/questions/10646892/reference-to-current-task-in-linux-interrupt-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!