diff --git a/sched/Makefile b/sched/Makefile index 3e5b5fbee85..339f117aba4 100644 --- a/sched/Makefile +++ b/sched/Makefile @@ -115,10 +115,6 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y) GRP_SRCS += group_signal.c endif -ENV_SRCS = env_getenvironptr.c env_dup.c env_release.c -ENV_SRCS += env_findvar.c env_removevar.c -ENV_SRCS += env_clearenv.c env_getenv.c env_putenv.c env_setenv.c env_unsetenv.c - WDOG_SRCS = wd_initialize.c wd_create.c wd_start.c wd_cancel.c wd_delete.c WDOG_SRCS += wd_gettime.c @@ -136,17 +132,6 @@ CLOCK_SRCS = clock_initialize.c clock_settime.c clock_gettime.c clock_getres.c CLOCK_SRCS += clock_time2ticks.c clock_abstime2ticks.c clock_ticks2time.c CLOCK_SRCS += clock_gettimeofday.c clock_systimer.c -SEM_SRCS = sem_initialize.c sem_destroy.c sem_open.c sem_close.c sem_unlink.c -SEM_SRCS += sem_wait.c sem_trywait.c sem_timedwait.c sem_post.c sem_findnamed.c - -ifneq ($(CONFIG_DISABLE_SIGNALS),y) -SEM_SRCS += sem_waitirq.c -endif - -ifeq ($(CONFIG_PRIORITY_INHERITANCE),y) -SEM_SRCS += sem_holder.c -endif - ifneq ($(CONFIG_DISABLE_POSIX_TIMERS),y) TIMER_SRCS += timer_initialize.c timer_create.c timer_delete.c timer_getoverrun.c TIMER_SRCS += timer_gettime.c timer_settime.c timer_release.c @@ -158,17 +143,16 @@ endif IRQ_SRCS = irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c +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 += $(TIME_SRCS) $(SEM_SRCS) $(TIMER_SRCS) $(PGFILL_SRCS) -CSRCS += $(IRQ_SRCS) $(CLOCK_SRCS) $(MQUEUE_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) - -ifneq ($(CONFIG_DISABLE_ENVIRON),y) -CSRCS += $(ENV_SRCS) -endif +CSRCS += $(TIME_SRCS) $(TIMER_SRCS) $(PGFILL_SRCS) +CSRCS += $(IRQ_SRCS) $(CLOCK_SRCS) +CSRCS += $(SEM_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(ENV_SRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/sched/environ/Make.defs b/sched/environ/Make.defs new file mode 100644 index 00000000000..362fd685d84 --- /dev/null +++ b/sched/environ/Make.defs @@ -0,0 +1,47 @@ +############################################################################ +# sched/environ/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. +# +############################################################################ + +ifneq ($(CONFIG_DISABLE_ENVIRON),y) + +ENV_SRCS = env_getenvironptr.c env_dup.c env_release.c env_findvar.c +ENV_SRCS += env_removevar.c env_clearenv.c env_getenv.c env_putenv.c +ENV_SRCS += env_setenv.c env_unsetenv.c + +# Include environ build support + +DEPPATH += --dep-path environ +VPATH += :environ + +endif diff --git a/sched/env_clearenv.c b/sched/environ/env_clearenv.c similarity index 98% rename from sched/env_clearenv.c rename to sched/environ/env_clearenv.c index 4724e2816f0..832d6d8adbc 100644 --- a/sched/env_clearenv.c +++ b/sched/environ/env_clearenv.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_clearenv.c + * sched/environ/env_clearenv.c * * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_dup.c b/sched/environ/env_dup.c similarity index 98% rename from sched/env_dup.c rename to sched/environ/env_dup.c index 1b061be8fa4..fc529eafe46 100644 --- a/sched/env_dup.c +++ b/sched/environ/env_dup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_dup.c + * sched/environ/env_dup.c * * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -49,7 +49,7 @@ #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_findvar.c b/sched/environ/env_findvar.c similarity index 98% rename from sched/env_findvar.c rename to sched/environ/env_findvar.c index 0594ebd498c..2112c14118c 100644 --- a/sched/env_findvar.c +++ b/sched/environ/env_findvar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_findvar.c + * sched/environ/env_findvar.c * * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -45,7 +45,7 @@ #include #include -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_getenv.c b/sched/environ/env_getenv.c similarity index 99% rename from sched/env_getenv.c rename to sched/environ/env_getenv.c index 6c4a22038de..6a030e3f6d2 100644 --- a/sched/env_getenv.c +++ b/sched/environ/env_getenv.c @@ -47,7 +47,7 @@ #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_getenvironptr.c b/sched/environ/env_getenvironptr.c similarity index 100% rename from sched/env_getenvironptr.c rename to sched/environ/env_getenvironptr.c diff --git a/sched/env_putenv.c b/sched/environ/env_putenv.c similarity index 99% rename from sched/env_putenv.c rename to sched/environ/env_putenv.c index ad00dd13df3..74120f7af8b 100644 --- a/sched/env_putenv.c +++ b/sched/environ/env_putenv.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_putenv.c + * sched/environ/env_putenv.c * * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/sched/env_release.c b/sched/environ/env_release.c similarity index 98% rename from sched/env_release.c rename to sched/environ/env_release.c index c6ff7ed7540..32287f9f1cc 100644 --- a/sched/env_release.c +++ b/sched/environ/env_release.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_release.c + * sched/environ/env_release.c * * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_removevar.c b/sched/environ/env_removevar.c similarity index 98% rename from sched/env_removevar.c rename to sched/environ/env_removevar.c index 076d7cb8257..4132eb26041 100644 --- a/sched/env_removevar.c +++ b/sched/environ/env_removevar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_removevar.c + * sched/environ/env_removevar.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_setenv.c b/sched/environ/env_setenv.c similarity index 99% rename from sched/env_setenv.c rename to sched/environ/env_setenv.c index 1b0b54c1cbe..bdf87a9c5f8 100644 --- a/sched/env_setenv.c +++ b/sched/environ/env_setenv.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_setenv.c + * sched/environ/env_setenv.c * * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,7 +50,7 @@ #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_unsetenv.c b/sched/environ/env_unsetenv.c similarity index 98% rename from sched/env_unsetenv.c rename to sched/environ/env_unsetenv.c index b61c7394328..70bd0488141 100644 --- a/sched/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/env_unsetenv.c + * sched/environ/env_unsetenv.c * * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,7 +48,7 @@ #include #include "os_internal.h" -#include "env_internal.h" +#include "environ/environ.h" /**************************************************************************** * Private Data diff --git a/sched/env_internal.h b/sched/environ/environ.h similarity index 94% rename from sched/env_internal.h rename to sched/environ/environ.h index e02bf289d94..5a994f8f46f 100644 --- a/sched/env_internal.h +++ b/sched/environ/environ.h @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/env_internal.h + * sched/environ/environ.h * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __SCHED_ENV_INTERNAL_H -#define __SCHED_ENV_INTERNAL_H +#ifndef __SCHED_ENVIRON_ENVIRON_H +#define __SCHED_ENVIRON_ENVIRON_H /**************************************************************************** * Included Files @@ -89,5 +89,5 @@ int env_removevar(FAR struct task_group_s *group, FAR char *pvar); #endif #endif /* !CONFIG_DISABLE_ENVIRON */ -#endif /* __SCHED_ENV_INTERNAL_H */ +#endif /* __SCHED_ENVIRON_ENVIRON_H */ diff --git a/sched/group_create.c b/sched/group_create.c index 875c36d1045..ef3b02f19e6 100644 --- a/sched/group_create.c +++ b/sched/group_create.c @@ -47,7 +47,7 @@ #include #include "group_internal.h" -#include "env_internal.h" +#include "environ/environ.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/group_find.c b/sched/group_find.c index 94836e2065b..635aa9829f9 100644 --- a/sched/group_find.c +++ b/sched/group_find.c @@ -47,7 +47,7 @@ #include #include "group_internal.h" -#include "env_internal.h" +#include "environ/environ.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/group_join.c b/sched/group_join.c index 58d08e8e3b0..7f8871fe1d8 100644 --- a/sched/group_join.c +++ b/sched/group_join.c @@ -47,7 +47,7 @@ #include #include "group_internal.h" -#include "env_internal.h" +#include "environ/environ.h" #if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD) diff --git a/sched/group_leave.c b/sched/group_leave.c index 5c5414f7f7d..93ef5363d9a 100644 --- a/sched/group_leave.c +++ b/sched/group_leave.c @@ -48,7 +48,7 @@ #include #include -#include "env_internal.h" +#include "environ/environ.h" #include "signal/signal.h" #include "pthread/pthread.h" #include "mqueue/mqueue.h" diff --git a/sched/os_start.c b/sched/os_start.c index e5feed42247..56f38d667c9 100644 --- a/sched/os_start.c +++ b/sched/os_start.c @@ -54,7 +54,7 @@ #include "os_internal.h" #include "signal/signal.h" #include "wd_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" #ifndef CONFIG_DISABLE_MQUEUE # include "mqueue/mqueue.h" #endif diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs new file mode 100644 index 00000000000..cc27134f1be --- /dev/null +++ b/sched/pthread/Make.defs @@ -0,0 +1,59 @@ +############################################################################ +# sched/pthread/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. +# +############################################################################ + +ifneq ($(CONFIG_DISABLE_PTHREAD),y) + +PTHREAD_SRCS = pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c +PTHREAD_SRCS += pthread_yield.c pthread_getschedparam.c pthread_setschedparam.c +PTHREAD_SRCS += pthread_mutexinit.c pthread_mutexdestroy.c +PTHREAD_SRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c +PTHREAD_SRCS += pthread_condinit.c pthread_conddestroy.c +PTHREAD_SRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c +PTHREAD_SRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c +PTHREAD_SRCS += pthread_cancel.c pthread_setcancelstate.c +PTHREAD_SRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c pthread_keydelete.c +PTHREAD_SRCS += pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c +PTHREAD_SRCS += pthread_once.c pthread_release.c pthread_setschedprio.c + +ifneq ($(CONFIG_DISABLE_SIGNALS),y) +PTHREAD_SRCS += pthread_condtimedwait.c pthread_kill.c pthread_sigmask.c +endif + +# Include pthread build support + +DEPPATH += --dep-path pthread +VPATH += :pthread + +endif diff --git a/sched/semaphore/Make.defs b/sched/semaphore/Make.defs new file mode 100644 index 00000000000..42f4f655d07 --- /dev/null +++ b/sched/semaphore/Make.defs @@ -0,0 +1,51 @@ +############################################################################ +# sched/semaphore/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. +# +############################################################################ + +SEM_SRCS = sem_initialize.c sem_destroy.c sem_open.c sem_close.c +SEM_SRCS += sem_unlink.c sem_wait.c sem_trywait.c sem_timedwait.c +SEM_SRCS += sem_post.c sem_findnamed.c + +ifneq ($(CONFIG_DISABLE_SIGNALS),y) +SEM_SRCS += sem_waitirq.c +endif + +ifeq ($(CONFIG_PRIORITY_INHERITANCE),y) +SEM_SRCS += sem_holder.c +endif + +# Include semaphore build support + +DEPPATH += --dep-path semaphore +VPATH += :semaphore diff --git a/sched/sem_close.c b/sched/semaphore/sem_close.c similarity index 98% rename from sched/sem_close.c rename to sched/semaphore/sem_close.c index 22f1e0f1d9e..71689a46825 100644 --- a/sched/sem_close.c +++ b/sched/semaphore/sem_close.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_close.c + * sched/semaphore/sem_close.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Definitions diff --git a/sched/sem_destroy.c b/sched/semaphore/sem_destroy.c similarity index 99% rename from sched/sem_destroy.c rename to sched/semaphore/sem_destroy.c index 90a2b95ef7b..19b2d4b8e43 100644 --- a/sched/sem_destroy.c +++ b/sched/semaphore/sem_destroy.c @@ -42,7 +42,7 @@ #include #include -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Definitions diff --git a/sched/sem_findnamed.c b/sched/semaphore/sem_findnamed.c similarity index 99% rename from sched/sem_findnamed.c rename to sched/semaphore/sem_findnamed.c index bcba47a8ac6..7fb09b09238 100644 --- a/sched/sem_findnamed.c +++ b/sched/semaphore/sem_findnamed.c @@ -41,7 +41,7 @@ #include -#include "sem_internal.h" +#include "semaphore/semaphore.h" /************************************************************************ * Definitions diff --git a/sched/sem_holder.c b/sched/semaphore/sem_holder.c similarity index 99% rename from sched/sem_holder.c rename to sched/semaphore/sem_holder.c index 5a399f7aaee..82e7e80a354 100644 --- a/sched/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_holder.c + * sched/semaphore/sem_holder.c * * Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" #ifdef CONFIG_PRIORITY_INHERITANCE @@ -626,7 +626,7 @@ static inline void sem_restorebaseprio_irq(FAR struct tcb_s *stcb, { /* Perfom the following actions only if a new thread was given a count. * The thread that received the count should be the highest priority - * of all threads waiting for a count from the semphore. So in that + * of all threads waiting for a count from the semaphore. So in that * case, the priority of all holder threads should be dropped to the * next highest pending priority. */ @@ -689,7 +689,7 @@ static inline void sem_restorebaseprio_task(FAR struct tcb_s *stcb, FAR sem_t *s /* Perfom the following actions only if a new thread was given a count. * The thread that received the count should be the highest priority - * of all threads waiting for a count from the semphore. So in that + * of all threads waiting for a count from the semaphore. So in that * case, the priority of all holder threads should be dropped to the * next highest pending priority. */ diff --git a/sched/sem_initialize.c b/sched/semaphore/sem_initialize.c similarity index 99% rename from sched/sem_initialize.c rename to sched/semaphore/sem_initialize.c index d8b402825a8..76732651ce5 100644 --- a/sched/sem_initialize.c +++ b/sched/semaphore/sem_initialize.c @@ -41,7 +41,7 @@ #include -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Definitions diff --git a/sched/sem_open.c b/sched/semaphore/sem_open.c similarity index 99% rename from sched/sem_open.c rename to sched/semaphore/sem_open.c index d3ebede8291..8308ffb860d 100644 --- a/sched/sem_open.c +++ b/sched/semaphore/sem_open.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_open.c + * sched/semaphore/sem_open.c * * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,7 +50,7 @@ #include -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/sem_post.c b/sched/semaphore/sem_post.c similarity index 99% rename from sched/sem_post.c rename to sched/semaphore/sem_post.c index 598387249ea..50ff4281157 100644 --- a/sched/sem_post.c +++ b/sched/semaphore/sem_post.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_post.c + * sched/semaphore/sem_post.c * * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -45,7 +45,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Definitions diff --git a/sched/sem_timedwait.c b/sched/semaphore/sem_timedwait.c similarity index 98% rename from sched/sem_timedwait.c rename to sched/semaphore/sem_timedwait.c index 154f1d92a36..971251f5640 100644 --- a/sched/sem_timedwait.c +++ b/sched/semaphore/sem_timedwait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_timedwait.c + * sched/semaphore/sem_timedwait.c * * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,7 +51,7 @@ #include "os_internal.h" #include "clock_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Pre-processor Definitions @@ -219,7 +219,7 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) return OK; } - /* We will have to wait for the semphore. Make sure that we were provided + /* We will have to wait for the semaphore. Make sure that we were provided * with a valid timeout. */ diff --git a/sched/sem_trywait.c b/sched/semaphore/sem_trywait.c similarity index 98% rename from sched/sem_trywait.c rename to sched/semaphore/sem_trywait.c index 38de330a519..8fe1629a8da 100644 --- a/sched/sem_trywait.c +++ b/sched/semaphore/sem_trywait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_trywait.c + * sched/semaphore/sem_trywait.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/sem_unlink.c b/sched/semaphore/sem_unlink.c similarity index 98% rename from sched/sem_unlink.c rename to sched/semaphore/sem_unlink.c index 0ee262c7979..72c991c8b78 100644 --- a/sched/sem_unlink.c +++ b/sched/semaphore/sem_unlink.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_unlink.c + * sched/semaphore/sem_unlink.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -45,7 +45,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/sem_wait.c b/sched/semaphore/sem_wait.c similarity index 99% rename from sched/sem_wait.c rename to sched/semaphore/sem_wait.c index 53e2cf21f10..e6e896c80d8 100644 --- a/sched/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_wait.c + * sched/semaphore/sem_wait.c * * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/sem_waitirq.c b/sched/semaphore/sem_waitirq.c similarity index 98% rename from sched/sem_waitirq.c rename to sched/semaphore/sem_waitirq.c index b86daaa5db7..49bed13ac7d 100644 --- a/sched/sem_waitirq.c +++ b/sched/semaphore/sem_waitirq.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/sem_waitirq.c + * sched/semaphore/sem_waitirq.c * * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -43,7 +43,7 @@ #include #include -#include "sem_internal.h" +#include "semaphore/semaphore.h" /**************************************************************************** * Definitions diff --git a/sched/sem_internal.h b/sched/semaphore/semaphore.h similarity index 95% rename from sched/sem_internal.h rename to sched/semaphore/semaphore.h index 27ecc7d333a..00e47c3fdac 100644 --- a/sched/sem_internal.h +++ b/sched/semaphore/semaphore.h @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/sem_internal.h + * sched/semaphore/semaphore.h * - * Copyright (C) 2007, 2009-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __SCHED_SEM_INTERNAL_H -#define __SCHED_SEM_INTERNAL_H +#ifndef __SCHED_SEMAPHORE_SEMAPHORE_H +#define __SCHED_SEMAPHORE_SEMAPHORE_H /**************************************************************************** * Included Files @@ -128,5 +128,5 @@ void sem_canceled(FAR struct tcb_s *stcb, FAR sem_t *sem); } #endif -#endif /* __SCHED_SEM_INTERNAL_H */ +#endif /* __SCHED_SEMAPHORE_SEMAPHORE_H */ diff --git a/sched/signal/Make.defs b/sched/signal/Make.defs new file mode 100644 index 00000000000..d529d0e9bfb --- /dev/null +++ b/sched/signal/Make.defs @@ -0,0 +1,52 @@ +############################################################################ +# sched/signal/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. +# +############################################################################ + +ifneq ($(CONFIG_DISABLE_SIGNALS),y) + +SIGNAL_SRCS = sig_initialize.c +SIGNAL_SRCS += sig_action.c sig_procmask.c sig_pending.c sig_suspend.c +SIGNAL_SRCS += sig_kill.c sig_queue.c sig_waitinfo.c sig_timedwait.c +SIGNAL_SRCS += sig_findaction.c sig_allocatependingsigaction.c +SIGNAL_SRCS += sig_releasependingsigaction.c sig_unmaskpendingsignal.c +SIGNAL_SRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c +SIGNAL_SRCS += sig_mqnotempty.c sig_cleanup.c sig_dispatch.c sig_deliver.c +SIGNAL_SRCS += sig_pause.c + +# Include signal build support + +DEPPATH += --dep-path signal +VPATH += :signal + +endif diff --git a/sched/signal/sig_deliver.c b/sched/signal/sig_deliver.c index 442e6c61d05..3a39a5d1f9f 100644 --- a/sched/signal/sig_deliver.c +++ b/sched/signal/sig_deliver.c @@ -48,7 +48,7 @@ #include #include "os_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" #include "signal/signal.h" /**************************************************************************** diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index af5339743f5..3697e8ee52f 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -50,7 +50,7 @@ #include "os_internal.h" #include "group_internal.h" -#include "sem_internal.h" +#include "semaphore/semaphore.h" #include "signal/signal.h" #include "mqueue/mqueue.h"