summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-08 13:53:29 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-08 13:53:29 -0600
commit8e2b79c8ef31e80651c6a3513e7c957ccfe18085 (patch)
treed2e9887ab98ab4e6c35015c8940694452a97ffca /nuttx
parent6516afc61128cf7f407e63d9761d64061de0ce41 (diff)
downloadpx4-nuttx-8e2b79c8ef31e80651c6a3513e7c957ccfe18085.tar.gz
px4-nuttx-8e2b79c8ef31e80651c6a3513e7c957ccfe18085.tar.bz2
px4-nuttx-8e2b79c8ef31e80651c6a3513e7c957ccfe18085.zip
Move environment files from sched/ to sched/environ
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/sched/Makefile26
-rw-r--r--nuttx/sched/environ/Make.defs47
-rw-r--r--nuttx/sched/environ/env_clearenv.c (renamed from nuttx/sched/env_clearenv.c)4
-rw-r--r--nuttx/sched/environ/env_dup.c (renamed from nuttx/sched/env_dup.c)4
-rw-r--r--nuttx/sched/environ/env_findvar.c (renamed from nuttx/sched/env_findvar.c)4
-rw-r--r--nuttx/sched/environ/env_getenv.c (renamed from nuttx/sched/env_getenv.c)2
-rw-r--r--nuttx/sched/environ/env_getenvironptr.c (renamed from nuttx/sched/env_getenvironptr.c)0
-rw-r--r--nuttx/sched/environ/env_putenv.c (renamed from nuttx/sched/env_putenv.c)2
-rw-r--r--nuttx/sched/environ/env_release.c (renamed from nuttx/sched/env_release.c)4
-rw-r--r--nuttx/sched/environ/env_removevar.c (renamed from nuttx/sched/env_removevar.c)4
-rw-r--r--nuttx/sched/environ/env_setenv.c (renamed from nuttx/sched/env_setenv.c)4
-rw-r--r--nuttx/sched/environ/env_unsetenv.c (renamed from nuttx/sched/env_unsetenv.c)4
-rw-r--r--nuttx/sched/environ/environ.h (renamed from nuttx/sched/env_internal.h)10
-rw-r--r--nuttx/sched/group_create.c2
-rw-r--r--nuttx/sched/group_find.c2
-rw-r--r--nuttx/sched/group_join.c2
-rw-r--r--nuttx/sched/group_leave.c2
-rw-r--r--nuttx/sched/os_start.c2
-rw-r--r--nuttx/sched/pthread/Make.defs59
-rw-r--r--nuttx/sched/semaphore/Make.defs51
-rw-r--r--nuttx/sched/semaphore/sem_close.c (renamed from nuttx/sched/sem_close.c)4
-rw-r--r--nuttx/sched/semaphore/sem_destroy.c (renamed from nuttx/sched/sem_destroy.c)2
-rw-r--r--nuttx/sched/semaphore/sem_findnamed.c (renamed from nuttx/sched/sem_findnamed.c)2
-rw-r--r--nuttx/sched/semaphore/sem_holder.c (renamed from nuttx/sched/sem_holder.c)8
-rw-r--r--nuttx/sched/semaphore/sem_initialize.c (renamed from nuttx/sched/sem_initialize.c)2
-rw-r--r--nuttx/sched/semaphore/sem_open.c (renamed from nuttx/sched/sem_open.c)4
-rw-r--r--nuttx/sched/semaphore/sem_post.c (renamed from nuttx/sched/sem_post.c)4
-rw-r--r--nuttx/sched/semaphore/sem_timedwait.c (renamed from nuttx/sched/sem_timedwait.c)6
-rw-r--r--nuttx/sched/semaphore/sem_trywait.c (renamed from nuttx/sched/sem_trywait.c)4
-rw-r--r--nuttx/sched/semaphore/sem_unlink.c (renamed from nuttx/sched/sem_unlink.c)4
-rw-r--r--nuttx/sched/semaphore/sem_wait.c (renamed from nuttx/sched/sem_wait.c)4
-rw-r--r--nuttx/sched/semaphore/sem_waitirq.c (renamed from nuttx/sched/sem_waitirq.c)4
-rw-r--r--nuttx/sched/semaphore/semaphore.h (renamed from nuttx/sched/sem_internal.h)10
-rw-r--r--nuttx/sched/signal/Make.defs52
-rw-r--r--nuttx/sched/signal/sig_deliver.c2
-rw-r--r--nuttx/sched/signal/sig_dispatch.c2
36 files changed, 271 insertions, 78 deletions
diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile
index 3e5b5fbee..339f117ab 100644
--- a/nuttx/sched/Makefile
+++ b/nuttx/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/nuttx/sched/environ/Make.defs b/nuttx/sched/environ/Make.defs
new file mode 100644
index 000000000..362fd685d
--- /dev/null
+++ b/nuttx/sched/environ/Make.defs
@@ -0,0 +1,47 @@
+############################################################################
+# sched/environ/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.
+#
+############################################################################
+
+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/nuttx/sched/env_clearenv.c b/nuttx/sched/environ/env_clearenv.c
index 4724e2816..832d6d8ad 100644
--- a/nuttx/sched/env_clearenv.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <sched.h>
#include <stdlib.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_dup.c b/nuttx/sched/environ/env_dup.c
index 1b061be8f..fc529eafe 100644
--- a/nuttx/sched/env_dup.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -49,7 +49,7 @@
#include <nuttx/kmalloc.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_findvar.c b/nuttx/sched/environ/env_findvar.c
index 0594ebd49..2112c1411 100644
--- a/nuttx/sched/env_findvar.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <string.h>
#include <sched.h>
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_getenv.c b/nuttx/sched/environ/env_getenv.c
index 6c4a22038..6a030e3f6 100644
--- a/nuttx/sched/env_getenv.c
+++ b/nuttx/sched/environ/env_getenv.c
@@ -47,7 +47,7 @@
#include <errno.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_getenvironptr.c b/nuttx/sched/environ/env_getenvironptr.c
index 5808dc5dd..5808dc5dd 100644
--- a/nuttx/sched/env_getenvironptr.c
+++ b/nuttx/sched/environ/env_getenvironptr.c
diff --git a/nuttx/sched/env_putenv.c b/nuttx/sched/environ/env_putenv.c
index ad00dd13d..74120f7af 100644
--- a/nuttx/sched/env_putenv.c
+++ b/nuttx/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 <gnutt@nuttx.org>
diff --git a/nuttx/sched/env_release.c b/nuttx/sched/environ/env_release.c
index c6ff7ed75..32287f9f1 100644
--- a/nuttx/sched/env_release.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <sched.h>
#include <errno.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_removevar.c b/nuttx/sched/environ/env_removevar.c
index 076d7cb82..4132eb260 100644
--- a/nuttx/sched/env_removevar.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <string.h>
#include <sched.h>
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_setenv.c b/nuttx/sched/environ/env_setenv.c
index 1b0b54c1c..bdf87a9c5 100644
--- a/nuttx/sched/env_setenv.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -50,7 +50,7 @@
#include <nuttx/kmalloc.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_unsetenv.c b/nuttx/sched/environ/env_unsetenv.c
index b61c73943..70bd04881 100644
--- a/nuttx/sched/env_unsetenv.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -48,7 +48,7 @@
#include <nuttx/kmalloc.h>
#include "os_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
/****************************************************************************
* Private Data
diff --git a/nuttx/sched/env_internal.h b/nuttx/sched/environ/environ.h
index e02bf289d..5a994f8f4 100644
--- a/nuttx/sched/env_internal.h
+++ b/nuttx/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 <gnutt@nuttx.org>
*
* 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/nuttx/sched/group_create.c b/nuttx/sched/group_create.c
index 875c36d10..ef3b02f19 100644
--- a/nuttx/sched/group_create.c
+++ b/nuttx/sched/group_create.c
@@ -47,7 +47,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
#ifdef HAVE_TASK_GROUP
diff --git a/nuttx/sched/group_find.c b/nuttx/sched/group_find.c
index 94836e206..635aa9829 100644
--- a/nuttx/sched/group_find.c
+++ b/nuttx/sched/group_find.c
@@ -47,7 +47,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
#ifdef HAVE_TASK_GROUP
diff --git a/nuttx/sched/group_join.c b/nuttx/sched/group_join.c
index 58d08e8e3..7f8871fe1 100644
--- a/nuttx/sched/group_join.c
+++ b/nuttx/sched/group_join.c
@@ -47,7 +47,7 @@
#include <nuttx/kmalloc.h>
#include "group_internal.h"
-#include "env_internal.h"
+#include "environ/environ.h"
#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD)
diff --git a/nuttx/sched/group_leave.c b/nuttx/sched/group_leave.c
index 5c5414f7f..93ef5363d 100644
--- a/nuttx/sched/group_leave.c
+++ b/nuttx/sched/group_leave.c
@@ -48,7 +48,7 @@
#include <nuttx/net/net.h>
#include <nuttx/lib.h>
-#include "env_internal.h"
+#include "environ/environ.h"
#include "signal/signal.h"
#include "pthread/pthread.h"
#include "mqueue/mqueue.h"
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c
index e5feed422..56f38d667 100644
--- a/nuttx/sched/os_start.c
+++ b/nuttx/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/nuttx/sched/pthread/Make.defs b/nuttx/sched/pthread/Make.defs
new file mode 100644
index 000000000..cc27134f1
--- /dev/null
+++ b/nuttx/sched/pthread/Make.defs
@@ -0,0 +1,59 @@
+############################################################################
+# sched/pthread/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.
+#
+############################################################################
+
+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/nuttx/sched/semaphore/Make.defs b/nuttx/sched/semaphore/Make.defs
new file mode 100644
index 000000000..42f4f655d
--- /dev/null
+++ b/nuttx/sched/semaphore/Make.defs
@@ -0,0 +1,51 @@
+############################################################################
+# sched/semaphore/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.
+#
+############################################################################
+
+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/nuttx/sched/sem_close.c b/nuttx/sched/semaphore/sem_close.c
index 22f1e0f1d..71689a468 100644
--- a/nuttx/sched/sem_close.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -44,7 +44,7 @@
#include <sched.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_destroy.c b/nuttx/sched/semaphore/sem_destroy.c
index 90a2b95ef..19b2d4b8e 100644
--- a/nuttx/sched/sem_destroy.c
+++ b/nuttx/sched/semaphore/sem_destroy.c
@@ -42,7 +42,7 @@
#include <semaphore.h>
#include <errno.h>
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_findnamed.c b/nuttx/sched/semaphore/sem_findnamed.c
index bcba47a8a..7fb09b092 100644
--- a/nuttx/sched/sem_findnamed.c
+++ b/nuttx/sched/semaphore/sem_findnamed.c
@@ -41,7 +41,7 @@
#include <string.h>
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_holder.c b/nuttx/sched/semaphore/sem_holder.c
index 5a399f7aa..82e7e80a3 100644
--- a/nuttx/sched/sem_holder.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/arch.h>
#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/nuttx/sched/sem_initialize.c b/nuttx/sched/semaphore/sem_initialize.c
index d8b402825..76732651c 100644
--- a/nuttx/sched/sem_initialize.c
+++ b/nuttx/sched/semaphore/sem_initialize.c
@@ -41,7 +41,7 @@
#include <queue.h>
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_open.c b/nuttx/sched/semaphore/sem_open.c
index d3ebede82..8308ffb86 100644
--- a/nuttx/sched/sem_open.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -50,7 +50,7 @@
#include <nuttx/kmalloc.h>
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/sem_post.c b/nuttx/sched/semaphore/sem_post.c
index 598387249..50ff42811 100644
--- a/nuttx/sched/sem_post.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_timedwait.c b/nuttx/sched/semaphore/sem_timedwait.c
index 154f1d92a..971251f56 100644
--- a/nuttx/sched/sem_timedwait.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -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/nuttx/sched/sem_trywait.c b/nuttx/sched/semaphore/sem_trywait.c
index 38de330a5..8fe1629a8 100644
--- a/nuttx/sched/sem_trywait.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/sem_unlink.c b/nuttx/sched/semaphore/sem_unlink.c
index 0ee262c79..72c991c8b 100644
--- a/nuttx/sched/sem_unlink.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -45,7 +45,7 @@
#include <queue.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/sem_wait.c b/nuttx/sched/semaphore/sem_wait.c
index 53e2cf21f..e6e896c80 100644
--- a/nuttx/sched/sem_wait.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -46,7 +46,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/sem_waitirq.c b/nuttx/sched/semaphore/sem_waitirq.c
index b86daaa5d..49bed13ac 100644
--- a/nuttx/sched/sem_waitirq.c
+++ b/nuttx/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 <gnutt@nuttx.org>
@@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/arch.h>
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/sem_internal.h b/nuttx/sched/semaphore/semaphore.h
index 27ecc7d33..00e47c3fd 100644
--- a/nuttx/sched/sem_internal.h
+++ b/nuttx/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 <gnutt@nuttx.org>
*
* 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/nuttx/sched/signal/Make.defs b/nuttx/sched/signal/Make.defs
new file mode 100644
index 000000000..d529d0e9b
--- /dev/null
+++ b/nuttx/sched/signal/Make.defs
@@ -0,0 +1,52 @@
+############################################################################
+# sched/signal/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.
+#
+############################################################################
+
+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/nuttx/sched/signal/sig_deliver.c b/nuttx/sched/signal/sig_deliver.c
index 442e6c61d..3a39a5d1f 100644
--- a/nuttx/sched/signal/sig_deliver.c
+++ b/nuttx/sched/signal/sig_deliver.c
@@ -48,7 +48,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
-#include "sem_internal.h"
+#include "semaphore/semaphore.h"
#include "signal/signal.h"
/****************************************************************************
diff --git a/nuttx/sched/signal/sig_dispatch.c b/nuttx/sched/signal/sig_dispatch.c
index af5339743..3697e8ee5 100644
--- a/nuttx/sched/signal/sig_dispatch.c
+++ b/nuttx/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"