mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
sched/signal: Wrap long lines to make nxstyle happy
This commit is contained in:
committed by
Abdelatif Guettouche
parent
842b0c54d4
commit
a0bfc24b4c
@@ -145,7 +145,8 @@ static FAR sigactq_t *nxsig_alloc_action(void)
|
|||||||
* on failure
|
* on failure
|
||||||
* sigaction:
|
* sigaction:
|
||||||
* Zero (OK) is returned on success; -1 (ERROR) is returned on any
|
* Zero (OK) is returned on success; -1 (ERROR) is returned on any
|
||||||
* failure if the signal number is invalid with the errno set appropriately
|
* failure if the signal number is invalid with the errno set
|
||||||
|
* appropriately
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
*
|
*
|
||||||
@@ -153,8 +154,9 @@ static FAR sigactq_t *nxsig_alloc_action(void)
|
|||||||
* - If CONFIG_SIG_DEFAULT is not defined, then there are no default actions
|
* - If CONFIG_SIG_DEFAULT is not defined, then there are no default actions
|
||||||
* so the special value SIG_DFL is treated like SIG_IGN.
|
* so the special value SIG_DFL is treated like SIG_IGN.
|
||||||
* - All sa_flags in struct sigaction of act input are ignored (all
|
* - All sa_flags in struct sigaction of act input are ignored (all
|
||||||
* treated like SA_SIGINFO). The one exception is if CONFIG_SCHED_CHILD_STATUS
|
* treated like SA_SIGINFO). The one exception is if
|
||||||
* is defined; then SA_NOCLDWAIT is supported but only for SIGCHLD
|
* CONFIG_SCHED_CHILD_STATUS is defined; then SA_NOCLDWAIT is supported but
|
||||||
|
* only for SIGCHLD
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -98,14 +98,16 @@ void nxsig_release(FAR struct task_group_s *group)
|
|||||||
|
|
||||||
/* Deallocate all entries in the list of signal actions */
|
/* Deallocate all entries in the list of signal actions */
|
||||||
|
|
||||||
while ((sigact = (FAR sigactq_t *)sq_remfirst(&group->tg_sigactionq)) != NULL)
|
while ((sigact = (FAR sigactq_t *)sq_remfirst(&group->tg_sigactionq))
|
||||||
|
!= NULL)
|
||||||
{
|
{
|
||||||
nxsig_release_action(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)
|
||||||
{
|
{
|
||||||
nxsig_release_pendingsignal(sigpend);
|
nxsig_release_pendingsignal(sigpend);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ static void nxsig_stop_task(int signo);
|
|||||||
|
|
||||||
static _sa_handler_t nxsig_default_action(int signo);
|
static _sa_handler_t nxsig_default_action(int signo);
|
||||||
static void nxsig_setup_default_action(FAR struct task_group_s *group,
|
static void nxsig_setup_default_action(FAR struct task_group_s *group,
|
||||||
FAR const struct nxsig_defaction_s *info);
|
FAR const struct nxsig_defaction_s *
|
||||||
|
info);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@@ -240,8 +241,8 @@ static void nxsig_abnormal_termination(int signo)
|
|||||||
|
|
||||||
if ((rtcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0)
|
if ((rtcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0)
|
||||||
{
|
{
|
||||||
/* Then we cannot cancel the task asynchronously. Mark the cancellation
|
/* Then we cannot cancel the task asynchronously.
|
||||||
* as pending.
|
* Mark the cancellation as pending.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb->flags |= TCB_FLAG_CANCEL_PENDING;
|
rtcb->flags |= TCB_FLAG_CANCEL_PENDING;
|
||||||
@@ -437,7 +438,8 @@ static _sa_handler_t nxsig_default_action(int signo)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void nxsig_setup_default_action(FAR struct task_group_s *group,
|
static void nxsig_setup_default_action(FAR struct task_group_s *group,
|
||||||
FAR const struct nxsig_defaction_s *info)
|
FAR const struct nxsig_defaction_s *
|
||||||
|
info)
|
||||||
{
|
{
|
||||||
/* Get the address of the handler for this signals default action. */
|
/* Get the address of the handler for this signals default action. */
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ static sigpendq_t *g_sigpendingirqsignalalloc;
|
|||||||
static sigq_t *nxsig_alloc_block(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 *nxsig_alloc_pendingsignalblock(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);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
@@ -172,7 +173,8 @@ static FAR sigq_t *nxsig_alloc_block(sq_queue_t *siglist, uint16_t nsigs,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static sigpendq_t *nxsig_alloc_pendingsignalblock(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;
|
||||||
FAR sigpendq_t *sigpend;
|
FAR sigpendq_t *sigpend;
|
||||||
|
|||||||
@@ -213,10 +213,11 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp,
|
|||||||
* suspended from execution until either the time value of the clock
|
* suspended from execution until either the time value of the clock
|
||||||
* specified by clock_id reaches the absolute time specified by the rqtp
|
* specified by clock_id reaches the absolute time specified by the rqtp
|
||||||
* argument, or a signal is delivered to the calling thread and its action
|
* argument, or a signal is delivered to the calling thread and its action
|
||||||
* is to invoke a signal-catching function, or the process is terminated. If,
|
* is to invoke a signal-catching function, or the process is terminated.
|
||||||
* at the time of the call, the time value specified by rqtp is less than
|
* If, at the time of the call, the time value specified by rqtp is less
|
||||||
* or equal to the time value of the specified clock, then clock_nanosleep()
|
* than or equal to the time value of the specified clock, then
|
||||||
* will return immediately and the calling process will not be suspended.
|
* clock_nanosleep() will return immediately and the calling process will
|
||||||
|
* not be suspended.
|
||||||
*
|
*
|
||||||
* The suspension time caused by this function may be longer than requested
|
* The suspension time caused by this function may be longer than requested
|
||||||
* because the argument value is rounded up to an integer multiple of the
|
* because the argument value is rounded up to an integer multiple of the
|
||||||
@@ -250,12 +251,12 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp,
|
|||||||
* If the clock_nanosleep() function returns because the requested time has
|
* If the clock_nanosleep() function returns because the requested time has
|
||||||
* elapsed, its return value is zero.
|
* elapsed, its return value is zero.
|
||||||
*
|
*
|
||||||
* If the clock_nanosleep() function returns because it has been interrupted by
|
* If the clock_nanosleep() function returns because it has been
|
||||||
* a signal, the function returns a value of -1 and sets errno to indicate
|
* interrupted by a signal, the function returns a value of -1 and sets
|
||||||
* the interruption. If the rmtp argument is non-NULL, the timespec
|
* errno to indicate the interruption. If the rmtp argument is non-NULL,
|
||||||
* structure referenced by it is updated to contain the amount of time
|
* the timespec structure referenced by it is updated to contain the amount
|
||||||
* remaining in the interval (the requested time minus the time actually
|
* of time remaining in the interval (the requested time minus the time
|
||||||
* slept). If the rmtp argument is NULL, the remaining time is not
|
* actually slept). If the rmtp argument is NULL, the remaining time is not
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* If clock_nanosleep() fails, it returns a value of -1 and sets errno to
|
* If clock_nanosleep() fails, it returns a value of -1 and sets errno to
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* sched/signal/sig_releasependingsignal.c
|
* sched/signal/sig_releasependingsignal.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009, 2014, 2016-2017 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
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ FAR sigpendq_t *nxsig_remove_pendingsignal(FAR struct tcb_s *stcb, int signo)
|
|||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
for (prevsig = NULL, currsig = (FAR sigpendq_t *)group->tg_sigpendingq.head;
|
for (prevsig = NULL,
|
||||||
|
currsig = (FAR sigpendq_t *)group->tg_sigpendingq.head;
|
||||||
(currsig && currsig->info.si_signo != signo);
|
(currsig && currsig->info.si_signo != signo);
|
||||||
prevsig = currsig, currsig = currsig->flink);
|
prevsig = currsig, currsig = currsig->flink);
|
||||||
|
|
||||||
|
|||||||
@@ -269,7 +269,8 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
|||||||
* pending.
|
* pending.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sigpend = nxsig_remove_pendingsignal(rtcb, nxsig_lowest(&intersection));
|
sigpend = nxsig_remove_pendingsignal(rtcb,
|
||||||
|
nxsig_lowest(&intersection));
|
||||||
DEBUGASSERT(sigpend);
|
DEBUGASSERT(sigpend);
|
||||||
|
|
||||||
/* Return the signal info to the caller if so requested */
|
/* Return the signal info to the caller if so requested */
|
||||||
@@ -325,7 +326,8 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
|||||||
|
|
||||||
#ifdef CONFIG_HAVE_LONG_LONG
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
uint64_t waitticks64 = ((uint64_t)timeout->tv_sec * NSEC_PER_SEC +
|
uint64_t waitticks64 = ((uint64_t)timeout->tv_sec * NSEC_PER_SEC +
|
||||||
(uint64_t)timeout->tv_nsec + NSEC_PER_TICK - 1) /
|
(uint64_t)timeout->tv_nsec +
|
||||||
|
NSEC_PER_TICK - 1) /
|
||||||
NSEC_PER_TICK;
|
NSEC_PER_TICK;
|
||||||
DEBUGASSERT(waitticks64 <= UINT32_MAX);
|
DEBUGASSERT(waitticks64 <= UINT32_MAX);
|
||||||
waitticks = (uint32_t)waitticks64;
|
waitticks = (uint32_t)waitticks64;
|
||||||
@@ -400,8 +402,8 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
|||||||
|
|
||||||
if (GOOD_SIGNO(rtcb->sigunbinfo.si_signo))
|
if (GOOD_SIGNO(rtcb->sigunbinfo.si_signo))
|
||||||
{
|
{
|
||||||
/* We were awakened by a signal... but is it one of the signals that
|
/* We were awakened by a signal... but is it one of the signals
|
||||||
* we were waiting for?
|
* that we were waiting for?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sigismember(set, rtcb->sigunbinfo.si_signo))
|
if (sigismember(set, rtcb->sigunbinfo.si_signo))
|
||||||
|
|||||||
Reference in New Issue
Block a user