arch: move sigdeliver to common code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
ec58a6ab25
commit
8275a846b1
@ -127,12 +127,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -152,12 +152,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -253,12 +253,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -212,12 +212,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -253,12 +253,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -223,12 +223,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -253,12 +253,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -158,12 +158,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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
|
/* These are saved register array pointer used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, we are (1) signaling a task is not running
|
/* Otherwise, we are (1) signaling a task is not running
|
||||||
|
@ -59,8 +59,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
#ifndef CONFIG_SUPPRESS_INTERRUPTS
|
#ifndef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
/* Then make sure that interrupts are enabled. Signal handlers must always
|
/* Then make sure that interrupts are enabled. Signal handlers must always
|
||||||
@ -72,7 +72,7 @@ void arm_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* 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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* to the currently executing task.
|
||||||
@ -103,7 +103,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -101,7 +101,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -148,7 +148,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -83,9 +83,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on this CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -101,7 +101,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -148,7 +148,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
|
|
||||||
/* Copy "info" into user stack */
|
/* Copy "info" into user stack */
|
||||||
|
|
||||||
if (rtcb->xcp.sigdeliver)
|
if (rtcb->sigdeliver)
|
||||||
{
|
{
|
||||||
usp = rtcb->xcp.saved_regs[REG_SP];
|
usp = rtcb->xcp.saved_regs[REG_SP];
|
||||||
}
|
}
|
||||||
|
@ -86,9 +86,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* to the currently executing task.
|
||||||
@ -104,7 +104,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -105,7 +105,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -156,7 +156,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -101,7 +101,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -145,7 +145,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
|
|
||||||
/* Copy "info" into user stack */
|
/* Copy "info" into user stack */
|
||||||
|
|
||||||
if (rtcb->xcp.sigdeliver)
|
if (rtcb->sigdeliver)
|
||||||
{
|
{
|
||||||
usp = rtcb->xcp.saved_regs[REG_SP];
|
usp = rtcb->xcp.saved_regs[REG_SP];
|
||||||
}
|
}
|
||||||
|
@ -86,9 +86,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* to the currently executing task.
|
||||||
@ -104,7 +104,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -105,7 +105,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -156,7 +156,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void arm_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -101,7 +101,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -145,7 +145,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
|
|
||||||
/* Copy "info" into user stack */
|
/* Copy "info" into user stack */
|
||||||
|
|
||||||
if (rtcb->xcp.sigdeliver)
|
if (rtcb->sigdeliver)
|
||||||
{
|
{
|
||||||
usp = rtcb->xcp.saved_regs[REG_SP];
|
usp = rtcb->xcp.saved_regs[REG_SP];
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, we are (1) signaling a task is not running
|
/* Otherwise, we are (1) signaling a task is not running
|
||||||
|
@ -242,12 +242,6 @@ extern "C"
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
#ifdef CONFIG_BUILD_KERNEL
|
||||||
/* This is the saved address to use when returning from a user-space
|
/* This is the saved address to use when returning from a user-space
|
||||||
* signal handler.
|
* signal handler.
|
||||||
|
@ -118,9 +118,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,8 +70,8 @@ void arm64_sigdeliver(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -103,7 +103,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -150,7 +150,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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;
|
rtcb->xcp.regs = rtcb->xcp.saved_reg;
|
||||||
|
|
||||||
/* Then restore the correct state for this thread of execution. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
@ -93,12 +93,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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.
|
/* These are saved copies of PC and SR used during signal processing.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -93,12 +93,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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.
|
/* These are saved copies of PC and SR used during signal processing.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -83,9 +83,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -59,8 +59,8 @@ void avr_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ void avr_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_PC0] = rtcb->xcp.saved_pc0;
|
regs[REG_PC0] = rtcb->xcp.saved_pc0;
|
||||||
regs[REG_PC1] = rtcb->xcp.saved_pc1;
|
regs[REG_PC1] = rtcb->xcp.saved_pc1;
|
||||||
#if defined(REG_PC2)
|
#if defined(REG_PC2)
|
||||||
regs[REG_PC2] = rtcb->xcp.saved_pc2;
|
regs[REG_PC2] = rtcb->xcp.saved_pc2;
|
||||||
#endif
|
#endif
|
||||||
regs[REG_SREG] = rtcb->xcp.saved_sreg;
|
regs[REG_SREG] = rtcb->xcp.saved_sreg;
|
||||||
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. This is an
|
/* 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
|
* unusual case that must be handled by up_fullcontextresore. This case is
|
||||||
|
@ -87,7 +87,7 @@ void up_initial_state(struct tcb_s *tcb)
|
|||||||
#else
|
#else
|
||||||
/* No pending signal delivery */
|
/* No pending signal delivery */
|
||||||
|
|
||||||
xcp->sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
|
|
||||||
/* Clear the frame pointer and link register since this is the outermost
|
/* Clear the frame pointer and link register since this is the outermost
|
||||||
* frame.
|
* frame.
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -63,8 +63,8 @@ void avr_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ void avr_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_PC] = rtcb->xcp.saved_pc;
|
regs[REG_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[REG_SR] = rtcb->xcp.saved_sr;
|
regs[REG_SR] = rtcb->xcp.saved_sr;
|
||||||
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. This is an
|
/* 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
|
* unusual case that must be handled by up_fullcontextresore. This case is
|
||||||
|
@ -127,12 +127,6 @@ struct xcpt_syscall_s
|
|||||||
struct xcptcontext
|
struct xcptcontext
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -130,12 +130,6 @@ struct xcpt_syscall_s
|
|||||||
struct xcptcontext
|
struct xcptcontext
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -79,9 +79,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: The task that needs to receive the signal is running.
|
/* CASE 2: The task that needs to receive the signal is running.
|
||||||
|
@ -62,16 +62,16 @@ void ceva_sigdeliver(void)
|
|||||||
int saved_errno = rtcb->pterrno;
|
int saved_errno = rtcb->pterrno;
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Get a local copy of the sigdeliver function pointer. We do this so that
|
/* 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
|
* we can nullify the sigdeliver function pointer in the TCB and accept
|
||||||
* more signal deliveries while processing the current pending signals.
|
* more signal deliveries while processing the current pending signals.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver = (sig_deliver_t)rtcb->xcp.sigdeliver;
|
sigdeliver = rtcb->sigdeliver;
|
||||||
rtcb->xcp.sigdeliver = NULL;
|
rtcb->sigdeliver = NULL;
|
||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
|
@ -321,12 +321,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These additional register save locations are used to implement the
|
||||||
* signal delivery trampoline.
|
* signal delivery trampoline.
|
||||||
*
|
*
|
||||||
|
@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -61,8 +61,8 @@ void mips_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ void mips_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_EPC] = rtcb->xcp.saved_epc;
|
regs[REG_EPC] = rtcb->xcp.saved_epc;
|
||||||
regs[REG_STATUS] = rtcb->xcp.saved_status;
|
regs[REG_STATUS] = rtcb->xcp.saved_status;
|
||||||
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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -179,12 +179,6 @@
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These additional register save locations are used to implement the
|
||||||
* signal delivery trampoline.
|
* signal delivery trampoline.
|
||||||
*
|
*
|
||||||
|
@ -261,12 +261,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These additional register save locations are used to implement the
|
||||||
* signal delivery trampoline.
|
* signal delivery trampoline.
|
||||||
*/
|
*/
|
||||||
|
@ -81,9 +81,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -60,8 +60,8 @@ void lm32_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ void lm32_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_EPC] = rtcb->xcp.saved_epc;
|
regs[REG_EPC] = rtcb->xcp.saved_epc;
|
||||||
regs[REG_INT_CTX] = rtcb->xcp.saved_int_ctx;
|
regs[REG_INT_CTX] = rtcb->xcp.saved_int_ctx;
|
||||||
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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -82,9 +82,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -62,8 +62,8 @@ void minerva_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the real return state on the stack. */
|
/* 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.
|
* more signal deliveries while processing the current pending signals.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver = rtcb->xcp.sigdeliver;
|
sigdeliver = rtcb->sigdeliver;
|
||||||
rtcb->xcp.sigdeliver = NULL;
|
rtcb->sigdeliver = NULL;
|
||||||
|
|
||||||
# ifndef CONFIG_SUPPRESS_INTERRUPTS
|
# ifndef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
/* Then make sure that interrupts are enabled. Signal handlers must always
|
/* Then make sure that interrupts are enabled. Signal handlers must always
|
||||||
|
@ -170,12 +170,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
uint32_t regs[XCPTCONTEXT_REGS];
|
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
|
/* These are saved copies of LR and CPSR used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*
|
*
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -228,12 +228,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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.
|
/* These are saved copies of LR and SR used during signal processing.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -986,12 +986,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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. */
|
/* These are saved copies of LR and SR used during signal processing. */
|
||||||
|
|
||||||
uint32_t saved_pc;
|
uint32_t saved_pc;
|
||||||
|
@ -449,12 +449,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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.
|
/* These are saved copies of LR and SR used during signal processing.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -58,8 +58,8 @@ void renesas_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void renesas_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* 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
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_PC] = rtcb->xcp.saved_pc[0];
|
regs[REG_PC] = rtcb->xcp.saved_pc[0];
|
||||||
regs[REG_PC + 1] = rtcb->xcp.saved_pc[1];
|
regs[REG_PC + 1] = rtcb->xcp.saved_pc[1];
|
||||||
regs[REG_FLG] = rtcb->xcp.saved_flg;
|
regs[REG_FLG] = rtcb->xcp.saved_flg;
|
||||||
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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -60,8 +60,8 @@ void renesas_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the real return state on the stack. */
|
/* Save the real return state on the stack. */
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ void renesas_sigdeliver(void)
|
|||||||
* signals.
|
* signals.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver = rtcb->xcp.sigdeliver;
|
sigdeliver = rtcb->sigdeliver;
|
||||||
rtcb->xcp.sigdeliver = NULL;
|
rtcb->sigdeliver = NULL;
|
||||||
|
|
||||||
#ifndef CONFIG_SUPPRESS_INTERRUPTS
|
#ifndef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
/* Then make sure that interrupts are enabled. Signal handlers must always
|
/* Then make sure that interrupts are enabled. Signal handlers must always
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -58,8 +58,8 @@ void renesas_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void renesas_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_PC] = rtcb->xcp.saved_pc;
|
regs[REG_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[REG_SR] = rtcb->xcp.saved_sr;
|
regs[REG_SR] = rtcb->xcp.saved_sr;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -567,12 +567,6 @@
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These additional register save locations are used to implement the
|
||||||
* signal delivery trampoline.
|
* signal delivery trampoline.
|
||||||
*
|
*
|
||||||
|
@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -69,8 +69,8 @@ void riscv_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -102,7 +102,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -147,7 +147,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
|
|
||||||
struct xcptcontext
|
struct xcptcontext
|
||||||
{
|
{
|
||||||
void *sigdeliver; /* Actual type is sig_deliver_t */
|
|
||||||
jmp_buf regs;
|
jmp_buf regs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,13 +83,13 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
if (tcb->xcp.sigdeliver == NULL)
|
if (tcb->sigdeliver == NULL)
|
||||||
{
|
{
|
||||||
tcb->xcp.sigdeliver = sigdeliver;
|
tcb->sigdeliver = sigdeliver;
|
||||||
if (tcb == this_task())
|
if (tcb == this_task())
|
||||||
{
|
{
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ void sim_sigdeliver(void)
|
|||||||
int16_t saved_irqcount;
|
int16_t saved_irqcount;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
#endif
|
#endif
|
||||||
if (NULL == (rtcb->xcp.sigdeliver))
|
if (NULL == (rtcb->sigdeliver))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -75,8 +75,8 @@ void sim_sigdeliver(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* NOTE: we do not save the return state for sim */
|
/* NOTE: we do not save the return state for sim */
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -135,7 +135,7 @@ retry:
|
|||||||
|
|
||||||
/* Allows next handler to be scheduled */
|
/* Allows next handler to be scheduled */
|
||||||
|
|
||||||
rtcb->xcp.sigdeliver = NULL;
|
rtcb->sigdeliver = NULL;
|
||||||
|
|
||||||
/* NOTE: we leave a critical section here for sim */
|
/* NOTE: we leave a critical section here for sim */
|
||||||
|
|
||||||
|
@ -427,12 +427,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These additional register save locations are used to implement the
|
||||||
* signal delivery trampoline.
|
* signal delivery trampoline.
|
||||||
*
|
*
|
||||||
|
@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* 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 */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: The task that needs to receive the signal is running.
|
/* CASE 2: The task that needs to receive the signal is running.
|
||||||
|
@ -77,8 +77,8 @@ void sparc_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -163,10 +163,10 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_PC] = rtcb->xcp.saved_pc;
|
regs[REG_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[REG_NPC] = rtcb->xcp.saved_npc;
|
regs[REG_NPC] = rtcb->xcp.saved_npc;
|
||||||
regs[REG_PSR] = rtcb->xcp.saved_status;
|
regs[REG_PSR] = rtcb->xcp.saved_status;
|
||||||
rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */
|
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
/* Restore the saved 'irqcount' and recover the critical section
|
/* Restore the saved 'irqcount' and recover the critical section
|
||||||
|
@ -116,12 +116,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of the context used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
{
|
{
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the
|
/* CASE 2: We are in an interrupt handler AND the
|
||||||
|
@ -59,8 +59,8 @@ void tricore_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signal */
|
/* Deliver the signal */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -106,7 +106,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -151,12 +151,6 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of instruction pointer and EFLAGS used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*
|
*
|
||||||
|
@ -76,9 +76,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -59,8 +59,8 @@ void x86_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ void x86_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_EIP] = rtcb->xcp.saved_eip;
|
regs[REG_EIP] = rtcb->xcp.saved_eip;
|
||||||
regs[REG_EFLAGS] = rtcb->xcp.saved_eflags;
|
regs[REG_EFLAGS] = rtcb->xcp.saved_eflags;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -487,12 +487,6 @@ enum ioapic_trigger_mode
|
|||||||
|
|
||||||
struct xcptcontext
|
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
|
/* These are saved copies of instruction pointer and EFLAGS used during
|
||||||
* signal processing.
|
* signal processing.
|
||||||
*/
|
*/
|
||||||
|
@ -78,9 +78,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* to the currently executing task.
|
||||||
@ -99,7 +99,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* 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 */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: The task that needs to receive the signal is running.
|
/* CASE 2: The task that needs to receive the signal is running.
|
||||||
|
@ -69,8 +69,8 @@ void x86_64_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Align regs to 64 byte boundary for XSAVE */
|
/* Align regs to 64 byte boundary for XSAVE */
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ void x86_64_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[REG_RIP] = rtcb->xcp.saved_rip;
|
regs[REG_RIP] = rtcb->xcp.saved_rip;
|
||||||
regs[REG_RSP] = rtcb->xcp.saved_rsp;
|
regs[REG_RSP] = rtcb->xcp.saved_rsp;
|
||||||
regs[REG_RFLAGS] = rtcb->xcp.saved_rflags;
|
regs[REG_RFLAGS] = rtcb->xcp.saved_rflags;
|
||||||
rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */
|
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
/* Restore the saved 'irqcount' and recover the critical section
|
/* Restore the saved 'irqcount' and recover the critical section
|
||||||
|
@ -178,12 +178,6 @@ struct xcpt_syscall_s
|
|||||||
|
|
||||||
struct xcptcontext
|
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.
|
/* These are saved copies of registers used during signal processing.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -84,9 +84,9 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to task that is currently executing on any CPU.
|
* 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);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void xtensa_sig_deliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
@ -102,7 +102,7 @@ retry:
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* alter errno), then disable interrupts again and restore the original
|
||||||
@ -146,7 +146,7 @@ retry:
|
|||||||
* could be modified by a hostile program.
|
* 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.
|
/* Then restore the correct state for this thread of execution.
|
||||||
*/
|
*/
|
||||||
|
@ -165,12 +165,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
uint16_t regs[XCPTCONTEXT_REGS];
|
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.
|
/* The following retains that state during signal execution.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -80,9 +80,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is
|
||||||
* being delivered to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted
|
/* CASE 2: We are in an interrupt handler AND the interrupted
|
||||||
|
@ -60,8 +60,8 @@ void z16_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ void z16_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs32[REG_PC / 2] = rtcb->xcp.saved_pc;
|
regs32[REG_PC / 2] = rtcb->xcp.saved_pc;
|
||||||
regs[REG_FLAGS] = rtcb->xcp.saved_i;
|
regs[REG_FLAGS] = rtcb->xcp.saved_i;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -246,12 +246,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
chipreg_t regs[XCPTCONTEXT_REGS];
|
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
|
/* The following retains that state during signal execution
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -173,12 +173,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
chipreg_t regs[XCPTCONTEXT_REGS];
|
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
|
/* The following retains that state during signal execution
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -304,12 +304,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
chipreg_t regs[XCPTCONTEXT_REGS];
|
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
|
/* The following retains that state during signal execution
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -88,12 +88,6 @@ struct xcptcontext
|
|||||||
|
|
||||||
chipreg_t regs[XCPTCONTEXT_REGS];
|
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.
|
/* The following retains that state during signal execution.
|
||||||
*
|
*
|
||||||
* REVISIT: Because there is only one copy of these save areas,
|
* REVISIT: Because there is only one copy of these save areas,
|
||||||
|
@ -105,9 +105,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -61,8 +61,8 @@ void z80_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ void z80_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[XCPT_I] = rtcb->xcp.saved_i;
|
regs[XCPT_I] = rtcb->xcp.saved_i;
|
||||||
rtcb->xcp.sigdeliver = NULL; /* Allows next handler to be scheduled */
|
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
|
||||||
|
|
||||||
/* Modify the saved return state with the actual saved values in the
|
/* Modify the saved return state with the actual saved values in the
|
||||||
* TCB. This depends on the fact that nested signal handling is
|
* TCB. This depends on the fact that nested signal handling is
|
||||||
|
@ -108,9 +108,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -58,8 +58,8 @@ void z80_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void z80_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[XCPT_I] = rtcb->xcp.saved_i;
|
regs[XCPT_I] = rtcb->xcp.saved_i;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -105,9 +105,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -77,8 +77,8 @@ void z80_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ void z80_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[XCPT_IRQCTL] = rtcb->xcp.saved_irqctl;
|
regs[XCPT_IRQCTL] = rtcb->xcp.saved_irqctl;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -106,9 +106,9 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
/* Refuse to handle nested signal actions */
|
/* 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
|
/* First, handle some special cases when the signal is being delivered
|
||||||
* to the currently executing task.
|
* 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. */
|
/* In this case just deliver the signal now. */
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
tcb->xcp.sigdeliver = NULL;
|
tcb->sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
|
@ -58,8 +58,8 @@ void z80_sigdeliver(void)
|
|||||||
board_autoled_on(LED_SIGNAL);
|
board_autoled_on(LED_SIGNAL);
|
||||||
|
|
||||||
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
|
||||||
DEBUGASSERT(rtcb->xcp.sigdeliver != NULL);
|
DEBUGASSERT(rtcb->sigdeliver != NULL);
|
||||||
|
|
||||||
/* Save the return state on the stack. */
|
/* Save the return state on the stack. */
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void z80_sigdeliver(void)
|
|||||||
|
|
||||||
/* Deliver the signals */
|
/* Deliver the signals */
|
||||||
|
|
||||||
((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb);
|
(rtcb->sigdeliver)(rtcb);
|
||||||
|
|
||||||
/* Output any debug messages BEFORE restoring errno (because they may
|
/* Output any debug messages BEFORE restoring errno (because they may
|
||||||
* alter errno), then disable interrupts again and restore the original
|
* 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.
|
* could be modified by a hostile program.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
regs[XCPT_PC] = rtcb->xcp.saved_pc;
|
||||||
regs[XCPT_I] = rtcb->xcp.saved_i;
|
regs[XCPT_I] = rtcb->xcp.saved_i;
|
||||||
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. */
|
/* Then restore the correct state for this thread of execution. */
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@
|
|||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
typedef CODE void (*sig_deliver_t)(FAR struct tcb_s *tcb);
|
|
||||||
typedef CODE void (*phy_enable_t)(bool enable);
|
typedef CODE void (*phy_enable_t)(bool enable);
|
||||||
typedef CODE void (*initializer_t)(void);
|
typedef CODE void (*initializer_t)(void);
|
||||||
typedef CODE void (*debug_callback_t)(int type, FAR void *addr, size_t size,
|
typedef CODE void (*debug_callback_t)(int type, FAR void *addr, size_t size,
|
||||||
|
@ -289,6 +289,7 @@ typedef enum tstate_e tstate_t;
|
|||||||
/* The following is the form of a thread start-up function */
|
/* The following is the form of a thread start-up function */
|
||||||
|
|
||||||
typedef CODE void (*start_t)(void);
|
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
|
/* This is the entry point into the main thread of the task or into a created
|
||||||
* pthread within the task.
|
* pthread within the task.
|
||||||
@ -706,6 +707,11 @@ struct tcb_s
|
|||||||
|
|
||||||
struct xcptcontext xcp; /* Interrupt register save area */
|
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
|
#if CONFIG_TASK_NAME_SIZE > 0
|
||||||
char name[CONFIG_TASK_NAME_SIZE + 1]; /* Task name (with NUL terminator) */
|
char name[CONFIG_TASK_NAME_SIZE + 1]; /* Task name (with NUL terminator) */
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user