signal/nxsig_pengingset: move nxsig_pendingset to common header

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2022-10-19 10:32:14 +08:00 committed by Xiang Xiao
parent d36b7fea45
commit 3927d878e4
3 changed files with 29 additions and 11 deletions

View File

@ -32,6 +32,7 @@
#include <signal.h>
#include <nuttx/wqueue.h>
#include <nuttx/sched.h>
/****************************************************************************
* Pre-processor Definitions
@ -190,6 +191,24 @@ int nxsig_addset(FAR sigset_t *set, int signo);
int nxsig_delset(FAR sigset_t *set, int signo);
/****************************************************************************
* Name: nxsig_pendingset
*
* Description:
* Convert the list of pending signals into a signal set
*
* Input Parameters:
* stcb - The specific tcb of return pending set.
*
* Returned Value:
* Return the pending signal set.
*
* Assumptions:
*
****************************************************************************/
sigset_t nxsig_pendingset(FAR struct tcb_s *stcb);
/****************************************************************************
* Name: nxsig_procmask
*

View File

@ -58,16 +58,13 @@
int sigpending(FAR sigset_t *set)
{
FAR struct tcb_s *rtcb = this_task();
int ret = ERROR;
if (set)
{
*set = nxsig_pendingset(rtcb);
ret = OK;
*set = nxsig_pendingset(NULL);
return OK;
}
return ret;
return ERROR;
}
/****************************************************************************
@ -80,11 +77,17 @@ int sigpending(FAR sigset_t *set)
sigset_t nxsig_pendingset(FAR struct tcb_s *stcb)
{
FAR struct task_group_s *group = stcb->group;
FAR struct task_group_s *group;
sigset_t sigpendset;
FAR sigpendq_t *sigpend;
irqstate_t flags;
if (stcb == NULL)
{
stcb = this_task();
}
group = stcb->group;
DEBUGASSERT(group);
sigpendset = NULL_SIGNAL_SET;

View File

@ -163,10 +163,6 @@ _sa_handler_t nxsig_default(FAR struct tcb_s *tcb, int signo,
int nxsig_default_initialize(FAR struct tcb_s *tcb);
#endif
/* sig_pending.c */
sigset_t nxsig_pendingset(FAR struct tcb_s *stcb);
/* sig_dispatch.c */
int nxsig_tcbdispatch(FAR struct tcb_s *stcb,