Fix nxstyle warning

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-01-21 15:25:37 +08:00
committed by Alin Jerpelea
parent 94da3e4c3a
commit 7f2317e90a
2 changed files with 15 additions and 11 deletions
+6 -5
View File
@@ -114,14 +114,15 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
} }
/* CASE 2: We are in an interrupt handler AND the interrupted task /* CASE 2: We are in an interrupt handler AND the interrupted task
* is the same as the one that must receive the signal, then we will * is the same as the one that must receive the signal, then we
* have to modify the return state as well as the state in the TCB. * will have to modify the return state as well as the state in the
* TCB.
* *
* Hmmm... there looks like a latent bug here: The following logic * Hmmm... there looks like a latent bug here: The following logic
* would fail in the strange case where we are in an interrupt * would fail in the strange case where we are in an interrupt
* handler, the thread is signalling itself, but a context switch to * handler, the thread is signalling itself, but a context switch
* another task has occurred so that g_current_regs does not refer to * to another task has occurred so that g_current_regs does not
* the thread of this_task()! * refer to the thread of this_task()!
*/ */
else else
@@ -106,20 +106,23 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
if (!g_current_regs) if (!g_current_regs)
{ {
/* In this case just deliver the signal with a function call now. */ /* In this case just deliver the signal with a function call
* now.
*/
sigdeliver(tcb); sigdeliver(tcb);
} }
/* CASE 2: We are in an interrupt handler AND the interrupted task /* CASE 2: We are in an interrupt handler AND the interrupted task
* is the same as the one that must receive the signal, then we will * is the same as the one that must receive the signal, then we
* have to modify the return state as well as the state in the TCB. * will have to modify the return state as well as the state in the
* TCB.
* *
* Hmmm... there looks like a latent bug here: The following logic * Hmmm... there looks like a latent bug here: The following logic
* would fail in the strange case where we are in an interrupt * would fail in the strange case where we are in an interrupt
* handler, the thread is signalling itself, but a context switch to * handler, the thread is signalling itself, but a context switch
* another task has occurred so that g_current_regs does not refer to * to another task has occurred so that g_current_regs does not
* the thread of this_task()! * refer to the thread of this_task()!
*/ */
else else