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:
Gregory Nutt
2017-10-05 13:25:25 -06:00
parent 7cc63f90d9
commit 8198ba6a6d
37 changed files with 187 additions and 181 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
########################################################################### ###########################################################################
# configs/ea3131/locked/mklocked.sh # 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> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -168,7 +168,7 @@ fi
answer=$(checkconfig CONFIG_DISABLE_SIGNALS) answer=$(checkconfig CONFIG_DISABLE_SIGNALS)
if [ "$answer" = n ]; then if [ "$answer" = n ]; then
echo "EXTERN(sig_initialize)" >>ld-locked.inc echo "EXTERN(nxsig_initialize)" >>ld-locked.inc
fi fi
echo "EXTERN(sem_initialize)" >>ld-locked.inc echo "EXTERN(sem_initialize)" >>ld-locked.inc
+2 -2
View File
@@ -112,10 +112,10 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp)
else if (aiocbp->aio_sigevent.sigev_notify == SIGEV_THREAD) 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) if (ret < 0)
{ {
ferr("ERROR: sig_notification failed: %d\n", ret); ferr("ERROR: nxsig_notification failed: %d\n", ret);
} }
} }
#endif #endif
+6 -5
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* include/nuttx/signal.h * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_notification * Name: nxsig_notification
* *
* Description: * Description:
* Notify a client a signal event via a function call. This function is * Notify a client a signal event via a function call. This function is
@@ -65,12 +65,13 @@
* the client. * the client.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned * This is an internal OS interface and should not be used by applications.
* on failure. * 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 /* CONFIG_SIG_EVTHREAD && CONFIG_BUILD_FLAT */
#endif /* __INCLUDE_NUTTX_SIGNAL_H */ #endif /* __INCLUDE_NUTTX_SIGNAL_H */
+2 -2
View File
@@ -207,7 +207,7 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext)
else if (ighand->sig->sigev_notify == SIGEV_THREAD) else if (ighand->sig->sigev_notify == SIGEV_THREAD)
{ {
DEBUGASSERT(sig_notification(sighand->pid, &sighand->sig)); DEBUGASSERT(nxsig_notification(sighand->pid, &sighand->sig));
} }
#endif #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) 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) if (status < 0 && ret == OK)
{ {
/* Something bad happened while performing the notification /* Something bad happened while performing the notification
+1 -1
View File
@@ -149,7 +149,7 @@ static inline void group_release(FAR struct task_group_s *group)
#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_DISABLE_SIGNALS
/* Release pending signals */ /* Release pending signals */
sig_release(group); nxsig_release(group);
#endif #endif
#ifndef CONFIG_DISABLE_PTHREAD #ifndef CONFIG_DISABLE_PTHREAD
+4 -4
View File
@@ -121,7 +121,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
* receive the signal. * receive the signal.
*/ */
ret = sig_tcbdispatch(tcb, info->siginfo); ret = nxsig_tcbdispatch(tcb, info->siginfo);
if (ret < 0) if (ret < 0)
{ {
return ret; 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? */ /* 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) if (sigact)
{ {
/* Yes.. then use this thread. The requirement is this: /* 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. * blocking the signal will receive the signal.
*/ */
ret = sig_tcbdispatch(tcb, info->siginfo); ret = nxsig_tcbdispatch(tcb, info->siginfo);
if (ret < 0) if (ret < 0)
{ {
return ret; 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 */ /* Now deliver the signal to the selected group member */
ret = sig_tcbdispatch(tcb, siginfo); ret = nxsig_tcbdispatch(tcb, siginfo);
} }
errout: errout:
+2 -2
View File
@@ -638,10 +638,10 @@ void os_start(void)
/* Initialize the signal facility (if in link) */ /* Initialize the signal facility (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS #ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (sig_initialize != NULL) if (nxsig_initialize != NULL)
#endif #endif
{ {
sig_initialize(); nxsig_initialize();
} }
#endif #endif
+4 -4
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/mqueue/mq_sndinternal.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -416,10 +416,10 @@ 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? */ /* Yes... Queue the signal -- What if this returns an error? */
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo, DEBUGVERIFY(nxsig_mqnotempty(pid, event.sigev_signo,
event.sigev_value)); event.sigev_value));
#else #else
DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo, DEBUGVERIFY(nxsig_mqnotempty(pid, event.sigev_signo,
event.sigev_value.sival_ptr)); event.sigev_value.sival_ptr));
#endif #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) else if (event.sigev_notify == SIGEV_THREAD)
{ {
DEBUGVERIFY(sig_notification(pid, &event)); DEBUGVERIFY(nxsig_notification(pid, &event));
} }
#endif #endif
+3 -3
View File
@@ -88,8 +88,8 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo)
FAR struct tcb_s *tcb; FAR struct tcb_s *tcb;
siginfo_t info; siginfo_t info;
/* The logic below if equivalent to sigqueue(), but uses sig_tcbdispatch() /* The logic below if equivalent to sigqueue(), but uses nxsig_tcbdispatch()
* instead of sig_dispatch(). This avoids the group signal deliver logic * instead of nxsig_dispatch(). This avoids the group signal deliver logic
* and assures, instead, that the signal is delivered specifically to this * and assures, instead, that the signal is delivered specifically to this
* thread that is known to be waiting on the signal. * 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. * a watchdog timer interrupt handler.
*/ */
(void)sig_tcbdispatch(tcb, &info); (void)nxsig_tcbdispatch(tcb, &info);
} }
#else /* HAVE_GROUP_MEMBERS */ #else /* HAVE_GROUP_MEMBERS */
+1 -1
View File
@@ -136,7 +136,7 @@ int pthread_kill(pthread_t thread, int signo)
* dispatch rules. * dispatch rules.
*/ */
ret = sig_tcbdispatch(stcb, &info); ret = nxsig_tcbdispatch(stcb, &info);
sched_unlock(); sched_unlock();
if (ret < 0) if (ret < 0)
+1 -1
View File
@@ -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. * Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -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. * Copyright (C) 2007-2010, 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -38,7 +38,7 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CSRCS += sig_initialize.c CSRCS += sig_initialize.c
CSRCS += sig_action.c sig_procmask.c sig_pending.c sig_suspend.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_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_releasependingsigaction.c sig_unmaskpendingsignal.c
CSRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c CSRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c
CSRCS += sig_mqnotempty.c sig_cleanup.c sig_dispatch.c sig_deliver.c CSRCS += sig_mqnotempty.c sig_cleanup.c sig_dispatch.c sig_deliver.c
+10 -9
View File
@@ -1,7 +1,8 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_action.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -65,14 +66,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_allocateaction * Name: nxsig_alloc_action
* *
* Description: * Description:
* Allocate a new element for a sigaction queue * 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; FAR sigactq_t *sigact;
@@ -86,7 +87,7 @@ static FAR sigactq_t *sig_allocateaction(void)
{ {
/* Add another block of signal actions to the list */ /* Add another block of signal actions to the list */
sig_allocateactionblock(); nxsig_alloc_actionblock();
/* And try again */ /* 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 */ /* 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 */ /* 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 */ /* 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. */ /* 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 */ /* 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: * Description:
* Deallocate a sigaction Q entry * 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 */ /* Just put it back on the free list */
@@ -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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -52,14 +52,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_allocatependingsigaction * Name: nxsig_alloc_pendingsigaction
* *
* Description: * Description:
* Allocate a new element for the pending signal action queue * 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; FAR sigq_t *sigq;
irqstate_t flags; irqstate_t flags;
+9 -9
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_cleanup.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_cleanup * Name: nxsig_cleanup
* *
* Description: * Description:
* Deallocate all signal-related lists in a TCB. This function is * 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; 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) 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 */ /* Deallocate all entries in the list of posted signal actions */
while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpostedq)) != NULL) while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpostedq)) != NULL)
{ {
sig_releasependingsigaction(sigq); nxsig_release_pendingsigaction(sigq);
} }
/* Misc. signal-related clean-up */ /* Misc. signal-related clean-up */
@@ -81,7 +81,7 @@ void sig_cleanup(FAR struct tcb_s *stcb)
} }
/**************************************************************************** /****************************************************************************
* Name: sig_release * Name: nxsig_release
* *
* Description: * Description:
* Deallocate all signal-related lists in a group. This function is * 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 sigactq_t *sigact;
FAR sigpendq_t *sigpend; 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) 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 */ /* Deallocate all entries in the list of pending signals */
while ((sigpend = (FAR sigpendq_t *)sq_remfirst(&group->tg_sigpendingq)) != NULL) while ((sigpend = (FAR sigpendq_t *)sq_remfirst(&group->tg_sigpendingq)) != NULL)
{ {
sig_releasependingsignal(sigpend); nxsig_release_pendingsignal(sigpend);
} }
} }
+4 -4
View File
@@ -57,7 +57,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_deliver * Name: nxsig_deliver
* *
* Description: * Description:
* This function is called on the thread of execution of the signal * 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 *sigq;
FAR sigq_t *next; FAR sigq_t *next;
@@ -151,7 +151,7 @@ void sig_deliver(FAR struct tcb_s *stcb)
* original sigprocmask will unblock the signal. * original sigprocmask will unblock the signal.
*/ */
sig_unmaskpendingsignal(); nxsig_unmask_pendingsignal();
/* Remove the signal from the sigpostedq */ /* Remove the signal from the sigpostedq */
@@ -161,7 +161,7 @@ void sig_deliver(FAR struct tcb_s *stcb)
/* Then deallocate it */ /* Then deallocate it */
sig_releasependingsigaction(sigq); nxsig_release_pendingsigaction(sigq);
} }
stcb->pterrno = saved_errno; stcb->pterrno = saved_errno;
+26 -26
View File
@@ -60,7 +60,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_queueaction * Name: nxsig_queue_action
* *
* Description: * Description:
* Queue a signal action for delivery to a task. * 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 sigactq_t *sigact;
FAR sigq_t *sigq; 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 */ /* 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 /* Check if a valid signal handler is available and if the signal is
* unblocked. NOTE: There is no default action. * 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)) if ((sigact) && (sigact->act.sa_u._sa_sigaction))
{ {
/* Allocate a new element for the signal queue. NOTE: /* 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 */ * unable to allocate memory for the signal data */
sigq = sig_allocatependingsigaction(); sigq = nxsig_alloc_pendingsigaction();
if (!sigq) if (!sigq)
{ {
ret = -ENOMEM; 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: * Description:
* Allocate a pending signal list entry * 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; FAR sigpendq_t *sigpend;
irqstate_t flags; irqstate_t flags;
@@ -186,15 +186,15 @@ static FAR sigpendq_t *sig_allocatependingsignal(void)
} }
/**************************************************************************** /****************************************************************************
* Name: sig_findpendingsignal * Name: nxsig_find_pendingsignal
* *
* Description: * Description:
* Find a specified element in the pending signal list * Find a specified element in the pending signal list
* *
****************************************************************************/ ****************************************************************************/
static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group, static FAR sigpendq_t *
int signo) nxsig_find_pendingsignal(FAR struct task_group_s *group, int signo)
{ {
FAR sigpendq_t *sigpend = NULL; FAR sigpendq_t *sigpend = NULL;
irqstate_t flags; 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: * Description:
* Add the specified signal to the signal pending list. NOTE: This * Add the specified signal to the signal pending list. NOTE: This
@@ -226,7 +226,7 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
* *
****************************************************************************/ ****************************************************************************/
static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb, static FAR sigpendq_t *nxsig_add_pendingsignal(FAR struct tcb_s *stcb,
FAR siginfo_t *info) FAR siginfo_t *info)
{ {
FAR struct task_group_s *group; FAR struct task_group_s *group;
@@ -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 */ /* 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) if (sigpend)
{ {
/* The signal is already pending... retain only one copy */ /* 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 */ /* Allocate a new pending signal entry */
sigpend = sig_allocatependingsignal(); sigpend = nxsig_alloc_pendingsignal();
if (sigpend) if (sigpend)
{ {
/* Put the signal information into the allocated structure */ /* 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: * Description:
* All signals received the task (whatever the source) go through this * 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; irqstate_t flags;
int ret = OK; int ret = OK;
@@ -337,7 +337,7 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
else else
{ {
leave_critical_section(flags); 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 #endif
/* Queue any sigaction's requested by this task. */ /* 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 */ /* 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. * recipient's thread.
*/ */
up_schedule_sigaction(stcb, sig_deliver); up_schedule_sigaction(stcb, nxsig_deliver);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Resume the paused CPU (if any) */ /* 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: * 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, * be used to dispatch a signal. If HAVE_GROUP_MEMBERS is defined,
* then function will follow the group signal delivery algorthrims: * then function will follow the group signal delivery algorthrims:
* *
* This front-end does the following things before calling * This front-end does the following things before calling
* sig_tcbdispatch. * nxsig_tcbdispatch.
* *
* With HAVE_GROUP_MEMBERS defined: * With HAVE_GROUP_MEMBERS defined:
* - Get the TCB associated with the pid. * - 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 * - If the PID has already exited, lookup the group that that was
* started by this task. * started by this task.
* - Use the group to pick the TCB to receive the signal * - 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 * With HAVE_GROUP_MEMBERS *not* defined
* - Get the TCB associated with the pid. * - Get the TCB associated with the pid.
* - Call sig_tcbdispatch with the TCB * - Call nxsig_tcbdispatch with the TCB
* *
* Returned Value: * Returned Value:
* Returns 0 (OK) on success or a negated errno value on failure. * 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 #ifdef HAVE_GROUP_MEMBERS
FAR struct tcb_s *stcb; FAR struct tcb_s *stcb;
@@ -509,7 +509,7 @@ int sig_dispatch(pid_t pid, FAR siginfo_t *info)
return -ESRCH; return -ESRCH;
} }
return sig_tcbdispatch(stcb, info); return nxsig_tcbdispatch(stcb, info);
#endif #endif
} }
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_findaction.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -45,14 +45,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_findaction * Name: nxsig_find_action
* *
* Description: * Description:
* Allocate a new element for a signal queue * 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; FAR sigactq_t *sigact = NULL;
+16 -16
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_initialize.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -118,9 +118,9 @@ static sigpendq_t *g_sigpendingirqsignalalloc;
* Private Function Prototypes * 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); 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); 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: * Description:
* Allocate a block of pending signal actions and place them * 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) uint8_t sigtype)
{ {
FAR sigq_t *sigqalloc; 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: * Description:
* Allocate a block of pending signal structures and place them on * 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) uint16_t nsigs, uint8_t sigtype)
{ {
FAR sigpendq_t *sigpendalloc; FAR sigpendq_t *sigpendalloc;
@@ -193,14 +193,14 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist,
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_initialize * Name: nxsig_initialize
* *
* Description: * Description:
* Perform one-time power-up initialization * Perform one-time power-up initialization
* *
****************************************************************************/ ****************************************************************************/
void sig_initialize(void) void nxsig_initialize(void)
{ {
/* Initialize free lists */ /* Initialize free lists */
@@ -213,30 +213,30 @@ void sig_initialize(void)
/* Add a block of signal structures to each list */ /* Add a block of signal structures to each list */
g_sigpendingactionalloc = g_sigpendingactionalloc =
sig_allocateblock(&g_sigpendingaction, nxsig_alloc_block(&g_sigpendingaction,
NUM_PENDING_ACTIONS, NUM_PENDING_ACTIONS,
SIG_ALLOC_FIXED); SIG_ALLOC_FIXED);
g_sigpendingirqactionalloc = g_sigpendingirqactionalloc =
sig_allocateblock(&g_sigpendingirqaction, nxsig_alloc_block(&g_sigpendingirqaction,
NUM_PENDING_INT_ACTIONS, NUM_PENDING_INT_ACTIONS,
SIG_ALLOC_IRQ); SIG_ALLOC_IRQ);
sig_allocateactionblock(); nxsig_alloc_actionblock();
g_sigpendingsignalalloc = g_sigpendingsignalalloc =
sig_allocatependingsignalblock(&g_sigpendingsignal, nxsig_alloc_pendingsignalblock(&g_sigpendingsignal,
NUM_SIGNALS_PENDING, NUM_SIGNALS_PENDING,
SIG_ALLOC_FIXED); SIG_ALLOC_FIXED);
g_sigpendingirqsignalalloc = g_sigpendingirqsignalalloc =
sig_allocatependingsignalblock(&g_sigpendingirqsignal, nxsig_alloc_pendingsignalblock(&g_sigpendingirqsignal,
NUM_INT_SIGNALS_PENDING, NUM_INT_SIGNALS_PENDING,
SIG_ALLOC_IRQ); SIG_ALLOC_IRQ);
} }
/**************************************************************************** /****************************************************************************
* Name: sig_allocateactionblock * Name: nxsig_alloc_actionblock
* *
* Description: * Description:
* Allocate a block of signal actions and place them * 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; FAR sigactq_t *sigact;
int i; int i;
+1 -1
View File
@@ -123,7 +123,7 @@ int kill(pid_t pid, int signo)
/* Send the signal */ /* Send the signal */
ret = sig_dispatch(pid, &info); ret = nxsig_dispatch(pid, &info);
sched_unlock(); sched_unlock();
if (ret < 0) if (ret < 0)
+2 -2
View File
@@ -48,14 +48,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_lowest * Name: nxsig_lowest
* *
* Description: * Description:
* Return the lowest signal number that is a member of a set of signals. * 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; int signo;
+5 -5
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_mqnotempty.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_mqnotempty * Name: nxsig_mqnotempty
* *
* Description: * Description:
* This function is equivalent to sigqueue(), but supports the messaging * This function is equivalent to sigqueue(), but supports the messaging
@@ -64,9 +64,9 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_CAN_PASS_STRUCTS #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 #else
int sig_mqnotempty(int pid, int signo, void *sival_ptr) int nxsig_mqnotempty(int pid, int signo, void *sival_ptr)
#endif #endif
{ {
#ifdef CONFIG_SCHED_HAVE_PARENT #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 */ /* Process the receipt of the signal */
sched_lock(); sched_lock();
ret = sig_dispatch(pid, &info); ret = nxsig_dispatch(pid, &info);
sched_unlock(); sched_unlock();
return ret; return ret;
+10 -8
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_notification.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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: * Description:
* Perform the callback from the context of the worker thread. * 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; 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: * Description:
* Notify a client a signal event via a function call. This function is * Notify a client a signal event via a function call. This function is
@@ -130,12 +130,13 @@ static void sig_ntworker(FAR void *arg)
* the client. * the client.
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned * This is an internal OS interface and should not be used by applications.
* on failure. * 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; FAR struct sig_notify_s *notify;
DEBUGASSERT(event != NULL && event->sigev_notify_function != NULL); 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 */ /* Then queue the work */
ret = work_queue(NTWORK, &notify->nt_work, sig_ntworker, notify, 0); ret = work_queue(NTWORK, &notify->nt_work, nxsig_notify_worker,
notify, 0);
if (ret < 0) if (ret < 0)
{ {
kmm_free(notify); kmm_free(notify);
+3 -3
View File
@@ -76,7 +76,7 @@ int sigpending(FAR sigset_t *set)
if (set) if (set)
{ {
*set = sig_pendingset(rtcb); *set = nxsig_pendingset(rtcb);
ret = OK; ret = OK;
} }
@@ -84,14 +84,14 @@ int sigpending(FAR sigset_t *set)
} }
/**************************************************************************** /****************************************************************************
* Name: sig_pendingset * Name: nxsig_pendingset
* *
* Description: * Description:
* Convert the list of pending signals into a signal set * 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; FAR struct task_group_s *group = stcb->group;
sigset_t sigpendset; sigset_t sigpendset;
+1 -1
View File
@@ -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 */ /* Now, process any pending signals that were just unmasked */
sig_unmaskpendingsignal(); nxsig_unmask_pendingsignal();
} }
sched_unlock(); sched_unlock();
+1 -1
View File
@@ -129,7 +129,7 @@ int sigqueue(int pid, int signo, void *sival_ptr)
/* Send the signal */ /* Send the signal */
sched_lock(); sched_lock();
ret = sig_dispatch(pid, &info); ret = nxsig_dispatch(pid, &info);
sched_unlock(); sched_unlock();
/* Check for errors */ /* Check for errors */
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_releasependingsigaction.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -50,14 +50,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_releasependingsigaction * Name: nxsig_release_pendingsigaction
* *
* Description: * Description:
* Deallocate a pending signal action Q entry * 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; irqstate_t flags;
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_releasependingsignal.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -58,14 +58,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_releasependingsignal * Name: nxsig_release_pendingsignal
* *
* Description: * Description:
* Deallocate a pending signal list entry * Deallocate a pending signal list entry
* *
****************************************************************************/ ****************************************************************************/
void sig_releasependingsignal(FAR sigpendq_t *sigpend) void nxsig_release_pendingsignal(FAR sigpendq_t *sigpend)
{ {
irqstate_t flags; irqstate_t flags;
+4 -3
View File
@@ -1,7 +1,8 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_removependingsignal.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -58,14 +59,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_removependingsignal * Name: nxsig_remove_pendingsignal
* *
* Description: * Description:
* Remove the specified signal from the signal pending list * 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 struct task_group_s *group = stcb->group;
FAR sigpendq_t *currsig; FAR sigpendq_t *currsig;
+5 -5
View File
@@ -116,7 +116,7 @@ int sigsuspend(FAR const sigset_t *set)
* signals that will be unblocked by the new sigprocmask. * signals that will be unblocked by the new sigprocmask.
*/ */
intersection = ~(*set) & sig_pendingset(rtcb); intersection = ~(*set) & nxsig_pendingset(rtcb);
if (intersection != NULL_SIGNAL_SET) if (intersection != NULL_SIGNAL_SET)
{ {
/* One or more of the signals in intersections is sufficient to cause /* One or more of the signals in intersections is sufficient to cause
@@ -124,11 +124,11 @@ int sigsuspend(FAR const sigset_t *set)
* pending. * pending.
*/ */
unblocksigno = sig_lowest(&intersection); unblocksigno = nxsig_lowest(&intersection);
sigpend = sig_removependingsignal(rtcb, unblocksigno); sigpend = nxsig_remove_pendingsignal(rtcb, unblocksigno);
ASSERT(sigpend); ASSERT(sigpend);
sig_releasependingsignal(sigpend); nxsig_release_pendingsignal(sigpend);
leave_critical_section(flags); leave_critical_section(flags);
} }
else else
@@ -155,7 +155,7 @@ int sigsuspend(FAR const sigset_t *set)
* sigprocmask will unblock the signal. * sigprocmask will unblock the signal.
*/ */
sig_unmaskpendingsignal(); nxsig_unmask_pendingsignal();
} }
sched_unlock(); sched_unlock();
+7 -7
View File
@@ -73,7 +73,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_timeout * Name: nxsig_timeout
* *
* Description: * Description:
* A timeout elapsed while waiting for signals to be queued. * 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 #ifdef CONFIG_SMP
irqstate_t flags; 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. * signals in the pending signal set argument.
*/ */
intersection = *set & sig_pendingset(rtcb); intersection = *set & nxsig_pendingset(rtcb);
if (intersection != NULL_SIGNAL_SET) if (intersection != NULL_SIGNAL_SET)
{ {
/* One or more of the signals in intersections is sufficient to cause /* 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. * pending.
*/ */
sigpend = sig_removependingsignal(rtcb, sig_lowest(&intersection)); sigpend = nxsig_remove_pendingsignal(rtcb, nxsig_lowest(&intersection));
ASSERT(sigpend); ASSERT(sigpend);
/* Return the signal info to the caller if so requested */ /* 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 */ /* Then dispose of the pending signal structure properly */
sig_releasependingsignal(sigpend); nxsig_release_pendingsignal(sigpend);
leave_critical_section(flags); leave_critical_section(flags);
} }
@@ -293,8 +293,8 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
/* Start the watchdog */ /* Start the watchdog */
wd_start(rtcb->waitdog, waitticks, (wdentry_t)sig_timeout, 1, wd_start(rtcb->waitdog, waitticks, (wdentry_t)nxsig_timeout,
wdparm.pvarg); 1, wdparm.pvarg);
/* Now wait for either the signal or the watchdog */ /* Now wait for either the signal or the watchdog */
+8 -8
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* sched/signal/sig_unmaskpendingsignal.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sig_unmaskpendingsignal * Name: nxsig_unmask_pendingsignal
* *
* Description: * Description:
* Based upon the current setting of the sigprocmask, this function * 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(); FAR struct tcb_s *rtcb = this_task();
sigset_t unmaskedset; sigset_t unmaskedset;
@@ -78,7 +78,7 @@ void sig_unmaskpendingsignal(void)
* can only be changed on this thread of execution. * 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. */ /* Loop while there are unmasked pending signals to be processed. */
@@ -88,7 +88,7 @@ void sig_unmaskpendingsignal(void)
* to highest * to highest
*/ */
signo = sig_lowest(&unmaskedset); signo = nxsig_lowest(&unmaskedset);
if (signo != ERROR) if (signo != ERROR)
{ {
/* Remove the signal from the set of unmasked signals. NOTE: /* 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 */ /* 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. /* If there is one, then process it like a normal signal.
* Since the signal was pending, then unblocked on this * Since the signal was pending, then unblocked on this
@@ -109,11 +109,11 @@ void sig_unmaskpendingsignal(void)
* other than this thread. * other than this thread.
*/ */
sig_tcbdispatch(rtcb, &pendingsig->info); nxsig_tcbdispatch(rtcb, &pendingsig->info);
/* Then remove it from the pending signal list */ /* Then remove it from the pending signal list */
sig_releasependingsignal(pendingsig); nxsig_release_pendingsignal(pendingsig);
} }
} }
} }
+20 -19
View File
@@ -1,7 +1,8 @@
/**************************************************************************** /****************************************************************************
* sched/signal/signal.h * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -161,41 +162,41 @@ struct task_group_s;
/* sig_initializee.c */ /* sig_initializee.c */
void weak_function sig_initialize(void); void weak_function nxsig_initialize(void);
void sig_allocateactionblock(void); void nxsig_alloc_actionblock(void);
/* sig_action.c */ /* sig_action.c */
void sig_releaseaction(FAR sigactq_t *sigact); void nxsig_release_action(FAR sigactq_t *sigact);
/* sig_pending.c */ /* sig_pending.c */
sigset_t sig_pendingset(FAR struct tcb_s *stcb); sigset_t nxsig_pendingset(FAR struct tcb_s *stcb);
/* sig_dispatch.c */ /* sig_dispatch.c */
int sig_tcbdispatch(FAR struct tcb_s *stcb, FAR siginfo_t *info); int nxsig_tcbdispatch(FAR struct tcb_s *stcb, FAR siginfo_t *info);
int sig_dispatch(pid_t pid, FAR siginfo_t *info); int nxsig_dispatch(pid_t pid, FAR siginfo_t *info);
/* sig_cleanup.c */ /* sig_cleanup.c */
void sig_cleanup(FAR struct tcb_s *stcb); void nxsig_cleanup(FAR struct tcb_s *stcb);
void sig_release(FAR struct task_group_s *group); void nxsig_release(FAR struct task_group_s *group);
/* In files of the same name */ /* In files of the same name */
FAR sigq_t *sig_allocatependingsigaction(void); FAR sigq_t *nxsig_alloc_pendingsigaction(void);
void sig_deliver(FAR struct tcb_s *stcb); void nxsig_deliver(FAR struct tcb_s *stcb);
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);
int sig_lowest(FAR sigset_t *set); int nxsig_lowest(FAR sigset_t *set);
#ifdef CONFIG_CAN_PASS_STRUCTS #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 #else
int sig_mqnotempty(int tid, int signo, FAR void *sival_ptr); int nxsig_mqnotempty(int tid, int signo, FAR void *sival_ptr);
#endif #endif
void sig_releasependingsigaction(FAR sigq_t *sigq); void nxsig_release_pendingsigaction(FAR sigq_t *sigq);
void sig_releasependingsignal(FAR sigpendq_t *sigpend); void nxsig_release_pendingsignal(FAR sigpendq_t *sigpend);
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);
void sig_unmaskpendingsignal(void); void nxsig_unmask_pendingsignal(void);
#endif /* __SCHED_SIGNAL_SIGNAL_H */ #endif /* __SCHED_SIGNAL_SIGNAL_H */
+2 -2
View File
@@ -405,7 +405,7 @@ static inline void task_sigchild(FAR struct tcb_s *ptcb,
* can provide the correct si_code value with the signal. * 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 #ifndef CONFIG_DISABLE_SIGNALS
/* Deallocate anything left in the TCB's queues */ /* Deallocate anything left in the TCB's queues */
sig_cleanup(tcb); /* Deallocate Signal lists */ nxsig_cleanup(tcb); /* Deallocate Signal lists */
#endif #endif
/* This function can be re-entered in certain cases. Set a flag /* This function can be re-entered in certain cases. Set a flag
+1 -1
View File
@@ -158,7 +158,7 @@ int task_restart(pid_t pid)
/* Deallocate anything left in the TCB's queues */ /* 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 */ /* Reset the current task priority */
+2 -2
View File
@@ -109,7 +109,7 @@ static inline void timer_signotify(FAR struct posix_timer_s *timer)
/* Send the signal */ /* Send the signal */
DEBUGVERIFY(sig_dispatch(timer->pt_owner, &info)); DEBUGVERIFY(nxsig_dispatch(timer->pt_owner, &info));
} }
#ifdef CONFIG_SIG_EVTHREAD #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) 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 #endif
} }