diff --git a/sched/Makefile b/sched/Makefile index 339f117aba..0e07c5ba1b 100644 --- a/sched/Makefile +++ b/sched/Makefile @@ -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)) diff --git a/sched/group/Make.defs b/sched/group/Make.defs new file mode 100644 index 0000000000..b389055cf8 --- /dev/null +++ b/sched/group/Make.defs @@ -0,0 +1,54 @@ +############################################################################ +# sched/group/Make.defs +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 diff --git a/sched/group_internal.h b/sched/group/group.h similarity index 97% rename from sched/group_internal.h rename to sched/group/group.h index 41a9c10179..96ebe231d0 100644 --- a/sched/group_internal.h +++ b/sched/group/group.h @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/group_internal.h + * sched/group/group.h * * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -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 */ diff --git a/sched/group_childstatus.c b/sched/group/group_childstatus.c similarity index 99% rename from sched/group_childstatus.c rename to sched/group/group_childstatus.c index 5a5ffe4ab7..bac8dac9fe 100644 --- a/sched/group_childstatus.c +++ b/sched/group/group_childstatus.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_childstatus.c + * sched/group/group_childstatus.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) diff --git a/sched/group_create.c b/sched/group/group_create.c similarity index 99% rename from sched/group_create.c rename to sched/group/group_create.c index ef3b02f19e..36850f73dd 100644 --- a/sched/group_create.c +++ b/sched/group/group_create.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_create.c + * sched/group/group_create.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #include "environ/environ.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/group_find.c b/sched/group/group_find.c similarity index 99% rename from sched/group_find.c rename to sched/group/group_find.c index 635aa9829f..0e9287e8a8 100644 --- a/sched/group_find.c +++ b/sched/group/group_find.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_find.c + * sched/group/group_find.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #include "environ/environ.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/group_foreachchild.c b/sched/group/group_foreachchild.c similarity index 98% rename from sched/group_foreachchild.c rename to sched/group/group_foreachchild.c index bf7548e87b..deaeea2cde 100644 --- a/sched/group_foreachchild.c +++ b/sched/group/group_foreachchild.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/group_foreachchild.c + * sched/group/group_foreachchild.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,7 +41,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #ifdef HAVE_GROUP_MEMBERS diff --git a/sched/group_join.c b/sched/group/group_join.c similarity index 99% rename from sched/group_join.c rename to sched/group/group_join.c index 7f8871fe1d..e188a9ee38 100644 --- a/sched/group_join.c +++ b/sched/group/group_join.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_join.c + * sched/group/group_join.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #include "environ/environ.h" #if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD) diff --git a/sched/group_killchildren.c b/sched/group/group_killchildren.c similarity index 98% rename from sched/group_killchildren.c rename to sched/group/group_killchildren.c index a96ecd1134..a320d50bc5 100644 --- a/sched/group_killchildren.c +++ b/sched/group/group_killchildren.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/group_killchildren.c + * sched/group/group_killchildren.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,7 +41,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #if HAVE_GROUP_MEMBERS diff --git a/sched/group_leave.c b/sched/group/group_leave.c similarity index 99% rename from sched/group_leave.c rename to sched/group/group_leave.c index 93ef5363d9..ec25792e74 100644 --- a/sched/group_leave.c +++ b/sched/group/group_leave.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_leave.c + * sched/group/group_leave.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -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 diff --git a/sched/group_setupidlefiles.c b/sched/group/group_setupidlefiles.c similarity index 98% rename from sched/group_setupidlefiles.c rename to sched/group/group_setupidlefiles.c index 67001c1fba..f9261d0600 100644 --- a/sched/group_setupidlefiles.c +++ b/sched/group/group_setupidlefiles.c @@ -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 @@ -50,7 +50,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 diff --git a/sched/group_setupstreams.c b/sched/group/group_setupstreams.c similarity index 99% rename from sched/group_setupstreams.c rename to sched/group/group_setupstreams.c index 0f0bfd083f..73eea6b1db 100644 --- a/sched/group_setupstreams.c +++ b/sched/group/group_setupstreams.c @@ -46,7 +46,7 @@ #include #include -#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. diff --git a/sched/group_setuptaskfiles.c b/sched/group/group_setuptaskfiles.c similarity index 99% rename from sched/group_setuptaskfiles.c rename to sched/group/group_setuptaskfiles.c index 6809f97847..91b4bf218b 100644 --- a/sched/group_setuptaskfiles.c +++ b/sched/group/group_setuptaskfiles.c @@ -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 @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 diff --git a/sched/group_signal.c b/sched/group/group_signal.c similarity index 99% rename from sched/group_signal.c rename to sched/group/group_signal.c index c158bc89ea..b1fafdc57d 100644 --- a/sched/group_signal.c +++ b/sched/group/group_signal.c @@ -1,5 +1,5 @@ /***************************************************************************** - * sched/group_signal.c + * sched/group/group_signal.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include #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) diff --git a/sched/os_start.c b/sched/os_start.c index 56f38d667c..618ddeb081 100644 --- a/sched/os_start.c +++ b/sched/os_start.c @@ -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 /**************************************************************************** diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c index cfe65176ff..cb9f970de2 100644 --- a/sched/pthread/pthread_completejoin.c +++ b/sched/pthread/pthread_completejoin.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "pthread/pthread.h" /************************************************************************ diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 1484ef6341..c82ed08faf 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -53,7 +53,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "clock_internal.h" #include "pthread/pthread.h" diff --git a/sched/pthread/pthread_detach.c b/sched/pthread/pthread_detach.c index 5b7f4a6111..2f5a3be86f 100644 --- a/sched/pthread/pthread_detach.c +++ b/sched/pthread/pthread_detach.c @@ -47,7 +47,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "pthread/pthread.h" /************************************************************************ diff --git a/sched/pthread/pthread_findjoininfo.c b/sched/pthread/pthread_findjoininfo.c index 0f49becfee..f867bd03a2 100644 --- a/sched/pthread/pthread_findjoininfo.c +++ b/sched/pthread/pthread_findjoininfo.c @@ -41,7 +41,7 @@ #include -#include "group_internal.h" +#include "group/group.h" #include "pthread/pthread.h" /************************************************************************ diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 3aeb133f39..a9b9d9e885 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "pthread/pthread.h" /**************************************************************************** diff --git a/sched/sched_releasetcb.c b/sched/sched_releasetcb.c index 96f9acff7a..5226d92fd1 100644 --- a/sched/sched_releasetcb.c +++ b/sched/sched_releasetcb.c @@ -45,7 +45,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "timer_internal.h" /************************************************************************ diff --git a/sched/sched_waitid.c b/sched/sched_waitid.c index 385dfa55a5..7329ef946d 100644 --- a/sched/sched_waitid.c +++ b/sched/sched_waitid.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #if defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT) diff --git a/sched/sched_waitpid.c b/sched/sched_waitpid.c index fbed490c17..48f932878b 100644 --- a/sched/sched_waitpid.c +++ b/sched/sched_waitpid.c @@ -47,7 +47,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #ifdef CONFIG_SCHED_WAITPID diff --git a/sched/signal/sig_action.c b/sched/signal/sig_action.c index 6f07226cf8..055f5ec96b 100644 --- a/sched/signal/sig_action.c +++ b/sched/signal/sig_action.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "signal/signal.h" /**************************************************************************** diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 3697e8ee52..e269228634 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -49,7 +49,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "semaphore/semaphore.h" #include "signal/signal.h" #include "mqueue/mqueue.h" diff --git a/sched/task_create.c b/sched/task_create.c index a64b4e21bc..55fdf22a6b 100644 --- a/sched/task_create.c +++ b/sched/task_create.c @@ -49,7 +49,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" /**************************************************************************** * Definitions diff --git a/sched/task_exithook.c b/sched/task_exithook.c index 5074a99862..90056c2646 100644 --- a/sched/task_exithook.c +++ b/sched/task_exithook.c @@ -49,7 +49,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "signal/signal.h" /**************************************************************************** diff --git a/sched/task_getgroup.c b/sched/task_getgroup.c index d38977d406..9c7b4b954e 100644 --- a/sched/task_getgroup.c +++ b/sched/task_getgroup.c @@ -42,7 +42,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/task_init.c b/sched/task_init.c index 79189f6cc6..112ac6801e 100644 --- a/sched/task_init.c +++ b/sched/task_init.c @@ -47,7 +47,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" /**************************************************************************** * Definitions diff --git a/sched/task_posixspawn.c b/sched/task_posixspawn.c index bc6f8dccc9..122a83a28e 100644 --- a/sched/task_posixspawn.c +++ b/sched/task_posixspawn.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "spawn_internal.h" /**************************************************************************** diff --git a/sched/task_reparent.c b/sched/task_reparent.c index 8bd1f9767d..7f8c8de413 100644 --- a/sched/task_reparent.c +++ b/sched/task_reparent.c @@ -42,7 +42,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #ifdef CONFIG_SCHED_HAVE_PARENT diff --git a/sched/task_restart.c b/sched/task_restart.c index 45346c6f17..1e552030a5 100644 --- a/sched/task_restart.c +++ b/sched/task_restart.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "signal/signal.h" /**************************************************************************** diff --git a/sched/task_setup.c b/sched/task_setup.c index 28d5ecdd81..ddf1537bff 100644 --- a/sched/task_setup.c +++ b/sched/task_setup.c @@ -50,7 +50,7 @@ #include "os_internal.h" #include "pthread/pthread.h" -#include "group_internal.h" +#include "group/group.h" /**************************************************************************** * Definitions diff --git a/sched/task_spawn.c b/sched/task_spawn.c index e14bb271d1..541c62b11d 100644 --- a/sched/task_spawn.c +++ b/sched/task_spawn.c @@ -45,7 +45,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" #include "spawn_internal.h" /**************************************************************************** diff --git a/sched/task_vfork.c b/sched/task_vfork.c index 09d71cd26d..706ef864dd 100644 --- a/sched/task_vfork.c +++ b/sched/task_vfork.c @@ -49,7 +49,7 @@ #include #include "os_internal.h" -#include "group_internal.h" +#include "group/group.h" /**************************************************************************** * Pre-processor Definitions