wangzhi16 opened a new pull request, #18192:
URL: https://github.com/apache/nuttx/pull/18192
Summary
-------
This change reorganizes signal delivery so that immediate delivery of a
pending signal for the current task (when not in interrupt context) is
performed in the common signal dispatch path rather than being handled as a
special-case inside architecture-specific `up_schedule_sigaction()`
implementations. In addition, many `up_schedule_sigaction()` implementations
were simplified to always prepare the task context for trampoline-based
signal delivery (save/duplicate register context and set up the trampoline
entry), removing duplicated special-case branches.
Key changes:
- Move immediate in-thread signal delivery into `nxsig_queue_action` /
`nxsig_tcbdispatch` path: when `stcb == this_task()` and not in interrupt
context, deliver the signal directly (leave critical section, call
`sigdeliver`, re-enter critical section and clear `sigdeliver`).
- Simplify and unify `up_schedule_sigaction()` across many architectures so
that they always prepare and duplicate the register context, set up the
architecture trampoline entry point, and copy/register state as needed.
- Remove per-arch special-case branches that delivered immediately from
inside `up_schedule_sigaction()`.
Files touched (representative):
- sched/signal/sig_dispatch.c
- arch/*/src/*_schedulesigaction.c (many architectures: renesas, sh1,
riscv, sparc, tricore, x86/i486/intel64, xtensa, z16, z80, etc.)
Impact
------
- Behavior: Functionally the intention is preserved (signals destined for
the current task are still delivered immediately when appropriate), but
the point of delivery has moved into the common signal-dispatch code.
This reduces duplication, centralizes locking behavior, and makes the
delivery path easier to reason about.
Testing
-------
armv7a:smp ostest PASS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]