From 8275a846b104137fe8c0f7bcf4e8a3e488a9f5b2 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Wed, 11 Sep 2024 17:42:46 +0800 Subject: [PATCH] arch: move sigdeliver to common code Signed-off-by: hujun5 --- arch/arm/include/arm/irq.h | 6 ------ arch/arm/include/armv6-m/irq.h | 6 ------ arch/arm/include/armv7-a/irq.h | 6 ------ arch/arm/include/armv7-m/irq.h | 6 ------ arch/arm/include/armv7-r/irq.h | 6 ------ arch/arm/include/armv8-m/irq.h | 6 ------ arch/arm/include/armv8-r/irq.h | 6 ------ arch/arm/include/tlsr82/irq.h | 6 ------ arch/arm/src/arm/arm_schedulesigaction.c | 6 +++--- arch/arm/src/arm/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv6-m/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv6-m/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv7-a/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv7-a/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv7-a/arm_syscall.c | 2 +- arch/arm/src/armv7-m/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv7-m/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv7-r/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv7-r/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv7-r/arm_syscall.c | 2 +- arch/arm/src/armv8-m/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv8-m/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv8-r/arm_schedulesigaction.c | 6 +++--- arch/arm/src/armv8-r/arm_sigdeliver.c | 8 ++++---- arch/arm/src/armv8-r/arm_syscall.c | 2 +- .../arm/src/tlsr82/tc32/tc32_schedulesigaction.c | 6 +++--- arch/arm64/include/irq.h | 6 ------ arch/arm64/src/common/arm64_schedulesigaction.c | 6 +++--- arch/arm64/src/common/arm64_sigdeliver.c | 8 ++++---- arch/avr/include/avr/irq.h | 6 ------ arch/avr/include/avr32/irq.h | 6 ------ arch/avr/src/avr/avr_schedulesigaction.c | 6 +++--- arch/avr/src/avr/avr_sigdeliver.c | 16 ++++++++-------- arch/avr/src/avr32/avr_initialstate.c | 2 +- arch/avr/src/avr32/avr_schedulesigaction.c | 6 +++--- arch/avr/src/avr32/avr_sigdeliver.c | 12 ++++++------ arch/ceva/include/xc5/irq.h | 6 ------ arch/ceva/include/xm6/irq.h | 6 ------ arch/ceva/src/common/ceva_schedulesigaction.c | 6 +++--- arch/ceva/src/common/ceva_sigdeliver.c | 8 ++++---- arch/mips/include/mips32/irq.h | 6 ------ arch/mips/src/mips32/mips_schedulesigaction.c | 6 +++--- arch/mips/src/mips32/mips_sigdeliver.c | 12 ++++++------ arch/misoc/include/lm32/irq.h | 6 ------ arch/misoc/include/minerva/irq.h | 6 ------ arch/misoc/src/lm32/lm32_schedulesigaction.c | 6 +++--- arch/misoc/src/lm32/lm32_sigdeliver.c | 12 ++++++------ .../src/minerva/minerva_schedulesigaction.c | 6 +++--- arch/misoc/src/minerva/minerva_sigdeliver.c | 8 ++++---- arch/or1k/include/mor1kx/irq.h | 6 ------ arch/or1k/src/common/or1k_schedulesigaction.c | 6 +++--- arch/renesas/include/m16c/irq.h | 6 ------ arch/renesas/include/rx65n/irq.h | 6 ------ arch/renesas/include/sh1/irq.h | 6 ------ arch/renesas/src/m16c/m16c_schedulesigaction.c | 6 +++--- arch/renesas/src/m16c/m16c_sigdeliver.c | 14 +++++++------- arch/renesas/src/rx65n/rx65n_schedulesigaction.c | 6 +++--- arch/renesas/src/rx65n/rx65n_sigdeliver.c | 8 ++++---- arch/renesas/src/sh1/sh1_schedulesigaction.c | 6 +++--- arch/renesas/src/sh1/sh1_sigdeliver.c | 12 ++++++------ arch/risc-v/include/irq.h | 6 ------ arch/risc-v/src/common/riscv_schedulesigaction.c | 6 +++--- arch/risc-v/src/common/riscv_sigdeliver.c | 8 ++++---- arch/sim/include/irq.h | 1 - arch/sim/src/sim/sim_schedulesigaction.c | 6 +++--- arch/sim/src/sim/sim_sigdeliver.c | 10 +++++----- arch/sparc/include/sparc_v8/irq.h | 6 ------ .../src/sparc_v8/sparc_v8_schedulesigaction.c | 12 ++++++------ arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c | 14 +++++++------- arch/tricore/include/tc3xx/irq.h | 6 ------ .../src/common/tricore_schedulesigaction.c | 6 +++--- arch/tricore/src/common/tricore_sigdeliver.c | 8 ++++---- arch/x86/include/i486/irq.h | 6 ------ arch/x86/src/i486/i486_schedulesigaction.c | 6 +++--- arch/x86/src/i486/i486_sigdeliver.c | 12 ++++++------ arch/x86_64/include/intel64/irq.h | 6 ------ .../src/intel64/intel64_schedulesigaction.c | 12 ++++++------ arch/x86_64/src/intel64/intel64_sigdeliver.c | 14 +++++++------- arch/xtensa/include/irq.h | 6 ------ arch/xtensa/src/common/xtensa_schedsigaction.c | 6 +++--- arch/xtensa/src/common/xtensa_sigdeliver.c | 8 ++++---- arch/z16/include/z16f/irq.h | 6 ------ arch/z16/src/common/z16_schedulesigaction.c | 6 +++--- arch/z16/src/common/z16_sigdeliver.c | 12 ++++++------ arch/z80/include/ez80/irq.h | 6 ------ arch/z80/include/z180/irq.h | 6 ------ arch/z80/include/z8/irq.h | 6 ------ arch/z80/include/z80/irq.h | 6 ------ arch/z80/src/ez80/ez80_schedulesigaction.c | 6 +++--- arch/z80/src/ez80/ez80_sigdeliver.c | 12 ++++++------ arch/z80/src/z180/z180_schedulesigaction.c | 6 +++--- arch/z80/src/z180/z180_sigdeliver.c | 12 ++++++------ arch/z80/src/z8/z8_schedulesigaction.c | 6 +++--- arch/z80/src/z8/z8_sigdeliver.c | 12 ++++++------ arch/z80/src/z80/z80_schedulesigaction.c | 6 +++--- arch/z80/src/z80/z80_sigdeliver.c | 12 ++++++------ include/nuttx/arch.h | 1 - include/nuttx/sched.h | 6 ++++++ 98 files changed, 259 insertions(+), 441 deletions(-) diff --git a/arch/arm/include/arm/irq.h b/arch/arm/include/arm/irq.h index a3321d7c62..246410e47d 100644 --- a/arch/arm/include/arm/irq.h +++ b/arch/arm/include/arm/irq.h @@ -127,12 +127,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv6-m/irq.h b/arch/arm/include/armv6-m/irq.h index 752e3ed394..6d142accfa 100644 --- a/arch/arm/include/armv6-m/irq.h +++ b/arch/arm/include/armv6-m/irq.h @@ -152,12 +152,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index 6ca190b071..803d5807d3 100644 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -253,12 +253,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv7-m/irq.h b/arch/arm/include/armv7-m/irq.h index 88db5d3ba3..c387899f60 100644 --- a/arch/arm/include/armv7-m/irq.h +++ b/arch/arm/include/armv7-m/irq.h @@ -212,12 +212,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv7-r/irq.h b/arch/arm/include/armv7-r/irq.h index 6a00fbdbc3..402606a546 100644 --- a/arch/arm/include/armv7-r/irq.h +++ b/arch/arm/include/armv7-r/irq.h @@ -253,12 +253,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv8-m/irq.h b/arch/arm/include/armv8-m/irq.h index f14d84f655..fb23d569b7 100644 --- a/arch/arm/include/armv8-m/irq.h +++ b/arch/arm/include/armv8-m/irq.h @@ -223,12 +223,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/armv8-r/irq.h b/arch/arm/include/armv8-r/irq.h index 360b4a7458..c3be8199f3 100644 --- a/arch/arm/include/armv8-r/irq.h +++ b/arch/arm/include/armv8-r/irq.h @@ -253,12 +253,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index 72cb08c9bf..c5c4161d51 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -158,12 +158,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved register array pointer used during * signal processing. */ diff --git a/arch/arm/src/arm/arm_schedulesigaction.c b/arch/arm/src/arm/arm_schedulesigaction.c index a0a4017bf4..2643eb3f0d 100644 --- a/arch/arm/src/arm/arm_schedulesigaction.c +++ b/arch/arm/src/arm/arm_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -97,7 +97,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* Otherwise, we are (1) signaling a task is not running diff --git a/arch/arm/src/arm/arm_sigdeliver.c b/arch/arm/src/arm/arm_sigdeliver.c index 21a0b98baa..22589d1e6e 100644 --- a/arch/arm/src/arm/arm_sigdeliver.c +++ b/arch/arm/src/arm/arm_sigdeliver.c @@ -59,8 +59,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); #ifndef CONFIG_SUPPRESS_INTERRUPTS /* Then make sure that interrupts are enabled. Signal handlers must always @@ -72,7 +72,7 @@ void arm_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -92,7 +92,7 @@ void arm_sigdeliver(void) * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv6-m/arm_schedulesigaction.c b/arch/arm/src/armv6-m/arm_schedulesigaction.c index 855dacdcc1..dfd5031bfd 100644 --- a/arch/arm/src/armv6-m/arm_schedulesigaction.c +++ b/arch/arm/src/armv6-m/arm_schedulesigaction.c @@ -85,9 +85,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -103,7 +103,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv6-m/arm_sigdeliver.c b/arch/arm/src/armv6-m/arm_sigdeliver.c index d8390b375c..fb039d57d8 100644 --- a/arch/arm/src/armv6-m/arm_sigdeliver.c +++ b/arch/arm/src/armv6-m/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -101,7 +101,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -148,7 +148,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index ef98b8e1a8..2727d545db 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -83,9 +83,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on this CPU. @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index e1777e5ae2..98ac0e115b 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -101,7 +101,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -148,7 +148,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index e2791e1817..8ad689db5a 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -430,7 +430,7 @@ uint32_t *arm_syscall(uint32_t *regs) /* Copy "info" into user stack */ - if (rtcb->xcp.sigdeliver) + if (rtcb->sigdeliver) { usp = rtcb->xcp.saved_regs[REG_SP]; } diff --git a/arch/arm/src/armv7-m/arm_schedulesigaction.c b/arch/arm/src/armv7-m/arm_schedulesigaction.c index c7cbf9a8d1..05da1b9d4e 100644 --- a/arch/arm/src/armv7-m/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-m/arm_schedulesigaction.c @@ -86,9 +86,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -104,7 +104,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv7-m/arm_sigdeliver.c b/arch/arm/src/armv7-m/arm_sigdeliver.c index 961ca31b59..524f2c445b 100644 --- a/arch/arm/src/armv7-m/arm_sigdeliver.c +++ b/arch/arm/src/armv7-m/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -105,7 +105,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -156,7 +156,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/arm/src/armv7-r/arm_schedulesigaction.c b/arch/arm/src/armv7-r/arm_schedulesigaction.c index b58ef10d26..f23262badf 100644 --- a/arch/arm/src/armv7-r/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-r/arm_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index c21b77ed10..2f72c1beee 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -101,7 +101,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -145,7 +145,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index d7dcdbcfe9..aa01170622 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -427,7 +427,7 @@ uint32_t *arm_syscall(uint32_t *regs) /* Copy "info" into user stack */ - if (rtcb->xcp.sigdeliver) + if (rtcb->sigdeliver) { usp = rtcb->xcp.saved_regs[REG_SP]; } diff --git a/arch/arm/src/armv8-m/arm_schedulesigaction.c b/arch/arm/src/armv8-m/arm_schedulesigaction.c index f13fa3dcf0..6c2c936275 100644 --- a/arch/arm/src/armv8-m/arm_schedulesigaction.c +++ b/arch/arm/src/armv8-m/arm_schedulesigaction.c @@ -86,9 +86,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -104,7 +104,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv8-m/arm_sigdeliver.c b/arch/arm/src/armv8-m/arm_sigdeliver.c index f8588136fb..2db03f17d1 100644 --- a/arch/arm/src/armv8-m/arm_sigdeliver.c +++ b/arch/arm/src/armv8-m/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -105,7 +105,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -156,7 +156,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/arm/src/armv8-r/arm_schedulesigaction.c b/arch/arm/src/armv8-r/arm_schedulesigaction.c index 099d313de5..77ee55430e 100644 --- a/arch/arm/src/armv8-r/arm_schedulesigaction.c +++ b/arch/arm/src/armv8-r/arm_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm/src/armv8-r/arm_sigdeliver.c b/arch/arm/src/armv8-r/arm_sigdeliver.c index e249869434..29a422040c 100644 --- a/arch/arm/src/armv8-r/arm_sigdeliver.c +++ b/arch/arm/src/armv8-r/arm_sigdeliver.c @@ -68,8 +68,8 @@ void arm_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -101,7 +101,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -145,7 +145,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv8-r/arm_syscall.c b/arch/arm/src/armv8-r/arm_syscall.c index 285613ed4b..abf3b191f4 100644 --- a/arch/arm/src/armv8-r/arm_syscall.c +++ b/arch/arm/src/armv8-r/arm_syscall.c @@ -426,7 +426,7 @@ uint32_t *arm_syscall(uint32_t *regs) /* Copy "info" into user stack */ - if (rtcb->xcp.sigdeliver) + if (rtcb->sigdeliver) { usp = rtcb->xcp.saved_regs[REG_SP]; } diff --git a/arch/arm/src/tlsr82/tc32/tc32_schedulesigaction.c b/arch/arm/src/tlsr82/tc32/tc32_schedulesigaction.c index 4e90afee3a..fcc2bdcc25 100644 --- a/arch/arm/src/tlsr82/tc32/tc32_schedulesigaction.c +++ b/arch/arm/src/tlsr82/tc32/tc32_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -97,7 +97,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* Otherwise, we are (1) signaling a task is not running diff --git a/arch/arm64/include/irq.h b/arch/arm64/include/irq.h index 19ed567ad1..2f721ad2e0 100644 --- a/arch/arm64/include/irq.h +++ b/arch/arm64/include/irq.h @@ -242,12 +242,6 @@ extern "C" struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - #ifdef CONFIG_BUILD_KERNEL /* This is the saved address to use when returning from a user-space * signal handler. diff --git a/arch/arm64/src/common/arm64_schedulesigaction.c b/arch/arm64/src/common/arm64_schedulesigaction.c index ce145980df..05c5725bb4 100644 --- a/arch/arm64/src/common/arm64_schedulesigaction.c +++ b/arch/arm64/src/common/arm64_schedulesigaction.c @@ -118,9 +118,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -133,7 +133,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/arm64/src/common/arm64_sigdeliver.c b/arch/arm64/src/common/arm64_sigdeliver.c index 0d46a98410..2a0fdd65cc 100644 --- a/arch/arm64/src/common/arm64_sigdeliver.c +++ b/arch/arm64/src/common/arm64_sigdeliver.c @@ -70,8 +70,8 @@ void arm64_sigdeliver(void) #endif sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -103,7 +103,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -150,7 +150,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ rtcb->xcp.regs = rtcb->xcp.saved_reg; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/avr/include/avr/irq.h b/arch/avr/include/avr/irq.h index a0df8a95e2..df9a82dbae 100644 --- a/arch/avr/include/avr/irq.h +++ b/arch/avr/include/avr/irq.h @@ -93,12 +93,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of PC and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/avr/include/avr32/irq.h b/arch/avr/include/avr32/irq.h index 755d9086ce..ed8e064bc6 100644 --- a/arch/avr/include/avr32/irq.h +++ b/arch/avr/include/avr32/irq.h @@ -93,12 +93,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of PC and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/avr/src/avr/avr_schedulesigaction.c b/arch/avr/src/avr/avr_schedulesigaction.c index 251556aa91..bf00b6c943 100644 --- a/arch/avr/src/avr/avr_schedulesigaction.c +++ b/arch/avr/src/avr/avr_schedulesigaction.c @@ -83,9 +83,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -104,7 +104,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/avr/src/avr/avr_sigdeliver.c b/arch/avr/src/avr/avr_sigdeliver.c index 24b56fc8ee..be1093bcfb 100644 --- a/arch/avr/src/avr/avr_sigdeliver.c +++ b/arch/avr/src/avr/avr_sigdeliver.c @@ -59,8 +59,8 @@ void avr_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -76,7 +76,7 @@ void avr_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -96,13 +96,13 @@ void avr_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_PC0] = rtcb->xcp.saved_pc0; - regs[REG_PC1] = rtcb->xcp.saved_pc1; + regs[REG_PC0] = rtcb->xcp.saved_pc0; + regs[REG_PC1] = rtcb->xcp.saved_pc1; #if defined(REG_PC2) - regs[REG_PC2] = rtcb->xcp.saved_pc2; + regs[REG_PC2] = rtcb->xcp.saved_pc2; #endif - regs[REG_SREG] = rtcb->xcp.saved_sreg; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_SREG] = rtcb->xcp.saved_sreg; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. This is an * unusual case that must be handled by up_fullcontextresore. This case is diff --git a/arch/avr/src/avr32/avr_initialstate.c b/arch/avr/src/avr32/avr_initialstate.c index a48315678e..14e9886a4c 100644 --- a/arch/avr/src/avr32/avr_initialstate.c +++ b/arch/avr/src/avr32/avr_initialstate.c @@ -87,7 +87,7 @@ void up_initial_state(struct tcb_s *tcb) #else /* No pending signal delivery */ - xcp->sigdeliver = NULL; + tcb->sigdeliver = NULL; /* Clear the frame pointer and link register since this is the outermost * frame. diff --git a/arch/avr/src/avr32/avr_schedulesigaction.c b/arch/avr/src/avr32/avr_schedulesigaction.c index 0a84063baa..294bd31bcc 100644 --- a/arch/avr/src/avr32/avr_schedulesigaction.c +++ b/arch/avr/src/avr32/avr_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -102,7 +102,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/avr/src/avr32/avr_sigdeliver.c b/arch/avr/src/avr32/avr_sigdeliver.c index ca81e807ce..331ac29fd6 100644 --- a/arch/avr/src/avr32/avr_sigdeliver.c +++ b/arch/avr/src/avr32/avr_sigdeliver.c @@ -63,8 +63,8 @@ void avr_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -80,7 +80,7 @@ void avr_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -100,9 +100,9 @@ void avr_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_PC] = rtcb->xcp.saved_pc; - regs[REG_SR] = rtcb->xcp.saved_sr; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_PC] = rtcb->xcp.saved_pc; + regs[REG_SR] = rtcb->xcp.saved_sr; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. This is an * unusual case that must be handled by up_fullcontextresore. This case is diff --git a/arch/ceva/include/xc5/irq.h b/arch/ceva/include/xc5/irq.h index cf77787e0a..0d413daccb 100644 --- a/arch/ceva/include/xc5/irq.h +++ b/arch/ceva/include/xc5/irq.h @@ -127,12 +127,6 @@ struct xcpt_syscall_s struct xcptcontext { #ifndef CONFIG_DISABLE_SIGNALS - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/ceva/include/xm6/irq.h b/arch/ceva/include/xm6/irq.h index 0a735828ec..44732f3d9e 100644 --- a/arch/ceva/include/xm6/irq.h +++ b/arch/ceva/include/xm6/irq.h @@ -130,12 +130,6 @@ struct xcpt_syscall_s struct xcptcontext { #ifndef CONFIG_DISABLE_SIGNALS - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/ceva/src/common/ceva_schedulesigaction.c b/arch/ceva/src/common/ceva_schedulesigaction.c index 2eea396b0b..7f79d23341 100644 --- a/arch/ceva/src/common/ceva_schedulesigaction.c +++ b/arch/ceva/src/common/ceva_schedulesigaction.c @@ -79,9 +79,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -107,7 +107,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: The task that needs to receive the signal is running. diff --git a/arch/ceva/src/common/ceva_sigdeliver.c b/arch/ceva/src/common/ceva_sigdeliver.c index 3bf25abdff..9d0deb4bf3 100644 --- a/arch/ceva/src/common/ceva_sigdeliver.c +++ b/arch/ceva/src/common/ceva_sigdeliver.c @@ -62,16 +62,16 @@ void ceva_sigdeliver(void) int saved_errno = rtcb->pterrno; sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* 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. */ - sigdeliver = (sig_deliver_t)rtcb->xcp.sigdeliver; - rtcb->xcp.sigdeliver = NULL; + sigdeliver = rtcb->sigdeliver; + rtcb->sigdeliver = NULL; /* Deliver the signal */ diff --git a/arch/mips/include/mips32/irq.h b/arch/mips/include/mips32/irq.h index 228f95a565..031ba4fe2b 100644 --- a/arch/mips/include/mips32/irq.h +++ b/arch/mips/include/mips32/irq.h @@ -321,12 +321,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-NULL if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These additional register save locations are used to implement the * signal delivery trampoline. * diff --git a/arch/mips/src/mips32/mips_schedulesigaction.c b/arch/mips/src/mips32/mips_schedulesigaction.c index acbb8318fb..7d1cd3a9ee 100644 --- a/arch/mips/src/mips32/mips_schedulesigaction.c +++ b/arch/mips/src/mips32/mips_schedulesigaction.c @@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -105,7 +105,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/mips/src/mips32/mips_sigdeliver.c b/arch/mips/src/mips32/mips_sigdeliver.c index ea810a5638..d942689c91 100644 --- a/arch/mips/src/mips32/mips_sigdeliver.c +++ b/arch/mips/src/mips32/mips_sigdeliver.c @@ -61,8 +61,8 @@ void mips_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -78,7 +78,7 @@ void mips_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -100,9 +100,9 @@ void mips_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_EPC] = rtcb->xcp.saved_epc; - regs[REG_STATUS] = rtcb->xcp.saved_status; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_EPC] = rtcb->xcp.saved_epc; + regs[REG_STATUS] = rtcb->xcp.saved_status; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/misoc/include/lm32/irq.h b/arch/misoc/include/lm32/irq.h index 69bdd8a271..799cba3d5d 100644 --- a/arch/misoc/include/lm32/irq.h +++ b/arch/misoc/include/lm32/irq.h @@ -179,12 +179,6 @@ struct xcptcontext { - /* The following function pointer is non-NULL if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These additional register save locations are used to implement the * signal delivery trampoline. * diff --git a/arch/misoc/include/minerva/irq.h b/arch/misoc/include/minerva/irq.h index 4b81cec281..c34c49861e 100644 --- a/arch/misoc/include/minerva/irq.h +++ b/arch/misoc/include/minerva/irq.h @@ -261,12 +261,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-NULL if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These additional register save locations are used to implement the * signal delivery trampoline. */ diff --git a/arch/misoc/src/lm32/lm32_schedulesigaction.c b/arch/misoc/src/lm32/lm32_schedulesigaction.c index afc8edafe8..f694a22e45 100644 --- a/arch/misoc/src/lm32/lm32_schedulesigaction.c +++ b/arch/misoc/src/lm32/lm32_schedulesigaction.c @@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -102,7 +102,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/misoc/src/lm32/lm32_sigdeliver.c b/arch/misoc/src/lm32/lm32_sigdeliver.c index 4adc849559..081f40d6e3 100644 --- a/arch/misoc/src/lm32/lm32_sigdeliver.c +++ b/arch/misoc/src/lm32/lm32_sigdeliver.c @@ -60,8 +60,8 @@ void lm32_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -77,7 +77,7 @@ void lm32_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -99,9 +99,9 @@ void lm32_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_EPC] = rtcb->xcp.saved_epc; - regs[REG_INT_CTX] = rtcb->xcp.saved_int_ctx; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_EPC] = rtcb->xcp.saved_epc; + regs[REG_INT_CTX] = rtcb->xcp.saved_int_ctx; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/misoc/src/minerva/minerva_schedulesigaction.c b/arch/misoc/src/minerva/minerva_schedulesigaction.c index e0f2509aff..02a02952e5 100644 --- a/arch/misoc/src/minerva/minerva_schedulesigaction.c +++ b/arch/misoc/src/minerva/minerva_schedulesigaction.c @@ -82,9 +82,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -103,7 +103,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/misoc/src/minerva/minerva_sigdeliver.c b/arch/misoc/src/minerva/minerva_sigdeliver.c index ac2603f504..306a1a77df 100644 --- a/arch/misoc/src/minerva/minerva_sigdeliver.c +++ b/arch/misoc/src/minerva/minerva_sigdeliver.c @@ -62,8 +62,8 @@ void minerva_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the real return state on the stack. */ @@ -76,8 +76,8 @@ void minerva_sigdeliver(void) * more signal deliveries while processing the current pending signals. */ - sigdeliver = rtcb->xcp.sigdeliver; - rtcb->xcp.sigdeliver = NULL; + sigdeliver = rtcb->sigdeliver; + rtcb->sigdeliver = NULL; # ifndef CONFIG_SUPPRESS_INTERRUPTS /* Then make sure that interrupts are enabled. Signal handlers must always diff --git a/arch/or1k/include/mor1kx/irq.h b/arch/or1k/include/mor1kx/irq.h index ba1e5f736b..f45e5949ed 100644 --- a/arch/or1k/include/mor1kx/irq.h +++ b/arch/or1k/include/mor1kx/irq.h @@ -170,12 +170,6 @@ struct xcptcontext uint32_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of LR and CPSR used during * signal processing. * diff --git a/arch/or1k/src/common/or1k_schedulesigaction.c b/arch/or1k/src/common/or1k_schedulesigaction.c index 9ee20473d8..00e8944f6f 100644 --- a/arch/or1k/src/common/or1k_schedulesigaction.c +++ b/arch/or1k/src/common/or1k_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/renesas/include/m16c/irq.h b/arch/renesas/include/m16c/irq.h index 5b66067746..f06aae80d8 100644 --- a/arch/renesas/include/m16c/irq.h +++ b/arch/renesas/include/m16c/irq.h @@ -228,12 +228,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of LR and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/renesas/include/rx65n/irq.h b/arch/renesas/include/rx65n/irq.h index 649af4ea43..42c5f62dd0 100644 --- a/arch/renesas/include/rx65n/irq.h +++ b/arch/renesas/include/rx65n/irq.h @@ -986,12 +986,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of LR and SR used during signal processing. */ uint32_t saved_pc; diff --git a/arch/renesas/include/sh1/irq.h b/arch/renesas/include/sh1/irq.h index 6ce374cf68..2f45b100bf 100644 --- a/arch/renesas/include/sh1/irq.h +++ b/arch/renesas/include/sh1/irq.h @@ -449,12 +449,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of LR and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/renesas/src/m16c/m16c_schedulesigaction.c b/arch/renesas/src/m16c/m16c_schedulesigaction.c index 8217b0e7d4..6f6d879c2c 100644 --- a/arch/renesas/src/m16c/m16c_schedulesigaction.c +++ b/arch/renesas/src/m16c/m16c_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/renesas/src/m16c/m16c_sigdeliver.c b/arch/renesas/src/m16c/m16c_sigdeliver.c index 52cd6703af..9fe660a59e 100644 --- a/arch/renesas/src/m16c/m16c_sigdeliver.c +++ b/arch/renesas/src/m16c/m16c_sigdeliver.c @@ -58,8 +58,8 @@ void renesas_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -75,7 +75,7 @@ void renesas_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)sig_rtcb->xcp.sigdeliver)(rtcb); + (sig_rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -95,10 +95,10 @@ void renesas_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_PC] = rtcb->xcp.saved_pc[0]; - regs[REG_PC + 1] = rtcb->xcp.saved_pc[1]; - regs[REG_FLG] = rtcb->xcp.saved_flg; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_PC] = rtcb->xcp.saved_pc[0]; + regs[REG_PC + 1] = rtcb->xcp.saved_pc[1]; + regs[REG_FLG] = rtcb->xcp.saved_flg; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/renesas/src/rx65n/rx65n_schedulesigaction.c b/arch/renesas/src/rx65n/rx65n_schedulesigaction.c index 7798d47258..3956a41844 100644 --- a/arch/renesas/src/rx65n/rx65n_schedulesigaction.c +++ b/arch/renesas/src/rx65n/rx65n_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/renesas/src/rx65n/rx65n_sigdeliver.c b/arch/renesas/src/rx65n/rx65n_sigdeliver.c index 5c8d50b109..d18f632f46 100644 --- a/arch/renesas/src/rx65n/rx65n_sigdeliver.c +++ b/arch/renesas/src/rx65n/rx65n_sigdeliver.c @@ -60,8 +60,8 @@ void renesas_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the real return state on the stack. */ @@ -75,8 +75,8 @@ void renesas_sigdeliver(void) * signals. */ - sigdeliver = rtcb->xcp.sigdeliver; - rtcb->xcp.sigdeliver = NULL; + sigdeliver = rtcb->sigdeliver; + rtcb->sigdeliver = NULL; #ifndef CONFIG_SUPPRESS_INTERRUPTS /* Then make sure that interrupts are enabled. Signal handlers must always diff --git a/arch/renesas/src/sh1/sh1_schedulesigaction.c b/arch/renesas/src/sh1/sh1_schedulesigaction.c index 8c020741f3..94b9c39dfb 100644 --- a/arch/renesas/src/sh1/sh1_schedulesigaction.c +++ b/arch/renesas/src/sh1/sh1_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/renesas/src/sh1/sh1_sigdeliver.c b/arch/renesas/src/sh1/sh1_sigdeliver.c index d32166906c..48b2cc7f5d 100644 --- a/arch/renesas/src/sh1/sh1_sigdeliver.c +++ b/arch/renesas/src/sh1/sh1_sigdeliver.c @@ -58,8 +58,8 @@ void renesas_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -75,7 +75,7 @@ void renesas_sigdeliver(void) /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -95,9 +95,9 @@ void renesas_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_PC] = rtcb->xcp.saved_pc; - regs[REG_SR] = rtcb->xcp.saved_sr; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_PC] = rtcb->xcp.saved_pc; + regs[REG_SR] = rtcb->xcp.saved_sr; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/risc-v/include/irq.h b/arch/risc-v/include/irq.h index cd2665cd88..ea47dbe31e 100644 --- a/arch/risc-v/include/irq.h +++ b/arch/risc-v/include/irq.h @@ -567,12 +567,6 @@ struct xcptcontext { - /* The following function pointer is non-NULL if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These additional register save locations are used to implement the * signal delivery trampoline. * diff --git a/arch/risc-v/src/common/riscv_schedulesigaction.c b/arch/risc-v/src/common/riscv_schedulesigaction.c index cb4263e8bd..2b5fe178fb 100644 --- a/arch/risc-v/src/common/riscv_schedulesigaction.c +++ b/arch/risc-v/src/common/riscv_schedulesigaction.c @@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/risc-v/src/common/riscv_sigdeliver.c b/arch/risc-v/src/common/riscv_sigdeliver.c index a9d63a66b3..3d8e8f8841 100644 --- a/arch/risc-v/src/common/riscv_sigdeliver.c +++ b/arch/risc-v/src/common/riscv_sigdeliver.c @@ -69,8 +69,8 @@ void riscv_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -102,7 +102,7 @@ retry: /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -147,7 +147,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/sim/include/irq.h b/arch/sim/include/irq.h index 1b2d31b024..af25d57f5d 100644 --- a/arch/sim/include/irq.h +++ b/arch/sim/include/irq.h @@ -51,7 +51,6 @@ struct xcptcontext { - void *sigdeliver; /* Actual type is sig_deliver_t */ jmp_buf regs; }; diff --git a/arch/sim/src/sim/sim_schedulesigaction.c b/arch/sim/src/sim/sim_schedulesigaction.c index 4e6ab46831..c485dc538d 100644 --- a/arch/sim/src/sim/sim_schedulesigaction.c +++ b/arch/sim/src/sim/sim_schedulesigaction.c @@ -83,13 +83,13 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) flags = enter_critical_section(); - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; if (tcb == this_task()) { sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } } diff --git a/arch/sim/src/sim/sim_sigdeliver.c b/arch/sim/src/sim/sim_sigdeliver.c index eca8c3bf91..238599c757 100644 --- a/arch/sim/src/sim/sim_sigdeliver.c +++ b/arch/sim/src/sim/sim_sigdeliver.c @@ -61,7 +61,7 @@ void sim_sigdeliver(void) int16_t saved_irqcount; irqstate_t flags; #endif - if (NULL == (rtcb->xcp.sigdeliver)) + if (NULL == (rtcb->sigdeliver)) { return; } @@ -75,8 +75,8 @@ void sim_sigdeliver(void) #endif sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* NOTE: we do not save the return state for sim */ @@ -103,7 +103,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -135,7 +135,7 @@ retry: /* Allows next handler to be scheduled */ - rtcb->xcp.sigdeliver = NULL; + rtcb->sigdeliver = NULL; /* NOTE: we leave a critical section here for sim */ diff --git a/arch/sparc/include/sparc_v8/irq.h b/arch/sparc/include/sparc_v8/irq.h index fa5c77b362..527f756a7c 100644 --- a/arch/sparc/include/sparc_v8/irq.h +++ b/arch/sparc/include/sparc_v8/irq.h @@ -427,12 +427,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-NULL if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These additional register save locations are used to implement the * signal delivery trampoline. * diff --git a/arch/sparc/src/sparc_v8/sparc_v8_schedulesigaction.c b/arch/sparc/src/sparc_v8/sparc_v8_schedulesigaction.c index 2f50eb3972..aa78155e81 100644 --- a/arch/sparc/src/sparc_v8/sparc_v8_schedulesigaction.c +++ b/arch/sparc/src/sparc_v8/sparc_v8_schedulesigaction.c @@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -105,7 +105,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the @@ -193,9 +193,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -219,7 +219,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: The task that needs to receive the signal is running. diff --git a/arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c b/arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c index 06fa3c5b77..69caac640e 100644 --- a/arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c +++ b/arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c @@ -77,8 +77,8 @@ void sparc_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -114,7 +114,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -163,10 +163,10 @@ retry: * could be modified by a hostile program. */ - regs[REG_PC] = rtcb->xcp.saved_pc; - regs[REG_NPC] = rtcb->xcp.saved_npc; - regs[REG_PSR] = rtcb->xcp.saved_status; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_PC] = rtcb->xcp.saved_pc; + regs[REG_NPC] = rtcb->xcp.saved_npc; + regs[REG_PSR] = rtcb->xcp.saved_status; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ #ifdef CONFIG_SMP /* Restore the saved 'irqcount' and recover the critical section diff --git a/arch/tricore/include/tc3xx/irq.h b/arch/tricore/include/tc3xx/irq.h index 7b0394fd4e..39b35ba97a 100644 --- a/arch/tricore/include/tc3xx/irq.h +++ b/arch/tricore/include/tc3xx/irq.h @@ -116,12 +116,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of the context used during * signal processing. */ diff --git a/arch/tricore/src/common/tricore_schedulesigaction.c b/arch/tricore/src/common/tricore_schedulesigaction.c index 7b82a95746..ef9eae0135 100644 --- a/arch/tricore/src/common/tricore_schedulesigaction.c +++ b/arch/tricore/src/common/tricore_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the diff --git a/arch/tricore/src/common/tricore_sigdeliver.c b/arch/tricore/src/common/tricore_sigdeliver.c index 9888597b9b..e06ac8d046 100644 --- a/arch/tricore/src/common/tricore_sigdeliver.c +++ b/arch/tricore/src/common/tricore_sigdeliver.c @@ -59,8 +59,8 @@ void tricore_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: @@ -74,7 +74,7 @@ retry: /* Deliver the signal */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -106,7 +106,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of * execution. diff --git a/arch/x86/include/i486/irq.h b/arch/x86/include/i486/irq.h index ce6c58bade..144618fa46 100644 --- a/arch/x86/include/i486/irq.h +++ b/arch/x86/include/i486/irq.h @@ -151,12 +151,6 @@ #ifndef __ASSEMBLY__ struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of instruction pointer and EFLAGS used during * signal processing. * diff --git a/arch/x86/src/i486/i486_schedulesigaction.c b/arch/x86/src/i486/i486_schedulesigaction.c index 30770529ec..1638583d53 100644 --- a/arch/x86/src/i486/i486_schedulesigaction.c +++ b/arch/x86/src/i486/i486_schedulesigaction.c @@ -76,9 +76,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -97,7 +97,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/x86/src/i486/i486_sigdeliver.c b/arch/x86/src/i486/i486_sigdeliver.c index 9ddf0ace41..48ef001468 100644 --- a/arch/x86/src/i486/i486_sigdeliver.c +++ b/arch/x86/src/i486/i486_sigdeliver.c @@ -59,8 +59,8 @@ void x86_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -76,7 +76,7 @@ void x86_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -96,9 +96,9 @@ void x86_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_EIP] = rtcb->xcp.saved_eip; - regs[REG_EFLAGS] = rtcb->xcp.saved_eflags; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_EIP] = rtcb->xcp.saved_eip; + regs[REG_EFLAGS] = rtcb->xcp.saved_eflags; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/x86_64/include/intel64/irq.h b/arch/x86_64/include/intel64/irq.h index fbcdf54500..d7ed0b2668 100644 --- a/arch/x86_64/include/intel64/irq.h +++ b/arch/x86_64/include/intel64/irq.h @@ -487,12 +487,6 @@ enum ioapic_trigger_mode struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of instruction pointer and EFLAGS used during * signal processing. */ diff --git a/arch/x86_64/src/intel64/intel64_schedulesigaction.c b/arch/x86_64/src/intel64/intel64_schedulesigaction.c index 03b5ecae19..2923c75d1e 100644 --- a/arch/x86_64/src/intel64/intel64_schedulesigaction.c +++ b/arch/x86_64/src/intel64/intel64_schedulesigaction.c @@ -78,9 +78,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task @@ -178,9 +178,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -205,7 +205,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: The task that needs to receive the signal is running. diff --git a/arch/x86_64/src/intel64/intel64_sigdeliver.c b/arch/x86_64/src/intel64/intel64_sigdeliver.c index a7f5763b42..5701291820 100644 --- a/arch/x86_64/src/intel64/intel64_sigdeliver.c +++ b/arch/x86_64/src/intel64/intel64_sigdeliver.c @@ -69,8 +69,8 @@ void x86_64_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Align regs to 64 byte boundary for XSAVE */ @@ -113,7 +113,7 @@ void x86_64_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -138,10 +138,10 @@ void x86_64_sigdeliver(void) * could be modified by a hostile program. */ - regs[REG_RIP] = rtcb->xcp.saved_rip; - regs[REG_RSP] = rtcb->xcp.saved_rsp; - regs[REG_RFLAGS] = rtcb->xcp.saved_rflags; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[REG_RIP] = rtcb->xcp.saved_rip; + regs[REG_RSP] = rtcb->xcp.saved_rsp; + regs[REG_RFLAGS] = rtcb->xcp.saved_rflags; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ #ifdef CONFIG_SMP /* Restore the saved 'irqcount' and recover the critical section diff --git a/arch/xtensa/include/irq.h b/arch/xtensa/include/irq.h index 21ce8f20f4..8fc4ff1887 100644 --- a/arch/xtensa/include/irq.h +++ b/arch/xtensa/include/irq.h @@ -178,12 +178,6 @@ struct xcpt_syscall_s struct xcptcontext { - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - void *sigdeliver; /* Actual type is sig_deliver_t */ - /* These are saved copies of registers used during signal processing. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/xtensa/src/common/xtensa_schedsigaction.c b/arch/xtensa/src/common/xtensa_schedsigaction.c index 591c70ade2..e021f14ca1 100644 --- a/arch/xtensa/src/common/xtensa_schedsigaction.c +++ b/arch/xtensa/src/common/xtensa_schedsigaction.c @@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to task that is currently executing on any CPU. @@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } else { diff --git a/arch/xtensa/src/common/xtensa_sigdeliver.c b/arch/xtensa/src/common/xtensa_sigdeliver.c index 97c4f3ded9..3ea04d3099 100644 --- a/arch/xtensa/src/common/xtensa_sigdeliver.c +++ b/arch/xtensa/src/common/xtensa_sigdeliver.c @@ -68,8 +68,8 @@ void xtensa_sig_deliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); retry: #ifdef CONFIG_SMP @@ -102,7 +102,7 @@ retry: /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -146,7 +146,7 @@ retry: * could be modified by a hostile program. */ - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z16/include/z16f/irq.h b/arch/z16/include/z16f/irq.h index 4a2be42ed4..0782cefe39 100644 --- a/arch/z16/include/z16f/irq.h +++ b/arch/z16/include/z16f/irq.h @@ -165,12 +165,6 @@ struct xcptcontext uint16_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - CODE void *sigdeliver; /* Actual type is sig_deliver_t */ - /* The following retains that state during signal execution. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/z16/src/common/z16_schedulesigaction.c b/arch/z16/src/common/z16_schedulesigaction.c index ca8f6bcb15..3c063c4b83 100644 --- a/arch/z16/src/common/z16_schedulesigaction.c +++ b/arch/z16/src/common/z16_schedulesigaction.c @@ -80,9 +80,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) + if (!tcb->sigdeliver) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is * being delivered to the currently executing task. @@ -101,7 +101,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted diff --git a/arch/z16/src/common/z16_sigdeliver.c b/arch/z16/src/common/z16_sigdeliver.c index 68e17b0afd..f0d037c8d7 100644 --- a/arch/z16/src/common/z16_sigdeliver.c +++ b/arch/z16/src/common/z16_sigdeliver.c @@ -60,8 +60,8 @@ void z16_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -77,7 +77,7 @@ void z16_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -97,9 +97,9 @@ void z16_sigdeliver(void) * could be modified by a hostile program. */ - regs32[REG_PC / 2] = rtcb->xcp.saved_pc; - regs[REG_FLAGS] = rtcb->xcp.saved_i; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs32[REG_PC / 2] = rtcb->xcp.saved_pc; + regs[REG_FLAGS] = rtcb->xcp.saved_i; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/include/ez80/irq.h b/arch/z80/include/ez80/irq.h index 351f6f94c1..83f3bed2ff 100644 --- a/arch/z80/include/ez80/irq.h +++ b/arch/z80/include/ez80/irq.h @@ -246,12 +246,6 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - CODE void *sigdeliver; /* Actual type is sig_deliver_t */ - /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/z80/include/z180/irq.h b/arch/z80/include/z180/irq.h index 3fb3b25cd0..125422714a 100644 --- a/arch/z80/include/z180/irq.h +++ b/arch/z80/include/z180/irq.h @@ -173,12 +173,6 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - CODE void *sigdeliver; /* Actual type is sig_deliver_t */ - /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index b50fe0f04c..7faff99d00 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -304,12 +304,6 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - CODE void *sigdeliver; /* Actual type is sig_deliver_t */ - /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h index 861fbb2822..e0308d9707 100644 --- a/arch/z80/include/z80/irq.h +++ b/arch/z80/include/z80/irq.h @@ -88,12 +88,6 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; - /* The following function pointer is non-zero if there - * are pending signals to be processed. - */ - - CODE void *sigdeliver; /* Actual type is sig_deliver_t */ - /* The following retains that state during signal execution. * * REVISIT: Because there is only one copy of these save areas, diff --git a/arch/z80/src/ez80/ez80_schedulesigaction.c b/arch/z80/src/ez80/ez80_schedulesigaction.c index d0d0be93b9..214a3e49f6 100644 --- a/arch/z80/src/ez80/ez80_schedulesigaction.c +++ b/arch/z80/src/ez80/ez80_schedulesigaction.c @@ -105,9 +105,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -124,7 +124,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c index cff88ad2e3..3047267075 100644 --- a/arch/z80/src/ez80/ez80_sigdeliver.c +++ b/arch/z80/src/ez80/ez80_sigdeliver.c @@ -61,8 +61,8 @@ void z80_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -78,7 +78,7 @@ void z80_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -98,9 +98,9 @@ void z80_sigdeliver(void) * could be modified by a hostile program. */ - regs[XCPT_PC] = rtcb->xcp.saved_pc; - regs[XCPT_I] = rtcb->xcp.saved_i; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[XCPT_PC] = rtcb->xcp.saved_pc; + regs[XCPT_I] = rtcb->xcp.saved_i; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Modify the saved return state with the actual saved values in the * TCB. This depends on the fact that nested signal handling is diff --git a/arch/z80/src/z180/z180_schedulesigaction.c b/arch/z80/src/z180/z180_schedulesigaction.c index 21f40053b5..a72aa770f2 100644 --- a/arch/z80/src/z180/z180_schedulesigaction.c +++ b/arch/z80/src/z180/z180_schedulesigaction.c @@ -108,9 +108,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -127,7 +127,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/z80/src/z180/z180_sigdeliver.c b/arch/z80/src/z180/z180_sigdeliver.c index 10979e6515..7bebc5e4c6 100644 --- a/arch/z80/src/z180/z180_sigdeliver.c +++ b/arch/z80/src/z180/z180_sigdeliver.c @@ -58,8 +58,8 @@ void z80_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -75,7 +75,7 @@ void z80_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -95,9 +95,9 @@ void z80_sigdeliver(void) * could be modified by a hostile program. */ - regs[XCPT_PC] = rtcb->xcp.saved_pc; - regs[XCPT_I] = rtcb->xcp.saved_i; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[XCPT_PC] = rtcb->xcp.saved_pc; + regs[XCPT_I] = rtcb->xcp.saved_i; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/src/z8/z8_schedulesigaction.c b/arch/z80/src/z8/z8_schedulesigaction.c index b018bbe3aa..8731db67d2 100644 --- a/arch/z80/src/z8/z8_schedulesigaction.c +++ b/arch/z80/src/z8/z8_schedulesigaction.c @@ -105,9 +105,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -124,7 +124,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/z80/src/z8/z8_sigdeliver.c b/arch/z80/src/z8/z8_sigdeliver.c index 3c93c08536..2c13db2e0c 100644 --- a/arch/z80/src/z8/z8_sigdeliver.c +++ b/arch/z80/src/z8/z8_sigdeliver.c @@ -77,8 +77,8 @@ void z80_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -94,7 +94,7 @@ void z80_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -114,9 +114,9 @@ void z80_sigdeliver(void) * could be modified by a hostile program. */ - regs[XCPT_PC] = rtcb->xcp.saved_pc; - regs[XCPT_IRQCTL] = rtcb->xcp.saved_irqctl; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[XCPT_PC] = rtcb->xcp.saved_pc; + regs[XCPT_IRQCTL] = rtcb->xcp.saved_irqctl; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/src/z80/z80_schedulesigaction.c b/arch/z80/src/z80/z80_schedulesigaction.c index 4bfba686db..2a3a016859 100644 --- a/arch/z80/src/z80/z80_schedulesigaction.c +++ b/arch/z80/src/z80/z80_schedulesigaction.c @@ -106,9 +106,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Refuse to handle nested signal actions */ - if (tcb->xcp.sigdeliver == NULL) + if (tcb->sigdeliver == NULL) { - tcb->xcp.sigdeliver = sigdeliver; + tcb->sigdeliver = sigdeliver; /* First, handle some special cases when the signal is being delivered * to the currently executing task. @@ -125,7 +125,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) /* In this case just deliver the signal now. */ sigdeliver(tcb); - tcb->xcp.sigdeliver = NULL; + tcb->sigdeliver = NULL; } /* CASE 2: We are in an interrupt handler AND the interrupted task diff --git a/arch/z80/src/z80/z80_sigdeliver.c b/arch/z80/src/z80/z80_sigdeliver.c index 3d793cadc7..ce2a6d9cbb 100644 --- a/arch/z80/src/z80/z80_sigdeliver.c +++ b/arch/z80/src/z80/z80_sigdeliver.c @@ -58,8 +58,8 @@ void z80_sigdeliver(void) board_autoled_on(LED_SIGNAL); sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", - rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); - DEBUGASSERT(rtcb->xcp.sigdeliver != NULL); + rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head); + DEBUGASSERT(rtcb->sigdeliver != NULL); /* Save the return state on the stack. */ @@ -75,7 +75,7 @@ void z80_sigdeliver(void) /* Deliver the signals */ - ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); + (rtcb->sigdeliver)(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original @@ -95,9 +95,9 @@ void z80_sigdeliver(void) * could be modified by a hostile program. */ - regs[XCPT_PC] = rtcb->xcp.saved_pc; - regs[XCPT_I] = rtcb->xcp.saved_i; - rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */ + regs[XCPT_PC] = rtcb->xcp.saved_pc; + regs[XCPT_I] = rtcb->xcp.saved_i; + rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */ /* Then restore the correct state for this thread of execution. */ diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 77b4e39226..559e85264d 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -101,7 +101,6 @@ * Public Types ****************************************************************************/ -typedef CODE void (*sig_deliver_t)(FAR struct tcb_s *tcb); typedef CODE void (*phy_enable_t)(bool enable); typedef CODE void (*initializer_t)(void); typedef CODE void (*debug_callback_t)(int type, FAR void *addr, size_t size, diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index e607802bb6..37b06cb6e4 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -289,6 +289,7 @@ typedef enum tstate_e tstate_t; /* The following is the form of a thread start-up function */ typedef CODE void (*start_t)(void); +typedef CODE void (*sig_deliver_t)(FAR struct tcb_s *tcb); /* This is the entry point into the main thread of the task or into a created * pthread within the task. @@ -706,6 +707,11 @@ struct tcb_s struct xcptcontext xcp; /* Interrupt register save area */ + /* The following function pointer is non-zero if there are pending signals + * to be processed. + */ + + sig_deliver_t sigdeliver; #if CONFIG_TASK_NAME_SIZE > 0 char name[CONFIG_TASK_NAME_SIZE + 1]; /* Task name (with NUL terminator) */ #endif