summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-08 16:44:08 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-08 16:44:08 -0600
commitd699ae3cb3e27074dc6c70bb2cebc577ff5db8d4 (patch)
tree16a334e4719020a14c32aab4ab648a689a7215a2
parentd4595268b7c63a72243c5bd8b3eed4def39e9d3c (diff)
downloadnuttx-d699ae3cb3e27074dc6c70bb2cebc577ff5db8d4.tar.gz
nuttx-d699ae3cb3e27074dc6c70bb2cebc577ff5db8d4.tar.bz2
nuttx-d699ae3cb3e27074dc6c70bb2cebc577ff5db8d4.zip
Move task control files from sched/ to sched/task
-rw-r--r--nuttx/arch/8051/src/up_exit.c1
-rw-r--r--nuttx/arch/arm/src/common/up_exit.c7
-rw-r--r--nuttx/arch/avr/src/common/up_exit.c7
-rw-r--r--nuttx/arch/hc/src/common/up_exit.c7
-rw-r--r--nuttx/arch/mips/src/common/up_exit.c7
-rw-r--r--nuttx/arch/rgmp/src/nuttx.c5
-rw-r--r--nuttx/arch/sh/src/common/up_exit.c7
-rw-r--r--nuttx/arch/sim/src/up_exit.c1
-rw-r--r--nuttx/arch/x86/src/common/up_exit.c7
-rw-r--r--nuttx/arch/z16/src/common/up_exit.c9
-rw-r--r--nuttx/arch/z80/src/common/up_exit.c9
-rw-r--r--nuttx/sched/Makefile35
-rw-r--r--nuttx/sched/exit.c3
-rw-r--r--nuttx/sched/group/Make.defs2
-rw-r--r--nuttx/sched/group/group.h5
-rw-r--r--nuttx/sched/init/init.h7
-rw-r--r--nuttx/sched/os_internal.h12
-rw-r--r--nuttx/sched/pthread/pthread_exit.c1
-rw-r--r--nuttx/sched/task/Make.defs60
-rw-r--r--nuttx/sched/task/spawn.h (renamed from nuttx/sched/spawn_internal.h)8
-rw-r--r--nuttx/sched/task/task.h77
-rw-r--r--nuttx/sched/task/task_activate.c (renamed from nuttx/sched/task_activate.c)2
-rw-r--r--nuttx/sched/task/task_create.c (renamed from nuttx/sched/task_create.c)3
-rw-r--r--nuttx/sched/task/task_delete.c (renamed from nuttx/sched/task_delete.c)3
-rw-r--r--nuttx/sched/task/task_exit.c (renamed from nuttx/sched/task_exit.c)5
-rw-r--r--nuttx/sched/task/task_exithook.c (renamed from nuttx/sched/task_exithook.c)3
-rw-r--r--nuttx/sched/task/task_getgroup.c (renamed from nuttx/sched/task_getgroup.c)3
-rw-r--r--nuttx/sched/task/task_init.c (renamed from nuttx/sched/task_init.c)3
-rw-r--r--nuttx/sched/task/task_posixspawn.c (renamed from nuttx/sched/task_posixspawn.c)5
-rw-r--r--nuttx/sched/task/task_recover.c (renamed from nuttx/sched/task_recover.c)3
-rw-r--r--nuttx/sched/task/task_reparent.c (renamed from nuttx/sched/task_reparent.c)3
-rw-r--r--nuttx/sched/task/task_restart.c (renamed from nuttx/sched/task_restart.c)3
-rw-r--r--nuttx/sched/task/task_setup.c (renamed from nuttx/sched/task_setup.c)5
-rw-r--r--nuttx/sched/task/task_spawn.c (renamed from nuttx/sched/task_spawn.c)5
-rw-r--r--nuttx/sched/task/task_spawnparms.c (renamed from nuttx/sched/task_spawnparms.c)5
-rw-r--r--nuttx/sched/task/task_start.c (renamed from nuttx/sched/task_start.c)3
-rw-r--r--nuttx/sched/task/task_starthook.c (renamed from nuttx/sched/task_starthook.c)4
-rw-r--r--nuttx/sched/task/task_terminate.c (renamed from nuttx/sched/task_terminate.c)3
-rw-r--r--nuttx/sched/task/task_vfork.c (renamed from nuttx/sched/task_vfork.c)3
39 files changed, 240 insertions, 101 deletions
diff --git a/nuttx/arch/8051/src/up_exit.c b/nuttx/arch/8051/src/up_exit.c
index 235eb691f..9ef273294 100644
--- a/nuttx/arch/8051/src/up_exit.c
+++ b/nuttx/arch/8051/src/up_exit.c
@@ -45,6 +45,7 @@
#include <8052.h>
#include <nuttx/arch.h>
+#include "task/task.h"
#include "os_internal.h"
#include "up_internal.h"
diff --git a/nuttx/arch/arm/src/common/up_exit.c b/nuttx/arch/arm/src/common/up_exit.c
index 37b603e50..70358184d 100644
--- a/nuttx/arch/arm/src/common/up_exit.c
+++ b/nuttx/arch/arm/src/common/up_exit.c
@@ -43,13 +43,14 @@
#include <debug.h>
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/arch/avr/src/common/up_exit.c b/nuttx/arch/avr/src/common/up_exit.c
index 355163359..db422b410 100644
--- a/nuttx/arch/avr/src/common/up_exit.c
+++ b/nuttx/arch/avr/src/common/up_exit.c
@@ -43,13 +43,14 @@
#include <debug.h>
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/arch/hc/src/common/up_exit.c b/nuttx/arch/hc/src/common/up_exit.c
index 7fa526ff7..1e8bdca2e 100644
--- a/nuttx/arch/hc/src/common/up_exit.c
+++ b/nuttx/arch/hc/src/common/up_exit.c
@@ -43,13 +43,14 @@
#include <debug.h>
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/arch/mips/src/common/up_exit.c b/nuttx/arch/mips/src/common/up_exit.c
index 415ca64ee..585a667a7 100644
--- a/nuttx/arch/mips/src/common/up_exit.c
+++ b/nuttx/arch/mips/src/common/up_exit.c
@@ -45,13 +45,14 @@
#include <debug.h>
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c
index 0178ae58a..2b20cad64 100644
--- a/nuttx/arch/rgmp/src/nuttx.c
+++ b/nuttx/arch/rgmp/src/nuttx.c
@@ -52,10 +52,11 @@
#include <stdlib.h>
#include <arch/irq.h>
#include <arch/arch.h>
-#include <os_internal.h>
-struct tcb_s *current_task = NULL;
+#include "task/task.h"
+#include "os_internal.h"
+struct tcb_s *current_task = NULL;
/**
* This function is called in non-interrupt context
diff --git a/nuttx/arch/sh/src/common/up_exit.c b/nuttx/arch/sh/src/common/up_exit.c
index d4669caf4..bdb1c520e 100644
--- a/nuttx/arch/sh/src/common/up_exit.c
+++ b/nuttx/arch/sh/src/common/up_exit.c
@@ -44,13 +44,14 @@
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Private Definitions
****************************************************************************/
diff --git a/nuttx/arch/sim/src/up_exit.c b/nuttx/arch/sim/src/up_exit.c
index f4c91e544..b70a91154 100644
--- a/nuttx/arch/sim/src/up_exit.c
+++ b/nuttx/arch/sim/src/up_exit.c
@@ -44,6 +44,7 @@
#include <nuttx/arch.h>
+#include "task/task.h"
#include "os_internal.h"
#include "up_internal.h"
diff --git a/nuttx/arch/x86/src/common/up_exit.c b/nuttx/arch/x86/src/common/up_exit.c
index ad1ec41c6..bf2548214 100644
--- a/nuttx/arch/x86/src/common/up_exit.c
+++ b/nuttx/arch/x86/src/common/up_exit.c
@@ -43,13 +43,14 @@
#include <debug.h>
#include <nuttx/arch.h>
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/arch/z16/src/common/up_exit.c b/nuttx/arch/z16/src/common/up_exit.c
index c578a3bfe..99d50bab8 100644
--- a/nuttx/arch/z16/src/common/up_exit.c
+++ b/nuttx/arch/z16/src/common/up_exit.c
@@ -44,14 +44,15 @@
#include <nuttx/arch.h>
-#include "chip/chip.h"
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "chip/chip.h"
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Private Definitions
****************************************************************************/
diff --git a/nuttx/arch/z80/src/common/up_exit.c b/nuttx/arch/z80/src/common/up_exit.c
index 50d675f96..124ee1035 100644
--- a/nuttx/arch/z80/src/common/up_exit.c
+++ b/nuttx/arch/z80/src/common/up_exit.c
@@ -45,14 +45,15 @@
#include <nuttx/arch.h>
-#include "chip/chip.h"
-#include "os_internal.h"
-#include "up_internal.h"
-
#ifdef CONFIG_DUMP_ON_EXIT
#include <nuttx/fs/fs.h>
#endif
+#include "chip/chip.h"
+#include "task/task.h"
+#include "os_internal.h"
+#include "up_internal.h"
+
/****************************************************************************
* Private Definitions
****************************************************************************/
diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile
index 563983aac..c1dade975 100644
--- a/nuttx/sched/Makefile
+++ b/nuttx/sched/Makefile
@@ -40,31 +40,10 @@ DEPPATH = --dep-path .
ASRCS =
-TSK_SRCS = prctl.c exit.c getpid.c
-TSK_SRCS += task_create.c task_init.c task_setup.c task_activate.c task_start.c
-TSK_SRCS += task_delete.c task_exit.c task_exithook.c task_recover.c
-TSK_SRCS += task_restart.c task_spawn.c task_spawnparms.c task_terminate.c
-TSK_SRCS += sched_addreadytorun.c sched_removereadytorun.c sched_addprioritized.c
-TSK_SRCS += sched_mergepending.c sched_addblocked.c sched_removeblocked.c
-TSK_SRCS += sched_free.c sched_gettcb.c sched_verifytcb.c sched_releasetcb.c
-
-ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
-ifeq ($(CONFIG_SCHED_WAITPID),y)
-TSK_SRCS += task_vfork.c
-endif
-endif
-
-ifneq ($(CONFIG_BINFMT_DISABLE),y)
-ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
-TSK_SRCS += task_posixspawn.c
-endif
-endif
-
-ifeq ($(CONFIG_SCHED_STARTHOOK),y)
-TSK_SRCS += task_starthook.c
-endif
-
SCHED_SRCS = sched_garbage.c sched_getfiles.c
+SCHED_SRCS += sched_addreadytorun.c sched_removereadytorun.c sched_addprioritized.c
+SCHED_SRCS += sched_mergepending.c sched_addblocked.c sched_removeblocked.c
+SCHED_SRCS += sched_free.c sched_gettcb.c sched_verifytcb.c sched_releasetcb.c
SCHED_SRCS += sched_getsockets.c sched_getstreams.c
SCHED_SRCS += sched_setparam.c sched_setpriority.c sched_getparam.c
SCHED_SRCS += sched_setscheduler.c sched_getscheduler.c
@@ -108,6 +87,7 @@ include init/Make.defs
include irq/Make.defs
include paging/Make.defs
include group/Make.defs
+include task/Make.defs
include errno/Make.defs
include wdog/Make.defs
include semaphore/Make.defs
@@ -118,8 +98,11 @@ include clock/Make.defs
include timer/Make.defs
include environ/Make.defs
-CSRCS = $(INIT_SRCS) $(IRQ_SRCS) $(PG_SRCS) $(GRP_SRCS) $(TSK_SRCS)
-CSRCS += $(SCHED_SRCS) $(ERRNO_SRCS) $(WDOG_SRCS) $(SEM_SRCS)
+# REVISIT
+TSK_SRCS += prctl.c exit.c getpid.c
+
+CSRCS = $(INIT_SRCS) $(IRQ_SRCS) $(PG_SRCS) $(GRP_SRCS) $(SCHED_SRCS)
+CSRCS += $(TSK_SRCS) $(ERRNO_SRCS) $(WDOG_SRCS) $(SEM_SRCS)
CSRCS += $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(CLOCK_SRCS)
CSRCS += $(TIMER_SRCS) $(ENV_SRCS)
diff --git a/nuttx/sched/exit.c b/nuttx/sched/exit.c
index b88c84ec3..db922d89f 100644
--- a/nuttx/sched/exit.c
+++ b/nuttx/sched/exit.c
@@ -46,10 +46,11 @@
#include <nuttx/fs/fs.h>
+#include "task/task.h"
#include "os_internal.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/sched/group/Make.defs b/nuttx/sched/group/Make.defs
index b389055cf..b88436547 100644
--- a/nuttx/sched/group/Make.defs
+++ b/nuttx/sched/group/Make.defs
@@ -35,7 +35,7 @@
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
+GRP_SRCS += group_foreachchild.c group_killchildren.c
ifeq ($(CONFIG_SCHED_HAVE_PARENT),y)
GRP_SRCS += task_reparent.c
diff --git a/nuttx/sched/group/group.h b/nuttx/sched/group/group.h
index 96ebe231d..a15919070 100644
--- a/nuttx/sched/group/group.h
+++ b/nuttx/sched/group/group.h
@@ -75,6 +75,11 @@ extern FAR struct task_group_s *g_grouphead;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
+
+#ifdef CONFIG_SCHED_CHILD_STATUS
+void weak_function task_initialize(void);
+#endif
+
/* Task group data structure management */
#ifdef HAVE_TASK_GROUP
diff --git a/nuttx/sched/init/init.h b/nuttx/sched/init/init.h
index b52920a5c..d3f3ae913 100644
--- a/nuttx/sched/init/init.h
+++ b/nuttx/sched/init/init.h
@@ -42,13 +42,6 @@
#include <nuttx/config.h>
-#include <sys/types.h>
-#include <stdbool.h>
-#include <queue.h>
-#include <sched.h>
-
-#include <nuttx/kmalloc.h>
-
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h
index 6ce7a9757..9307fb313 100644
--- a/nuttx/sched/os_internal.h
+++ b/nuttx/sched/os_internal.h
@@ -219,18 +219,6 @@ extern volatile uint32_t g_cpuload_total;
* Public Function Prototypes
****************************************************************************/
-#ifdef CONFIG_SCHED_CHILD_STATUS
-void weak_function task_initialize(void);
-#endif
-void task_start(void);
-int task_schedsetup(FAR struct task_tcb_s *tcb, int priority,
- start_t start, main_t main, uint8_t ttype);
-int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name,
- FAR char * const argv[]);
-int task_exit(void);
-int task_terminate(pid_t pid, bool nonblocking);
-void task_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking);
-void task_recover(FAR struct tcb_s *tcb);
bool sched_addreadytorun(FAR struct tcb_s *rtrtcb);
bool sched_removereadytorun(FAR struct tcb_s *rtrtcb);
bool sched_addprioritized(FAR struct tcb_s *newTcb, DSEG dq_queue_t *list);
diff --git a/nuttx/sched/pthread/pthread_exit.c b/nuttx/sched/pthread/pthread_exit.c
index 3ca5362f7..ebc7fb262 100644
--- a/nuttx/sched/pthread/pthread_exit.c
+++ b/nuttx/sched/pthread/pthread_exit.c
@@ -50,6 +50,7 @@
#include <nuttx/arch.h>
#include "os_internal.h"
+#include "task/task.h"
#include "pthread/pthread.h"
/************************************************************************
diff --git a/nuttx/sched/task/Make.defs b/nuttx/sched/task/Make.defs
new file mode 100644
index 000000000..0d979e501
--- /dev/null
+++ b/nuttx/sched/task/Make.defs
@@ -0,0 +1,60 @@
+############################################################################
+# sched/task/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.
+#
+############################################################################
+
+TSK_SRCS = task_create.c task_init.c task_setup.c task_activate.c
+TSK_SRCS += task_start.c task_delete.c task_exit.c task_exithook.c
+TSK_SRCS += task_recover.c task_restart.c task_spawn.c task_spawnparms.c
+TSK_SRCS += task_terminate.c task_getgroup.c
+
+ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
+ifeq ($(CONFIG_SCHED_WAITPID),y)
+TSK_SRCS += task_vfork.c
+endif
+endif
+
+ifneq ($(CONFIG_BINFMT_DISABLE),y)
+ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
+TSK_SRCS += task_posixspawn.c
+endif
+endif
+
+ifeq ($(CONFIG_SCHED_STARTHOOK),y)
+TSK_SRCS += task_starthook.c
+endif
+
+# Include task build support
+
+DEPPATH += --dep-path task
+VPATH += :task
diff --git a/nuttx/sched/spawn_internal.h b/nuttx/sched/task/spawn.h
index 89021226a..1e44f035a 100644
--- a/nuttx/sched/spawn_internal.h
+++ b/nuttx/sched/task/spawn.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/spawn_internal.h
+ * sched/task/spawn.h
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __SCHED_SPAWN_INERNAL_H
-#define __SCHED_SPAWN_INERNAL_H
+#ifndef __SCHED_TASK_SPAWN_H
+#define __SCHED_TASK_SPAWN_H
/****************************************************************************
* Included Files
@@ -159,4 +159,4 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr);
int spawn_proxyattrs(FAR const posix_spawnattr_t *attr,
FAR const posix_spawn_file_actions_t *file_actions);
-#endif /* __SCHED_SPAWN_INERNAL_H */
+#endif /* __SCHED_TASK_SPAWN_H */
diff --git a/nuttx/sched/task/task.h b/nuttx/sched/task/task.h
new file mode 100644
index 000000000..a748877f7
--- /dev/null
+++ b/nuttx/sched/task/task.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * sched/task/task.h
+ *
+ * Copyright (C) 2007-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.
+ *
+ ****************************************************************************/
+
+#ifndef __SCHED_TASK_TASK_H
+#define __SCHED_TASK_TASK_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Type Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Global Variables
+ ****************************************************************************/
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+void task_start(void);
+int task_schedsetup(FAR struct task_tcb_s *tcb, int priority,
+ start_t start, main_t main, uint8_t ttype);
+int task_argsetup(FAR struct task_tcb_s *tcb, FAR const char *name,
+ FAR char * const argv[]);
+int task_exit(void);
+int task_terminate(pid_t pid, bool nonblocking);
+void task_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking);
+void task_recover(FAR struct tcb_s *tcb);
+bool sched_addreadytorun(FAR struct tcb_s *rtrtcb);
+
+#endif /* __SCHED_TASK_TASK_H */
diff --git a/nuttx/sched/task_activate.c b/nuttx/sched/task/task_activate.c
index c4449464c..2b11e5426 100644
--- a/nuttx/sched/task_activate.c
+++ b/nuttx/sched/task/task_activate.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_activate.c
+ * sched/task/task_activate.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/sched/task_create.c b/nuttx/sched/task/task_create.c
index 55fdf22a6..d6663e45c 100644
--- a/nuttx/sched/task_create.c
+++ b/nuttx/sched/task/task_create.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_create.c
+ * sched/task/task_create.c
*
* Copyright (C) 2007-2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -50,6 +50,7 @@
#include "os_internal.h"
#include "group/group.h"
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task/task_delete.c
index ead1811c3..bdae89208 100644
--- a/nuttx/sched/task_delete.c
+++ b/nuttx/sched/task/task_delete.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_delete.c
+ * sched/task/task_delete.c
*
* Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -44,6 +44,7 @@
#include <nuttx/sched.h>
#include "os_internal.h"
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_exit.c b/nuttx/sched/task/task_exit.c
index 4bcdc189c..838eac460 100644
--- a/nuttx/sched/task_exit.c
+++ b/nuttx/sched/task/task_exit.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_exit.c
+ * sched/task/task_exit.c
*
* Copyright (C) 2008-2009, 2012-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -40,10 +40,13 @@
#include <nuttx/config.h>
#include <sched.h>
+
#include "os_internal.h"
+
#ifndef CONFIG_DISABLE_SIGNALS
# include "signal/signal.h"
#endif
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task/task_exithook.c
index 90056c264..7d086c52e 100644
--- a/nuttx/sched/task_exithook.c
+++ b/nuttx/sched/task/task_exithook.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_exithook.c
+ * sched/task/task_exithook.c
*
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,6 +51,7 @@
#include "os_internal.h"
#include "group/group.h"
#include "signal/signal.h"
+#include "task/task.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/task_getgroup.c b/nuttx/sched/task/task_getgroup.c
index 9c7b4b954..abb3e23c5 100644
--- a/nuttx/sched/task_getgroup.c
+++ b/nuttx/sched/task/task_getgroup.c
@@ -1,5 +1,5 @@
/*****************************************************************************
- * sched/task_getgroup.c
+ * sched/task/task_getgroup.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -43,6 +43,7 @@
#include "os_internal.h"
#include "group/group.h"
+#include "task/task.h"
#ifdef HAVE_TASK_GROUP
diff --git a/nuttx/sched/task_init.c b/nuttx/sched/task/task_init.c
index 112ac6801..a0ff9e750 100644
--- a/nuttx/sched/task_init.c
+++ b/nuttx/sched/task/task_init.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_init.c
+ * sched/task/task_init.c
*
* Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -48,6 +48,7 @@
#include "os_internal.h"
#include "group/group.h"
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_posixspawn.c b/nuttx/sched/task/task_posixspawn.c
index 122a83a28..9d4f8f9a3 100644
--- a/nuttx/sched/task_posixspawn.c
+++ b/nuttx/sched/task/task_posixspawn.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_posixspawn.c
+ * sched/task/task_posixspawn.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -47,7 +47,8 @@
#include "os_internal.h"
#include "group/group.h"
-#include "spawn_internal.h"
+#include "task/spawn.h"
+#include "task/task.h"
/****************************************************************************
* Private Types
diff --git a/nuttx/sched/task_recover.c b/nuttx/sched/task/task_recover.c
index 1907a9fe4..76ac236bd 100644
--- a/nuttx/sched/task_recover.c
+++ b/nuttx/sched/task/task_recover.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_recover.c
+ * sched/task/task_recover.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,6 +46,7 @@
#include "os_internal.h"
#include "mqueue/mqueue.h"
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_reparent.c b/nuttx/sched/task/task_reparent.c
index 7f8c8de41..81a449bad 100644
--- a/nuttx/sched/task_reparent.c
+++ b/nuttx/sched/task/task_reparent.c
@@ -1,5 +1,5 @@
/*****************************************************************************
- * sched/task_reparent.c
+ * sched/task/task_reparent.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -43,6 +43,7 @@
#include "os_internal.h"
#include "group/group.h"
+#include "task/task.h"
#ifdef CONFIG_SCHED_HAVE_PARENT
diff --git a/nuttx/sched/task_restart.c b/nuttx/sched/task/task_restart.c
index 1e552030a..dd3a78547 100644
--- a/nuttx/sched/task_restart.c
+++ b/nuttx/sched/task/task_restart.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_restart.c
+ * sched/task/task_restart.c
*
* Copyright (C) 2007, 2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -48,6 +48,7 @@
#include "os_internal.h"
#include "group/group.h"
#include "signal/signal.h"
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_setup.c b/nuttx/sched/task/task_setup.c
index ddf1537bf..89b0ec1d2 100644
--- a/nuttx/sched/task_setup.c
+++ b/nuttx/sched/task/task_setup.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_setup.c
+ * sched/task/task_setup.c
*
* Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,9 +51,10 @@
#include "os_internal.h"
#include "pthread/pthread.h"
#include "group/group.h"
+#include "task/task.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/sched/task_spawn.c b/nuttx/sched/task/task_spawn.c
index 541c62b11..7678455fa 100644
--- a/nuttx/sched/task_spawn.c
+++ b/nuttx/sched/task/task_spawn.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_spawn.c
+ * sched/task/task_spawn.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,8 @@
#include "os_internal.h"
#include "group/group.h"
-#include "spawn_internal.h"
+#include "task/spawn.h"
+#include "task/task.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/task_spawnparms.c b/nuttx/sched/task/task_spawnparms.c
index 25cb86531..7a8cad6c4 100644
--- a/nuttx/sched/task_spawnparms.c
+++ b/nuttx/sched/task/task_spawnparms.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_spawnparms.c
+ * sched/task/task_spawnparms.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -46,7 +46,8 @@
#include <nuttx/spawn.h>
-#include "spawn_internal.h"
+#include "task/spawn.h"
+#include "task/task.h"
/****************************************************************************
* Private Types
diff --git a/nuttx/sched/task_start.c b/nuttx/sched/task/task_start.c
index e9667d486..653e2794a 100644
--- a/nuttx/sched/task_start.c
+++ b/nuttx/sched/task/task_start.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_start.c
+ * sched/task/task_start.c
*
* Copyright (C) 2007-2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -47,6 +47,7 @@
#include <nuttx/sched.h>
#include "os_internal.h"
+#include "task/task.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/nuttx/sched/task_starthook.c b/nuttx/sched/task/task_starthook.c
index 7fa0757aa..dcfb4fca9 100644
--- a/nuttx/sched/task_starthook.c
+++ b/nuttx/sched/task/task_starthook.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_starthook.c
+ * sched/task/task_starthook.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -41,6 +41,8 @@
#include <nuttx/sched.h>
+#include "task/task.h"
+
#ifdef CONFIG_SCHED_STARTHOOK
/****************************************************************************
diff --git a/nuttx/sched/task_terminate.c b/nuttx/sched/task/task_terminate.c
index 11438d22d..4c41e51e4 100644
--- a/nuttx/sched/task_terminate.c
+++ b/nuttx/sched/task/task_terminate.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_terminate.c
+ * sched/task/task_terminate.c
*
* Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,6 +51,7 @@
#ifndef CONFIG_DISABLE_SIGNALS
# include "signal/signal.h"
#endif
+#include "task/task.h"
/****************************************************************************
* Definitions
diff --git a/nuttx/sched/task_vfork.c b/nuttx/sched/task/task_vfork.c
index 706ef864d..963633964 100644
--- a/nuttx/sched/task_vfork.c
+++ b/nuttx/sched/task/task_vfork.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/task_vfork
+ * sched/task/task_vfork
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -50,6 +50,7 @@
#include "os_internal.h"
#include "group/group.h"
+#include "task/task.h"
/****************************************************************************
* Pre-processor Definitions