Move group logic from sched/ to sched/group

This commit is contained in:
Gregory Nutt 2014-08-08 14:06:42 -06:00
parent d00e9b6016
commit 4ff17b3904
35 changed files with 103 additions and 63 deletions

View File

@ -100,21 +100,6 @@ ifeq ($(CONFIG_SCHED_CPULOAD),y)
SCHED_SRCS += sched_cpuload.c
endif
GRP_SRCS = group_create.c group_join.c group_leave.c group_find.c
GRP_SRCS += group_setupstreams.c group_setupidlefiles.c group_setuptaskfiles.c
GRP_SRCS += task_getgroup.c group_foreachchild.c group_killchildren.c
ifeq ($(CONFIG_SCHED_HAVE_PARENT),y)
GRP_SRCS += task_reparent.c
ifeq ($(CONFIG_SCHED_CHILD_STATUS),y)
GRP_SRCS += group_childstatus.c
endif
endif
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
GRP_SRCS += group_signal.c
endif
WDOG_SRCS = wd_initialize.c wd_create.c wd_start.c wd_cancel.c wd_delete.c
WDOG_SRCS += wd_gettime.c
@ -143,16 +128,17 @@ endif
IRQ_SRCS = irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c
include group/Make.defs
include semaphore/Make.defs
include signal/Make.defs
include pthread/Make.defs
include mqueue/Make.defs
include environ/Make.defs
CSRCS = $(MISC_SRCS) $(TSK_SRCS) $(GRP_SRCS) $(SCHED_SRCS) $(WDOG_SRCS)
CSRCS = $(MISC_SRCS) $(TSK_SRCS) $(SCHED_SRCS) $(WDOG_SRCS)
CSRCS += $(TIME_SRCS) $(TIMER_SRCS) $(PGFILL_SRCS)
CSRCS += $(IRQ_SRCS) $(CLOCK_SRCS)
CSRCS += $(SEM_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(ENV_SRCS)
CSRCS += $(GRP_SRCS) $(SEM_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(ENV_SRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))

54
sched/group/Make.defs Normal file
View File

@ -0,0 +1,54 @@
############################################################################
# sched/group/Make.defs
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
GRP_SRCS = group_create.c group_join.c group_leave.c group_find.c
GRP_SRCS += group_setupstreams.c group_setupidlefiles.c group_setuptaskfiles.c
GRP_SRCS += task_getgroup.c group_foreachchild.c group_killchildren.c
ifeq ($(CONFIG_SCHED_HAVE_PARENT),y)
GRP_SRCS += task_reparent.c
ifeq ($(CONFIG_SCHED_CHILD_STATUS),y)
GRP_SRCS += group_childstatus.c
endif
endif
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
GRP_SRCS += group_signal.c
endif
# Include group build support
DEPPATH += --dep-path group
VPATH += :group

View File

@ -1,5 +1,5 @@
/****************************************************************************
* sched/group_internal.h
* sched/group/group.h
*
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __SCHED_GROUP_INERNAL_H
#define __SCHED_GROUP_INERNAL_H
#ifndef __SCHED_GROUP_GROUP_H
#define __SCHED_GROUP_GROUP_H
/****************************************************************************
* Included Files
@ -135,4 +135,4 @@ int group_setupstreams(FAR struct task_tcb_s *tcb);
#endif
#endif
#endif /* __SCHED_GROUP_INERNAL_H */
#endif /* __SCHED_GROUP_GROUP_H */

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_childstatus.c
* sched/group/group_childstatus.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -44,7 +44,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_create.c
* sched/group/group_create.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
#include "group/group.h"
#include "environ/environ.h"
#ifdef HAVE_TASK_GROUP

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_find.c
* sched/group/group_find.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
#include "group/group.h"
#include "environ/environ.h"
#ifdef HAVE_TASK_GROUP

View File

@ -1,5 +1,5 @@
/****************************************************************************
* sched/group_foreachchild.c
* sched/group/group_foreachchild.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -41,7 +41,7 @@
#include <nuttx/sched.h>
#include "group_internal.h"
#include "group/group.h"
#ifdef HAVE_GROUP_MEMBERS

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_join.c
* sched/group/group_join.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
#include "group/group.h"
#include "environ/environ.h"
#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* sched/group_killchildren.c
* sched/group/group_killchildren.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -41,7 +41,7 @@
#include <sched.h>
#include "group_internal.h"
#include "group/group.h"
#if HAVE_GROUP_MEMBERS

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_leave.c
* sched/group/group_leave.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -52,7 +52,7 @@
#include "signal/signal.h"
#include "pthread/pthread.h"
#include "mqueue/mqueue.h"
#include "group_internal.h"
#include "group/group.h"
#ifdef HAVE_TASK_GROUP

View File

@ -1,5 +1,5 @@
/****************************************************************************
* sched/group_setupidlefiles.c
* sched/group/group_setupidlefiles.c
*
* Copyright (C) 2007-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -50,7 +50,7 @@
#include <nuttx/net/net.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0

View File

@ -46,7 +46,7 @@
#include <nuttx/net/net.h>
#include <nuttx/lib.h>
#include "group_internal.h"
#include "group/group.h"
/* Make sure that there are file or socket descriptors in the system and
* that some number of streams have been configured.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* sched/group_setuptaskfiles.c
* sched/group/group_setuptaskfiles.c
*
* Copyright (C) 2007-2008, 2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -46,7 +46,7 @@
#include <nuttx/net/net.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* sched/group_signal.c
* sched/group/group_signal.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -46,7 +46,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "signal/signal.h"
#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_SIGNALS)

View File

@ -65,7 +65,7 @@
#include "timer_internal.h"
#include "irq_internal.h"
#ifdef HAVE_TASK_GROUP
#include "group_internal.h"
#include "group/group.h"
#endif
/****************************************************************************

View File

@ -46,7 +46,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "pthread/pthread.h"
/************************************************************************

View File

@ -53,7 +53,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "clock_internal.h"
#include "pthread/pthread.h"

View File

@ -47,7 +47,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "pthread/pthread.h"
/************************************************************************

View File

@ -41,7 +41,7 @@
#include <sys/types.h>
#include "group_internal.h"
#include "group/group.h"
#include "pthread/pthread.h"
/************************************************************************

View File

@ -44,7 +44,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "pthread/pthread.h"
/****************************************************************************

View File

@ -45,7 +45,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "timer_internal.h"
/************************************************************************

View File

@ -46,7 +46,7 @@
#include <nuttx/sched.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#if defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)

View File

@ -47,7 +47,7 @@
#include <nuttx/sched.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#ifdef CONFIG_SCHED_WAITPID

View File

@ -46,7 +46,7 @@
#include <errno.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "signal/signal.h"
/****************************************************************************

View File

@ -49,7 +49,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "semaphore/semaphore.h"
#include "signal/signal.h"
#include "mqueue/mqueue.h"

View File

@ -49,7 +49,7 @@
#include <nuttx/kthread.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
/****************************************************************************
* Definitions

View File

@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "signal/signal.h"
/****************************************************************************

View File

@ -42,7 +42,7 @@
#include <sched.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#ifdef HAVE_TASK_GROUP

View File

@ -47,7 +47,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
/****************************************************************************
* Definitions

View File

@ -46,7 +46,7 @@
#include <nuttx/binfmt/binfmt.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "spawn_internal.h"
/****************************************************************************

View File

@ -42,7 +42,7 @@
#include <errno.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#ifdef CONFIG_SCHED_HAVE_PARENT

View File

@ -46,7 +46,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "signal/signal.h"
/****************************************************************************

View File

@ -50,7 +50,7 @@
#include "os_internal.h"
#include "pthread/pthread.h"
#include "group_internal.h"
#include "group/group.h"
/****************************************************************************
* Definitions

View File

@ -45,7 +45,7 @@
#include <debug.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
#include "spawn_internal.h"
/****************************************************************************

View File

@ -49,7 +49,7 @@
#include <nuttx/sched.h>
#include "os_internal.h"
#include "group_internal.h"
#include "group/group.h"
/****************************************************************************
* Pre-processor Definitions