signal: signal handler may cause task's state error

For example, task is blocked by nxsem_wait(sem1), use nxsem_wait(sem2)
in signal handler, and take sem2 successfully, after exit from signal
handler to task, nxsem_wait(sem1) returns OK, but the correct result
should be -EINTR.

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
This commit is contained in:
Zeng Zhaoxiu
2021-12-29 20:02:09 +08:00
committed by Masayuki Ishikawa
parent 9aa69168e4
commit fb43fd73ed
26 changed files with 13 additions and 221 deletions
-8
View File
@@ -56,13 +56,6 @@ void up_sigdeliver(void)
struct tcb_s *rtcb = this_task();
uint8_t regs[XCPTCONTEXT_SIZE];
/* Save the errno. This must be preserved throughout the signal handling
* so that the user code final gets the correct errno value (probably
* EINTR).
*/
int saved_errno = get_errno();
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
@@ -92,7 +85,6 @@ void up_sigdeliver(void)
sinfo("Resuming\n");
up_irq_save();
set_errno(saved_errno);
/* Modify the saved return state with the actual saved values in the
* TCB. This depends on the fact that nested signal handling is
@@ -57,13 +57,6 @@ void up_sigdeliver(void)
uint32_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the signal handling
* so that the user code final gets the correct errno value (probably
* EINTR).
*/
int saved_errno = get_errno();
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
@@ -104,7 +97,6 @@ void up_sigdeliver(void)
sinfo("Resuming\n");
up_irq_save();
set_errno(saved_errno);
/* Then restore the correct state for this thread of
* execution.
-8
View File
@@ -56,13 +56,6 @@ void up_sigdeliver(void)
struct tcb_s *rtcb = this_task();
uint32_t regs[XCPTCONTEXT_REGS];
/* Save the errno. This must be preserved throughout the signal handling
* so that the user code final gets the correct errno value (probably
* EINTR).
*/
int saved_errno = get_errno();
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
@@ -92,7 +85,6 @@ void up_sigdeliver(void)
sinfo("Resuming\n");
up_irq_save();
set_errno(saved_errno);
/* Modify the saved return state with the actual saved values in the
* TCB. This depends on the fact that nested signal handling is