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

View File

@@ -34,6 +34,7 @@
#include <nuttx/arch.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "x86_internal.h"
/****************************************************************************
@@ -91,8 +92,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: We are in an interrupt handler AND the interrupted task

View File

@@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "x86_internal.h"
/****************************************************************************
@@ -60,9 +61,9 @@ void x86_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
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);
/* Save the return state on the stack. */
@@ -78,7 +79,7 @@ void x86_sigdeliver(void)
/* Deliver the signals */
(rtcb->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
@@ -100,7 +101,10 @@ void x86_sigdeliver(void)
regs[REG_EIP] = rtcb->xcp.saved_eip;
regs[REG_EFLAGS] = rtcb->xcp.saved_eflags;
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of execution. */