当前位置: 技术问答>linux和unix
(请来拿分) 内核态驱动的中断里怎么发信号给用户程序?
来源: 互联网 发布时间:2016-03-22
本文导语: 我的一个网卡驱动,我发现在它的接收中断里不能发信号给用户程序,否则会出现错误,死机,非中断的地方可以发的。我用的函数是send_sig(sig,*task struct,priv),这个函数的第三个参数priv有什么作用? 谢谢! ...
我的一个网卡驱动,我发现在它的接收中断里不能发信号给用户程序,否则会出现错误,死机,非中断的地方可以发的。我用的函数是send_sig(sig,*task struct,priv),这个函数的第三个参数priv有什么作用? 谢谢!
|
节自 3rd.
11.2.1. The specific_send_sig_info( ) Function
The specific_send_sig_info( ) function sends a signal to a specific process. It acts on three parameters:
sig
The signal number.
info
Either the address of a siginfo_t table or one of three special values: 0 means that the signal has been sent by a User Mode process, 1 means that it has been sent by the kernel, and 2 means that is has been sent by the kernel and the signal is SIGSTOP or SIGKILL.
t
A pointer to the descriptor of the destination process.
11.2.1. The specific_send_sig_info( ) Function
The specific_send_sig_info( ) function sends a signal to a specific process. It acts on three parameters:
sig
The signal number.
info
Either the address of a siginfo_t table or one of three special values: 0 means that the signal has been sent by a User Mode process, 1 means that it has been sent by the kernel, and 2 means that is has been sent by the kernel and the signal is SIGSTOP or SIGKILL.
t
A pointer to the descriptor of the destination process.
|
针对第一个问题。可能是信号级别问题?
至于第二个问题,我找到一个回答,你看看先。
kernel to user space signalling
You should find the task structure using find_task_by_pid(pid) and then deliver the signal.
You also have to take care of some locks(mostly siglock).
至于第二个问题,我找到一个回答,你看看先。
kernel to user space signalling
You should find the task structure using find_task_by_pid(pid) and then deliver the signal.
You also have to take care of some locks(mostly siglock).
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。