mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
This change renames all internal, private NuttX signal-related functions to use the prefix nxsig_ so that they cannot be confused with application interfaces that begin, primarily, with sig_
This is analogous to similar renaming that was done previously for semaphores.
Squashed commit of the following:
sched/signal: Fix a few compile warnings introduced by naming changes.
sched/signal: Rename all private, internal signl functions to use the nxsig_ prefix.
sched/signal: Rename sig_removependingsignal, sig_unmaskpendingsignal, and sig_mqnotempty to nxsig_remove_pendingsignal, nxsig_unmask_pendingsignal, and nxsig_mqnotempty to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_findaction and sig_lowest to nxsig_find_action and nxsig_lowest to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_allocatepingsigaction and sig_deliver to nxsig_alloc_pendingsigaction and nxsig_deliver to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_cleanup, sig_release, sig_releasependingaction, and sig_releasependingsignal to nxsig_cleanup, nxsig_release, nxsig_release_pendingaction, and nxsig_release_pendingsignal to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_tcbdispatch and sig_dispatch to nxsig_tcbdispatch and nxsig_dispatch to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_releaseaction and sig_pendingset to nxsig_release_action and nxsig_pendingset to make it clear that these are OS internal interfaces.
sched/signal: Rename sig_initialize and sig_allocateactionblock to nxsig_initialize and nxsig_alloc_actionblock to make it clear that these are OS internal interfaces.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
###########################################################################
|
||||
# configs/ea3131/locked/mklocked.sh
|
||||
#
|
||||
# Copyright (C) 2010-2014 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2010-2014, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -168,7 +168,7 @@ fi
|
||||
|
||||
answer=$(checkconfig CONFIG_DISABLE_SIGNALS)
|
||||
if [ "$answer" = n ]; then
|
||||
echo "EXTERN(sig_initialize)" >>ld-locked.inc
|
||||
echo "EXTERN(nxsig_initialize)" >>ld-locked.inc
|
||||
fi
|
||||
|
||||
echo "EXTERN(sem_initialize)" >>ld-locked.inc
|
||||
|
||||
+2
-2
@@ -112,10 +112,10 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp)
|
||||
|
||||
else if (aiocbp->aio_sigevent.sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
ret = sig_notification(pid, &aiocbp->aio_sigevent);
|
||||
ret = nxsig_notification(pid, &aiocbp->aio_sigevent);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: sig_notification failed: %d\n", ret);
|
||||
ferr("ERROR: nxsig_notification failed: %d\n", ret);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/signal.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -52,7 +52,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_notification
|
||||
* Name: nxsig_notification
|
||||
*
|
||||
* Description:
|
||||
* Notify a client a signal event via a function call. This function is
|
||||
@@ -60,17 +60,18 @@
|
||||
* event notification for the case of SIGEV_THREAD.
|
||||
*
|
||||
* Input Parameters:
|
||||
* pid - The task/thread ID a the client thread to be signaled.
|
||||
* pid - The task/thread ID a the client thread to be signaled.
|
||||
* event - The instance of struct sigevent that describes how to signal
|
||||
* the client.
|
||||
* the client.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; A negated errno value is returned
|
||||
* on failure.
|
||||
* This is an internal OS interface and should not be used by applications.
|
||||
* It follows the NuttX internal error return policy: Zero (OK) is
|
||||
* returned on success. A negated errno value is returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_notification(pid_t pid, FAR struct sigevent *event);
|
||||
int nxsig_notification(pid_t pid, FAR struct sigevent *event);
|
||||
|
||||
#endif /* CONFIG_SIG_EVTHREAD && CONFIG_BUILD_FLAT */
|
||||
#endif /* __INCLUDE_NUTTX_SIGNAL_H */
|
||||
|
||||
@@ -207,7 +207,7 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext)
|
||||
|
||||
else if (ighand->sig->sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
DEBUGASSERT(sig_notification(sighand->pid, &sighand->sig));
|
||||
DEBUGASSERT(nxsig_notification(sighand->pid, &sighand->sig));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -713,7 +713,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent,
|
||||
|
||||
else if (sig && sig->sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
status = sig_notification(sighand->pid, &sighand->sig);
|
||||
status = nxsig_notification(sighand->pid, &sighand->sig);
|
||||
if (status < 0 && ret == OK)
|
||||
{
|
||||
/* Something bad happened while performing the notification
|
||||
|
||||
@@ -149,7 +149,7 @@ static inline void group_release(FAR struct task_group_s *group)
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
/* Release pending signals */
|
||||
|
||||
sig_release(group);
|
||||
nxsig_release(group);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
|
||||
@@ -121,7 +121,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
|
||||
* receive the signal.
|
||||
*/
|
||||
|
||||
ret = sig_tcbdispatch(tcb, info->siginfo);
|
||||
ret = nxsig_tcbdispatch(tcb, info->siginfo);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
@@ -152,7 +152,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
|
||||
|
||||
/* Is there also a action associated with the task group? */
|
||||
|
||||
sigact = sig_findaction(tcb->group, info->siginfo->si_signo);
|
||||
sigact = nxsig_find_action(tcb->group, info->siginfo->si_signo);
|
||||
if (sigact)
|
||||
{
|
||||
/* Yes.. then use this thread. The requirement is this:
|
||||
@@ -161,7 +161,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
|
||||
* blocking the signal will receive the signal.
|
||||
*/
|
||||
|
||||
ret = sig_tcbdispatch(tcb, info->siginfo);
|
||||
ret = nxsig_tcbdispatch(tcb, info->siginfo);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
@@ -261,7 +261,7 @@ int group_signal(FAR struct task_group_s *group, FAR siginfo_t *siginfo)
|
||||
|
||||
/* Now deliver the signal to the selected group member */
|
||||
|
||||
ret = sig_tcbdispatch(tcb, siginfo);
|
||||
ret = nxsig_tcbdispatch(tcb, siginfo);
|
||||
}
|
||||
|
||||
errout:
|
||||
|
||||
@@ -638,10 +638,10 @@ void os_start(void)
|
||||
/* Initialize the signal facility (if in link) */
|
||||
|
||||
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
|
||||
if (sig_initialize != NULL)
|
||||
if (nxsig_initialize != NULL)
|
||||
#endif
|
||||
{
|
||||
sig_initialize();
|
||||
nxsig_initialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/mqueue/mq_sndinternal.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2013-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -416,11 +416,11 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg,
|
||||
/* Yes... Queue the signal -- What if this returns an error? */
|
||||
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo,
|
||||
event.sigev_value));
|
||||
DEBUGVERIFY(nxsig_mqnotempty(pid, event.sigev_signo,
|
||||
event.sigev_value));
|
||||
#else
|
||||
DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo,
|
||||
event.sigev_value.sival_ptr));
|
||||
DEBUGVERIFY(nxsig_mqnotempty(pid, event.sigev_signo,
|
||||
event.sigev_value.sival_ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg,
|
||||
|
||||
else if (event.sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
DEBUGVERIFY(sig_notification(pid, &event));
|
||||
DEBUGVERIFY(nxsig_notification(pid, &event));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo)
|
||||
FAR struct tcb_s *tcb;
|
||||
siginfo_t info;
|
||||
|
||||
/* The logic below if equivalent to sigqueue(), but uses sig_tcbdispatch()
|
||||
* instead of sig_dispatch(). This avoids the group signal deliver logic
|
||||
/* The logic below if equivalent to sigqueue(), but uses nxsig_tcbdispatch()
|
||||
* instead of nxsig_dispatch(). This avoids the group signal deliver logic
|
||||
* and assures, instead, that the signal is delivered specifically to this
|
||||
* thread that is known to be waiting on the signal.
|
||||
*/
|
||||
@@ -117,7 +117,7 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo)
|
||||
* a watchdog timer interrupt handler.
|
||||
*/
|
||||
|
||||
(void)sig_tcbdispatch(tcb, &info);
|
||||
(void)nxsig_tcbdispatch(tcb, &info);
|
||||
}
|
||||
|
||||
#else /* HAVE_GROUP_MEMBERS */
|
||||
|
||||
@@ -136,7 +136,7 @@ int pthread_kill(pthread_t thread, int signo)
|
||||
* dispatch rules.
|
||||
*/
|
||||
|
||||
ret = sig_tcbdispatch(stcb, &info);
|
||||
ret = nxsig_tcbdispatch(stcb, &info);
|
||||
sched_unlock();
|
||||
|
||||
if (ret < 0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* sched/semaphore/nxsem_initialize.c
|
||||
* sched/semaphore/sem_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* sched/semaphore/nxsem_waitirq.c
|
||||
* sched/semaphore/sem_waitirq.c
|
||||
*
|
||||
* Copyright (C) 2007-2010, 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
||||
@@ -38,7 +38,7 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||
CSRCS += sig_initialize.c
|
||||
CSRCS += sig_action.c sig_procmask.c sig_pending.c sig_suspend.c
|
||||
CSRCS += sig_kill.c sig_queue.c sig_waitinfo.c sig_timedwait.c
|
||||
CSRCS += sig_findaction.c sig_allocatependingsigaction.c
|
||||
CSRCS += sig_findaction.c sig_allocpendingsigaction.c
|
||||
CSRCS += sig_releasependingsigaction.c sig_unmaskpendingsignal.c
|
||||
CSRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c
|
||||
CSRCS += sig_mqnotempty.c sig_cleanup.c sig_dispatch.c sig_deliver.c
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_action.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013, 2016-2017 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -65,14 +66,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocateaction
|
||||
* Name: nxsig_alloc_action
|
||||
*
|
||||
* Description:
|
||||
* Allocate a new element for a sigaction queue
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR sigactq_t *sig_allocateaction(void)
|
||||
static FAR sigactq_t *nxsig_alloc_action(void)
|
||||
{
|
||||
FAR sigactq_t *sigact;
|
||||
|
||||
@@ -86,7 +87,7 @@ static FAR sigactq_t *sig_allocateaction(void)
|
||||
{
|
||||
/* Add another block of signal actions to the list */
|
||||
|
||||
sig_allocateactionblock();
|
||||
nxsig_alloc_actionblock();
|
||||
|
||||
/* And try again */
|
||||
|
||||
@@ -176,7 +177,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction *
|
||||
|
||||
/* Find the signal in the signal action queue */
|
||||
|
||||
sigact = sig_findaction(group, signo);
|
||||
sigact = nxsig_find_action(group, signo);
|
||||
|
||||
/* Return the old sigaction value if so requested */
|
||||
|
||||
@@ -252,7 +253,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction *
|
||||
|
||||
/* And deallocate it */
|
||||
|
||||
sig_releaseaction(sigact);
|
||||
nxsig_release_action(sigact);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +269,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction *
|
||||
{
|
||||
/* No.. Then we need to allocate one for the new action. */
|
||||
|
||||
sigact = sig_allocateaction();
|
||||
sigact = nxsig_alloc_action();
|
||||
|
||||
/* An error has occurred if we could not allocate the sigaction */
|
||||
|
||||
@@ -296,14 +297,14 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction *
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_releaseaction
|
||||
* Name: nxsig_release_action
|
||||
*
|
||||
* Description:
|
||||
* Deallocate a sigaction Q entry
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_releaseaction(FAR sigactq_t *sigact)
|
||||
void nxsig_release_action(FAR sigactq_t *sigact)
|
||||
{
|
||||
/* Just put it back on the free list */
|
||||
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_allocatependingsigaction.c
|
||||
* sched/signal/sig_allocpendingsigaction.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -52,14 +52,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocatependingsigaction
|
||||
* Name: nxsig_alloc_pendingsigaction
|
||||
*
|
||||
* Description:
|
||||
* Allocate a new element for the pending signal action queue
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR sigq_t *sig_allocatependingsigaction(void)
|
||||
FAR sigq_t *nxsig_alloc_pendingsigaction(void)
|
||||
{
|
||||
FAR sigq_t *sigq;
|
||||
irqstate_t flags;
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_cleanup.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -47,7 +47,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_cleanup
|
||||
* Name: nxsig_cleanup
|
||||
*
|
||||
* Description:
|
||||
* Deallocate all signal-related lists in a TCB. This function is
|
||||
@@ -56,7 +56,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_cleanup(FAR struct tcb_s *stcb)
|
||||
void nxsig_cleanup(FAR struct tcb_s *stcb)
|
||||
{
|
||||
FAR sigq_t *sigq;
|
||||
|
||||
@@ -64,14 +64,14 @@ void sig_cleanup(FAR struct tcb_s *stcb)
|
||||
|
||||
while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpendactionq)) != NULL)
|
||||
{
|
||||
sig_releasependingsigaction(sigq);
|
||||
nxsig_release_pendingsigaction(sigq);
|
||||
}
|
||||
|
||||
/* Deallocate all entries in the list of posted signal actions */
|
||||
|
||||
while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpostedq)) != NULL)
|
||||
{
|
||||
sig_releasependingsigaction(sigq);
|
||||
nxsig_release_pendingsigaction(sigq);
|
||||
}
|
||||
|
||||
/* Misc. signal-related clean-up */
|
||||
@@ -81,7 +81,7 @@ void sig_cleanup(FAR struct tcb_s *stcb)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_release
|
||||
* Name: nxsig_release
|
||||
*
|
||||
* Description:
|
||||
* Deallocate all signal-related lists in a group. This function is
|
||||
@@ -91,7 +91,7 @@ void sig_cleanup(FAR struct tcb_s *stcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_release(FAR struct task_group_s *group)
|
||||
void nxsig_release(FAR struct task_group_s *group)
|
||||
{
|
||||
FAR sigactq_t *sigact;
|
||||
FAR sigpendq_t *sigpend;
|
||||
@@ -100,14 +100,14 @@ void sig_release(FAR struct task_group_s *group)
|
||||
|
||||
while ((sigact = (FAR sigactq_t *)sq_remfirst(&group->tg_sigactionq)) != NULL)
|
||||
{
|
||||
sig_releaseaction(sigact);
|
||||
nxsig_release_action(sigact);
|
||||
}
|
||||
|
||||
/* Deallocate all entries in the list of pending signals */
|
||||
|
||||
while ((sigpend = (FAR sigpendq_t *)sq_remfirst(&group->tg_sigpendingq)) != NULL)
|
||||
{
|
||||
sig_releasependingsignal(sigpend);
|
||||
nxsig_release_pendingsignal(sigpend);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_deliver
|
||||
* Name: nxsig_deliver
|
||||
*
|
||||
* Description:
|
||||
* This function is called on the thread of execution of the signal
|
||||
@@ -65,7 +65,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_deliver(FAR struct tcb_s *stcb)
|
||||
void nxsig_deliver(FAR struct tcb_s *stcb)
|
||||
{
|
||||
FAR sigq_t *sigq;
|
||||
FAR sigq_t *next;
|
||||
@@ -151,7 +151,7 @@ void sig_deliver(FAR struct tcb_s *stcb)
|
||||
* original sigprocmask will unblock the signal.
|
||||
*/
|
||||
|
||||
sig_unmaskpendingsignal();
|
||||
nxsig_unmask_pendingsignal();
|
||||
|
||||
/* Remove the signal from the sigpostedq */
|
||||
|
||||
@@ -161,7 +161,7 @@ void sig_deliver(FAR struct tcb_s *stcb)
|
||||
|
||||
/* Then deallocate it */
|
||||
|
||||
sig_releasependingsigaction(sigq);
|
||||
nxsig_release_pendingsigaction(sigq);
|
||||
}
|
||||
|
||||
stcb->pterrno = saved_errno;
|
||||
|
||||
+27
-27
@@ -60,7 +60,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_queueaction
|
||||
* Name: nxsig_queue_action
|
||||
*
|
||||
* Description:
|
||||
* Queue a signal action for delivery to a task.
|
||||
@@ -70,7 +70,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
static int nxsig_queue_action(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
{
|
||||
FAR sigactq_t *sigact;
|
||||
FAR sigq_t *sigq;
|
||||
@@ -82,7 +82,7 @@ static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
|
||||
/* Find the group sigaction associated with this signal */
|
||||
|
||||
sigact = sig_findaction(stcb->group, info->si_signo);
|
||||
sigact = nxsig_find_action(stcb->group, info->si_signo);
|
||||
|
||||
/* Check if a valid signal handler is available and if the signal is
|
||||
* unblocked. NOTE: There is no default action.
|
||||
@@ -91,10 +91,10 @@ static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
if ((sigact) && (sigact->act.sa_u._sa_sigaction))
|
||||
{
|
||||
/* Allocate a new element for the signal queue. NOTE:
|
||||
* sig_allocatependingsigaction will force a system crash if it is
|
||||
* nxsig_alloc_pendingsigaction will force a system crash if it is
|
||||
* unable to allocate memory for the signal data */
|
||||
|
||||
sigq = sig_allocatependingsigaction();
|
||||
sigq = nxsig_alloc_pendingsigaction();
|
||||
if (!sigq)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
@@ -120,14 +120,14 @@ static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocatependingsignal
|
||||
* Name: nxsig_alloc_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Allocate a pending signal list entry
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR sigpendq_t *sig_allocatependingsignal(void)
|
||||
static FAR sigpendq_t *nxsig_alloc_pendingsignal(void)
|
||||
{
|
||||
FAR sigpendq_t *sigpend;
|
||||
irqstate_t flags;
|
||||
@@ -186,15 +186,15 @@ static FAR sigpendq_t *sig_allocatependingsignal(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_findpendingsignal
|
||||
* Name: nxsig_find_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Find a specified element in the pending signal list
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
|
||||
int signo)
|
||||
static FAR sigpendq_t *
|
||||
nxsig_find_pendingsignal(FAR struct task_group_s *group, int signo)
|
||||
{
|
||||
FAR sigpendq_t *sigpend = NULL;
|
||||
irqstate_t flags;
|
||||
@@ -216,7 +216,7 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_addpendingsignal
|
||||
* Name: nxsig_add_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Add the specified signal to the signal pending list. NOTE: This
|
||||
@@ -226,8 +226,8 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||
FAR siginfo_t *info)
|
||||
static FAR sigpendq_t *nxsig_add_pendingsignal(FAR struct tcb_s *stcb,
|
||||
FAR siginfo_t *info)
|
||||
{
|
||||
FAR struct task_group_s *group;
|
||||
FAR sigpendq_t *sigpend;
|
||||
@@ -238,7 +238,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||
|
||||
/* Check if the signal is already pending for the group */
|
||||
|
||||
sigpend = sig_findpendingsignal(group, info->si_signo);
|
||||
sigpend = nxsig_find_pendingsignal(group, info->si_signo);
|
||||
if (sigpend)
|
||||
{
|
||||
/* The signal is already pending... retain only one copy */
|
||||
@@ -252,7 +252,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||
{
|
||||
/* Allocate a new pending signal entry */
|
||||
|
||||
sigpend = sig_allocatependingsignal();
|
||||
sigpend = nxsig_alloc_pendingsignal();
|
||||
if (sigpend)
|
||||
{
|
||||
/* Put the signal information into the allocated structure */
|
||||
@@ -275,7 +275,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_tcbdispatch
|
||||
* Name: nxsig_tcbdispatch
|
||||
*
|
||||
* Description:
|
||||
* All signals received the task (whatever the source) go through this
|
||||
@@ -296,7 +296,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
{
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
@@ -337,7 +337,7 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
else
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
ASSERT(sig_addpendingsignal(stcb, info));
|
||||
ASSERT(nxsig_add_pendingsignal(stcb, info));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
#endif
|
||||
/* Queue any sigaction's requested by this task. */
|
||||
|
||||
ret = sig_queueaction(stcb, info);
|
||||
ret = nxsig_queue_action(stcb, info);
|
||||
|
||||
/* Deliver of the signal must be performed in a critical section */
|
||||
|
||||
@@ -369,7 +369,7 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
* recipient's thread.
|
||||
*/
|
||||
|
||||
up_schedule_sigaction(stcb, sig_deliver);
|
||||
up_schedule_sigaction(stcb, nxsig_deliver);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Resume the paused CPU (if any) */
|
||||
@@ -429,15 +429,15 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_dispatch
|
||||
* Name: nxsig_dispatch
|
||||
*
|
||||
* Description:
|
||||
* This is the front-end for sig_tcbdispatch that should be typically
|
||||
* This is the front-end for nxsig_tcbdispatch that should be typically
|
||||
* be used to dispatch a signal. If HAVE_GROUP_MEMBERS is defined,
|
||||
* then function will follow the group signal delivery algorthrims:
|
||||
*
|
||||
* This front-end does the following things before calling
|
||||
* sig_tcbdispatch.
|
||||
* nxsig_tcbdispatch.
|
||||
*
|
||||
* With HAVE_GROUP_MEMBERS defined:
|
||||
* - Get the TCB associated with the pid.
|
||||
@@ -445,18 +445,18 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||
* - If the PID has already exited, lookup the group that that was
|
||||
* started by this task.
|
||||
* - Use the group to pick the TCB to receive the signal
|
||||
* - Call sig_tcbdispatch with the TCB
|
||||
* - Call nxsig_tcbdispatch with the TCB
|
||||
*
|
||||
* With HAVE_GROUP_MEMBERS *not* defined
|
||||
* - Get the TCB associated with the pid.
|
||||
* - Call sig_tcbdispatch with the TCB
|
||||
* - Call nxsig_tcbdispatch with the TCB
|
||||
*
|
||||
* Returned Value:
|
||||
* Returns 0 (OK) on success or a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_dispatch(pid_t pid, FAR siginfo_t *info)
|
||||
int nxsig_dispatch(pid_t pid, FAR siginfo_t *info)
|
||||
{
|
||||
#ifdef HAVE_GROUP_MEMBERS
|
||||
FAR struct tcb_s *stcb;
|
||||
@@ -509,7 +509,7 @@ int sig_dispatch(pid_t pid, FAR siginfo_t *info)
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
return sig_tcbdispatch(stcb, info);
|
||||
return nxsig_tcbdispatch(stcb, info);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_findaction.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -45,14 +45,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_findaction
|
||||
* Name: nxsig_find_action
|
||||
*
|
||||
* Description:
|
||||
* Allocate a new element for a signal queue
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR sigactq_t *sig_findaction(FAR struct task_group_s *group, int signo)
|
||||
FAR sigactq_t *nxsig_find_action(FAR struct task_group_s *group, int signo)
|
||||
{
|
||||
FAR sigactq_t *sigact = NULL;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -118,9 +118,9 @@ static sigpendq_t *g_sigpendingirqsignalalloc;
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs,
|
||||
static sigq_t *nxsig_alloc_block(sq_queue_t *siglist, uint16_t nsigs,
|
||||
uint8_t sigtype);
|
||||
static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
|
||||
static sigpendq_t *nxsig_alloc_pendingsignalblock(sq_queue_t *siglist,
|
||||
uint16_t nsigs, uint8_t sigtype);
|
||||
|
||||
/****************************************************************************
|
||||
@@ -128,7 +128,7 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocateblock
|
||||
* Name: nxsig_alloc_block
|
||||
*
|
||||
* Description:
|
||||
* Allocate a block of pending signal actions and place them
|
||||
@@ -136,7 +136,7 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs,
|
||||
static sigq_t *nxsig_alloc_block(sq_queue_t *siglist, uint16_t nsigs,
|
||||
uint8_t sigtype)
|
||||
{
|
||||
FAR sigq_t *sigqalloc;
|
||||
@@ -158,7 +158,7 @@ static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs,
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocatependingsignalblock
|
||||
* Name: nxsig_alloc_pendingsignalblock
|
||||
*
|
||||
* Description:
|
||||
* Allocate a block of pending signal structures and place them on
|
||||
@@ -166,7 +166,7 @@ static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
|
||||
static sigpendq_t *nxsig_alloc_pendingsignalblock(sq_queue_t *siglist,
|
||||
uint16_t nsigs, uint8_t sigtype)
|
||||
{
|
||||
FAR sigpendq_t *sigpendalloc;
|
||||
@@ -193,14 +193,14 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_initialize
|
||||
* Name: nxsig_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform one-time power-up initialization
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_initialize(void)
|
||||
void nxsig_initialize(void)
|
||||
{
|
||||
/* Initialize free lists */
|
||||
|
||||
@@ -213,30 +213,30 @@ void sig_initialize(void)
|
||||
/* Add a block of signal structures to each list */
|
||||
|
||||
g_sigpendingactionalloc =
|
||||
sig_allocateblock(&g_sigpendingaction,
|
||||
nxsig_alloc_block(&g_sigpendingaction,
|
||||
NUM_PENDING_ACTIONS,
|
||||
SIG_ALLOC_FIXED);
|
||||
|
||||
g_sigpendingirqactionalloc =
|
||||
sig_allocateblock(&g_sigpendingirqaction,
|
||||
nxsig_alloc_block(&g_sigpendingirqaction,
|
||||
NUM_PENDING_INT_ACTIONS,
|
||||
SIG_ALLOC_IRQ);
|
||||
|
||||
sig_allocateactionblock();
|
||||
nxsig_alloc_actionblock();
|
||||
|
||||
g_sigpendingsignalalloc =
|
||||
sig_allocatependingsignalblock(&g_sigpendingsignal,
|
||||
nxsig_alloc_pendingsignalblock(&g_sigpendingsignal,
|
||||
NUM_SIGNALS_PENDING,
|
||||
SIG_ALLOC_FIXED);
|
||||
|
||||
g_sigpendingirqsignalalloc =
|
||||
sig_allocatependingsignalblock(&g_sigpendingirqsignal,
|
||||
nxsig_alloc_pendingsignalblock(&g_sigpendingirqsignal,
|
||||
NUM_INT_SIGNALS_PENDING,
|
||||
SIG_ALLOC_IRQ);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_allocateactionblock
|
||||
* Name: nxsig_alloc_actionblock
|
||||
*
|
||||
* Description:
|
||||
* Allocate a block of signal actions and place them
|
||||
@@ -244,7 +244,7 @@ void sig_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_allocateactionblock(void)
|
||||
void nxsig_alloc_actionblock(void)
|
||||
{
|
||||
FAR sigactq_t *sigact;
|
||||
int i;
|
||||
|
||||
@@ -123,7 +123,7 @@ int kill(pid_t pid, int signo)
|
||||
|
||||
/* Send the signal */
|
||||
|
||||
ret = sig_dispatch(pid, &info);
|
||||
ret = nxsig_dispatch(pid, &info);
|
||||
sched_unlock();
|
||||
|
||||
if (ret < 0)
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_lowest
|
||||
* Name: nxsig_lowest
|
||||
*
|
||||
* Description:
|
||||
* Return the lowest signal number that is a member of a set of signals.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_lowest(sigset_t *set)
|
||||
int nxsig_lowest(sigset_t *set)
|
||||
{
|
||||
int signo;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_mqnotempty.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -53,7 +53,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_mqnotempty
|
||||
* Name: nxsig_mqnotempty
|
||||
*
|
||||
* Description:
|
||||
* This function is equivalent to sigqueue(), but supports the messaging
|
||||
@@ -64,9 +64,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
int sig_mqnotempty(int pid, int signo, union sigval value)
|
||||
int nxsig_mqnotempty(int pid, int signo, union sigval value)
|
||||
#else
|
||||
int sig_mqnotempty(int pid, int signo, void *sival_ptr)
|
||||
int nxsig_mqnotempty(int pid, int signo, void *sival_ptr)
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||
@@ -106,7 +106,7 @@ int sig_mqnotempty(int pid, int signo, void *sival_ptr)
|
||||
/* Process the receipt of the signal */
|
||||
|
||||
sched_lock();
|
||||
ret = sig_dispatch(pid, &info);
|
||||
ret = nxsig_dispatch(pid, &info);
|
||||
sched_unlock();
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_notification.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -80,7 +80,7 @@ struct sig_notify_s
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_ntworker
|
||||
* Name: nxsig_notify_worker
|
||||
*
|
||||
* Description:
|
||||
* Perform the callback from the context of the worker thread.
|
||||
@@ -93,7 +93,7 @@ struct sig_notify_s
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void sig_ntworker(FAR void *arg)
|
||||
static void nxsig_notify_worker(FAR void *arg)
|
||||
{
|
||||
FAR struct sig_notify_s *notify = (FAR struct sig_notify_s *)arg;
|
||||
|
||||
@@ -117,7 +117,7 @@ static void sig_ntworker(FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_notification
|
||||
* Name: nxsig_notification
|
||||
*
|
||||
* Description:
|
||||
* Notify a client a signal event via a function call. This function is
|
||||
@@ -125,17 +125,18 @@ static void sig_ntworker(FAR void *arg)
|
||||
* event notification for the case of SIGEV_THREAD.
|
||||
*
|
||||
* Input Parameters:
|
||||
* pid - The task/thread ID a the client thread to be signaled.
|
||||
* pid - The task/thread ID a the client thread to be signaled.
|
||||
* event - The instance of struct sigevent that describes how to signal
|
||||
* the client.
|
||||
* the client.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; A negated errno value is returned
|
||||
* on failure.
|
||||
* This is an internal OS interface and should not be used by applications.
|
||||
* It follows the NuttX internal error return policy: Zero (OK) is
|
||||
* returned on success. A negated errno value is returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_notification(pid_t pid, FAR struct sigevent *event)
|
||||
int nxsig_notification(pid_t pid, FAR struct sigevent *event)
|
||||
{
|
||||
FAR struct sig_notify_s *notify;
|
||||
DEBUGASSERT(event != NULL && event->sigev_notify_function != NULL);
|
||||
@@ -160,7 +161,8 @@ int sig_notification(pid_t pid, FAR struct sigevent *event)
|
||||
|
||||
/* Then queue the work */
|
||||
|
||||
ret = work_queue(NTWORK, ¬ify->nt_work, sig_ntworker, notify, 0);
|
||||
ret = work_queue(NTWORK, ¬ify->nt_work, nxsig_notify_worker,
|
||||
notify, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
kmm_free(notify);
|
||||
|
||||
@@ -76,7 +76,7 @@ int sigpending(FAR sigset_t *set)
|
||||
|
||||
if (set)
|
||||
{
|
||||
*set = sig_pendingset(rtcb);
|
||||
*set = nxsig_pendingset(rtcb);
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
@@ -84,14 +84,14 @@ int sigpending(FAR sigset_t *set)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_pendingset
|
||||
* Name: nxsig_pendingset
|
||||
*
|
||||
* Description:
|
||||
* Convert the list of pending signals into a signal set
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
sigset_t sig_pendingset(FAR struct tcb_s *stcb)
|
||||
sigset_t nxsig_pendingset(FAR struct tcb_s *stcb)
|
||||
{
|
||||
FAR struct task_group_s *group = stcb->group;
|
||||
sigset_t sigpendset;
|
||||
|
||||
@@ -154,7 +154,7 @@ int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
|
||||
|
||||
/* Now, process any pending signals that were just unmasked */
|
||||
|
||||
sig_unmaskpendingsignal();
|
||||
nxsig_unmask_pendingsignal();
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
|
||||
@@ -129,7 +129,7 @@ int sigqueue(int pid, int signo, void *sival_ptr)
|
||||
/* Send the signal */
|
||||
|
||||
sched_lock();
|
||||
ret = sig_dispatch(pid, &info);
|
||||
ret = nxsig_dispatch(pid, &info);
|
||||
sched_unlock();
|
||||
|
||||
/* Check for errors */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_releasependingsigaction.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -50,14 +50,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_releasependingsigaction
|
||||
* Name: nxsig_release_pendingsigaction
|
||||
*
|
||||
* Description:
|
||||
* Deallocate a pending signal action Q entry
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_releasependingsigaction(FAR sigq_t *sigq)
|
||||
void nxsig_release_pendingsigaction(FAR sigq_t *sigq)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_releasependingsignal.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,14 +58,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_releasependingsignal
|
||||
* Name: nxsig_release_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Deallocate a pending signal list entry
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_releasependingsignal(FAR sigpendq_t *sigpend)
|
||||
void nxsig_release_pendingsignal(FAR sigpendq_t *sigpend)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_removependingsignal.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2013-2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2013-2014, 2016-2017 Gregory Nutt. All
|
||||
* rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,14 +59,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_removependingsignal
|
||||
* Name: nxsig_remove_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Remove the specified signal from the signal pending list
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR sigpendq_t *sig_removependingsignal(FAR struct tcb_s *stcb, int signo)
|
||||
FAR sigpendq_t *nxsig_remove_pendingsignal(FAR struct tcb_s *stcb, int signo)
|
||||
{
|
||||
FAR struct task_group_s *group = stcb->group;
|
||||
FAR sigpendq_t *currsig;
|
||||
|
||||
@@ -116,7 +116,7 @@ int sigsuspend(FAR const sigset_t *set)
|
||||
* signals that will be unblocked by the new sigprocmask.
|
||||
*/
|
||||
|
||||
intersection = ~(*set) & sig_pendingset(rtcb);
|
||||
intersection = ~(*set) & nxsig_pendingset(rtcb);
|
||||
if (intersection != NULL_SIGNAL_SET)
|
||||
{
|
||||
/* One or more of the signals in intersections is sufficient to cause
|
||||
@@ -124,11 +124,11 @@ int sigsuspend(FAR const sigset_t *set)
|
||||
* pending.
|
||||
*/
|
||||
|
||||
unblocksigno = sig_lowest(&intersection);
|
||||
sigpend = sig_removependingsignal(rtcb, unblocksigno);
|
||||
unblocksigno = nxsig_lowest(&intersection);
|
||||
sigpend = nxsig_remove_pendingsignal(rtcb, unblocksigno);
|
||||
ASSERT(sigpend);
|
||||
|
||||
sig_releasependingsignal(sigpend);
|
||||
nxsig_release_pendingsignal(sigpend);
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
else
|
||||
@@ -155,7 +155,7 @@ int sigsuspend(FAR const sigset_t *set)
|
||||
* sigprocmask will unblock the signal.
|
||||
*/
|
||||
|
||||
sig_unmaskpendingsignal();
|
||||
nxsig_unmask_pendingsignal();
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_timeout
|
||||
* Name: nxsig_timeout
|
||||
*
|
||||
* Description:
|
||||
* A timeout elapsed while waiting for signals to be queued.
|
||||
@@ -84,7 +84,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void sig_timeout(int argc, wdparm_t itcb)
|
||||
static void nxsig_timeout(int argc, wdparm_t itcb)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags;
|
||||
@@ -216,7 +216,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
||||
* signals in the pending signal set argument.
|
||||
*/
|
||||
|
||||
intersection = *set & sig_pendingset(rtcb);
|
||||
intersection = *set & nxsig_pendingset(rtcb);
|
||||
if (intersection != NULL_SIGNAL_SET)
|
||||
{
|
||||
/* One or more of the signals in intersections is sufficient to cause
|
||||
@@ -224,7 +224,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
||||
* pending.
|
||||
*/
|
||||
|
||||
sigpend = sig_removependingsignal(rtcb, sig_lowest(&intersection));
|
||||
sigpend = nxsig_remove_pendingsignal(rtcb, nxsig_lowest(&intersection));
|
||||
ASSERT(sigpend);
|
||||
|
||||
/* Return the signal info to the caller if so requested */
|
||||
@@ -240,7 +240,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
||||
|
||||
/* Then dispose of the pending signal structure properly */
|
||||
|
||||
sig_releasependingsignal(sigpend);
|
||||
nxsig_release_pendingsignal(sigpend);
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
@@ -293,8 +293,8 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
||||
|
||||
/* Start the watchdog */
|
||||
|
||||
wd_start(rtcb->waitdog, waitticks, (wdentry_t)sig_timeout, 1,
|
||||
wdparm.pvarg);
|
||||
wd_start(rtcb->waitdog, waitticks, (wdentry_t)nxsig_timeout,
|
||||
1, wdparm.pvarg);
|
||||
|
||||
/* Now wait for either the signal or the watchdog */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/sig_unmaskpendingsignal.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -49,7 +49,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_unmaskpendingsignal
|
||||
* Name: nxsig_unmask_pendingsignal
|
||||
*
|
||||
* Description:
|
||||
* Based upon the current setting of the sigprocmask, this function
|
||||
@@ -58,7 +58,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sig_unmaskpendingsignal(void)
|
||||
void nxsig_unmask_pendingsignal(void)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
sigset_t unmaskedset;
|
||||
@@ -78,7 +78,7 @@ void sig_unmaskpendingsignal(void)
|
||||
* can only be changed on this thread of execution.
|
||||
*/
|
||||
|
||||
unmaskedset = ~(rtcb->sigprocmask) & sig_pendingset(rtcb);
|
||||
unmaskedset = ~(rtcb->sigprocmask) & nxsig_pendingset(rtcb);
|
||||
|
||||
/* Loop while there are unmasked pending signals to be processed. */
|
||||
|
||||
@@ -88,7 +88,7 @@ void sig_unmaskpendingsignal(void)
|
||||
* to highest
|
||||
*/
|
||||
|
||||
signo = sig_lowest(&unmaskedset);
|
||||
signo = nxsig_lowest(&unmaskedset);
|
||||
if (signo != ERROR)
|
||||
{
|
||||
/* Remove the signal from the set of unmasked signals. NOTE:
|
||||
@@ -100,7 +100,7 @@ void sig_unmaskpendingsignal(void)
|
||||
|
||||
/* Remove the pending signal from the list of pending signals */
|
||||
|
||||
if ((pendingsig = sig_removependingsignal(rtcb, signo)) != NULL)
|
||||
if ((pendingsig = nxsig_remove_pendingsignal(rtcb, signo)) != NULL)
|
||||
{
|
||||
/* If there is one, then process it like a normal signal.
|
||||
* Since the signal was pending, then unblocked on this
|
||||
@@ -109,11 +109,11 @@ void sig_unmaskpendingsignal(void)
|
||||
* other than this thread.
|
||||
*/
|
||||
|
||||
sig_tcbdispatch(rtcb, &pendingsig->info);
|
||||
nxsig_tcbdispatch(rtcb, &pendingsig->info);
|
||||
|
||||
/* Then remove it from the pending signal list */
|
||||
|
||||
sig_releasependingsignal(pendingsig);
|
||||
nxsig_release_pendingsignal(pendingsig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-19
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* sched/signal/signal.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -161,41 +162,41 @@ struct task_group_s;
|
||||
|
||||
/* sig_initializee.c */
|
||||
|
||||
void weak_function sig_initialize(void);
|
||||
void sig_allocateactionblock(void);
|
||||
void weak_function nxsig_initialize(void);
|
||||
void nxsig_alloc_actionblock(void);
|
||||
|
||||
/* sig_action.c */
|
||||
|
||||
void sig_releaseaction(FAR sigactq_t *sigact);
|
||||
void nxsig_release_action(FAR sigactq_t *sigact);
|
||||
|
||||
/* sig_pending.c */
|
||||
|
||||
sigset_t sig_pendingset(FAR struct tcb_s *stcb);
|
||||
sigset_t nxsig_pendingset(FAR struct tcb_s *stcb);
|
||||
|
||||
/* sig_dispatch.c */
|
||||
|
||||
int sig_tcbdispatch(FAR struct tcb_s *stcb, FAR siginfo_t *info);
|
||||
int sig_dispatch(pid_t pid, FAR siginfo_t *info);
|
||||
int nxsig_tcbdispatch(FAR struct tcb_s *stcb, FAR siginfo_t *info);
|
||||
int nxsig_dispatch(pid_t pid, FAR siginfo_t *info);
|
||||
|
||||
/* sig_cleanup.c */
|
||||
|
||||
void sig_cleanup(FAR struct tcb_s *stcb);
|
||||
void sig_release(FAR struct task_group_s *group);
|
||||
void nxsig_cleanup(FAR struct tcb_s *stcb);
|
||||
void nxsig_release(FAR struct task_group_s *group);
|
||||
|
||||
/* In files of the same name */
|
||||
|
||||
FAR sigq_t *sig_allocatependingsigaction(void);
|
||||
void sig_deliver(FAR struct tcb_s *stcb);
|
||||
FAR sigactq_t *sig_findaction(FAR struct task_group_s *group, int signo);
|
||||
int sig_lowest(FAR sigset_t *set);
|
||||
FAR sigq_t *nxsig_alloc_pendingsigaction(void);
|
||||
void nxsig_deliver(FAR struct tcb_s *stcb);
|
||||
FAR sigactq_t *nxsig_find_action(FAR struct task_group_s *group, int signo);
|
||||
int nxsig_lowest(FAR sigset_t *set);
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
int sig_mqnotempty(int tid, int signo, union sigval value);
|
||||
int nxsig_mqnotempty(int tid, int signo, union sigval value);
|
||||
#else
|
||||
int sig_mqnotempty(int tid, int signo, FAR void *sival_ptr);
|
||||
int nxsig_mqnotempty(int tid, int signo, FAR void *sival_ptr);
|
||||
#endif
|
||||
void sig_releasependingsigaction(FAR sigq_t *sigq);
|
||||
void sig_releasependingsignal(FAR sigpendq_t *sigpend);
|
||||
FAR sigpendq_t *sig_removependingsignal(FAR struct tcb_s *stcb, int signo);
|
||||
void sig_unmaskpendingsignal(void);
|
||||
void nxsig_release_pendingsigaction(FAR sigq_t *sigq);
|
||||
void nxsig_release_pendingsignal(FAR sigpendq_t *sigpend);
|
||||
FAR sigpendq_t *nxsig_remove_pendingsignal(FAR struct tcb_s *stcb, int signo);
|
||||
void nxsig_unmask_pendingsignal(void);
|
||||
|
||||
#endif /* __SCHED_SIGNAL_SIGNAL_H */
|
||||
|
||||
@@ -405,7 +405,7 @@ static inline void task_sigchild(FAR struct tcb_s *ptcb,
|
||||
* can provide the correct si_code value with the signal.
|
||||
*/
|
||||
|
||||
(void)sig_tcbdispatch(ptcb, &info);
|
||||
(void)nxsig_tcbdispatch(ptcb, &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ void task_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking)
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
/* Deallocate anything left in the TCB's queues */
|
||||
|
||||
sig_cleanup(tcb); /* Deallocate Signal lists */
|
||||
nxsig_cleanup(tcb); /* Deallocate Signal lists */
|
||||
#endif
|
||||
|
||||
/* This function can be re-entered in certain cases. Set a flag
|
||||
|
||||
@@ -158,7 +158,7 @@ int task_restart(pid_t pid)
|
||||
|
||||
/* Deallocate anything left in the TCB's queues */
|
||||
|
||||
sig_cleanup((FAR struct tcb_s *)tcb); /* Deallocate Signal lists */
|
||||
nxsig_cleanup((FAR struct tcb_s *)tcb); /* Deallocate Signal lists */
|
||||
|
||||
/* Reset the current task priority */
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ static inline void timer_signotify(FAR struct posix_timer_s *timer)
|
||||
|
||||
/* Send the signal */
|
||||
|
||||
DEBUGVERIFY(sig_dispatch(timer->pt_owner, &info));
|
||||
DEBUGVERIFY(nxsig_dispatch(timer->pt_owner, &info));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
@@ -117,7 +117,7 @@ static inline void timer_signotify(FAR struct posix_timer_s *timer)
|
||||
|
||||
else if (timer->pt_event.sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
DEBUGVERIFY(sig_notification(timer->pt_owner, &timer->pt_event));
|
||||
DEBUGVERIFY(nxsig_notification(timer->pt_owner, &timer->pt_event));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user