Reduce the size of tcb by four bytes.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
This commit is contained in:
wangzhi16
2024-12-25 19:43:24 +08:00
committed by Xiang Xiao
parent 3b26c6df51
commit 893c5e92c2
70 changed files with 369 additions and 266 deletions
@@ -33,6 +33,7 @@
#include <nuttx/arch.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "ceva_internal.h"
#ifndef CONFIG_DISABLE_SIGNALS
@@ -100,8 +101,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
{
/* In this case just deliver the signal now. */
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
/* CASE 2: The task that needs to receive the signal is running.
+8 -10
View File
@@ -54,7 +54,6 @@ void ceva_sigdeliver(void)
{
struct tcb_s *rtcb = this_task();
uint32_t *regs = rtcb->xcp.saved_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
@@ -63,21 +62,20 @@ void ceva_sigdeliver(void)
int saved_errno = rtcb->pterrno;
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
/* Get a local copy of the sigdeliver function pointer. We do this so that
* we can nullify the sigdeliver function pointer in the TCB and accept
* more signal deliveries while processing the current pending signals.
/* We do this so that we can nullify the TCB_FLAG_SIGDELIVER in the TCB
* and accept more signal deliveries while processing the current pending
* signals.
*/
sigdeliver = rtcb->sigdeliver;
rtcb->sigdeliver = NULL;
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Deliver the signal */
sigdeliver(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original