对“当前"的引用Linux中断上下文中的任务 [英] Reference to "current" task in Linux Interrupt Context

查看:64
本文介绍了对“当前"的引用Linux中断上下文中的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Linux中进行中断处理时,我有一个问题,当核心处于硬irq模式时,是否可以引用指向被中断任务的当前宏?另外,如果这种引用是可能的,尽管我们强烈建议不要调用信号量"down",那将会发生什么??

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.?

推荐答案

我认为至少在x86上可以这样做,因为它不会立即引起恐慌.

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?

这篇关于对“当前"的引用Linux中断上下文中的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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