Kernel: make SIGKMESS target process list dynamic
The set of processes to which a SIGKMESS signal is sent whenever new diagnostics messages are added to the kernel's message buffer, is now no longer hardcoded. Instead, processes can (un)register themselves to receive such notifications, by means of sys_diagctl(). Change-Id: I9d6ac006a5d9bbfad2757587a068fc1ec3cc083e
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* send_sig: send a signal directly to a system process
|
||||
* cause_sig: take action to cause a signal to occur via a signal mgr
|
||||
* sig_delay_done: tell PM that a process is not sending
|
||||
* send_diag_sig: send a diagnostics signal to interested processes
|
||||
* get_randomness: accumulate randomness in a buffer
|
||||
* clear_endpoint: remove a process' ability to send and receive messages
|
||||
* sched_proc: schedule a process
|
||||
@@ -464,6 +465,25 @@ void sig_delay_done(struct proc *rp)
|
||||
cause_sig(proc_nr(rp), SIGSNDELAY);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* send_diag_sig *
|
||||
*===========================================================================*/
|
||||
void send_diag_sig(void)
|
||||
{
|
||||
/* Send a SIGKMESS signal to all processes in receiving updates about new
|
||||
* diagnostics messages.
|
||||
*/
|
||||
struct priv *privp;
|
||||
endpoint_t ep;
|
||||
|
||||
for (privp = BEG_PRIV_ADDR; privp < END_PRIV_ADDR; privp++) {
|
||||
if (privp->s_proc_nr != NONE && privp->s_diag_sig == TRUE) {
|
||||
ep = proc_addr(privp->s_proc_nr)->p_endpoint;
|
||||
send_sig(ep, SIGKMESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* clear_ipc *
|
||||
*===========================================================================*/
|
||||
|
||||
Reference in New Issue
Block a user