summaryrefslogtreecommitdiff
path: root/nuttx/sched/os_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-07 14:39:55 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-07 14:39:55 +0000
commitb7527ff1800f938dcadc65ece0abbbe4a69821eb (patch)
tree13a84dfd1b2725250e41f9b7fec0d61bc3671e10 /nuttx/sched/os_internal.h
parent0a143e4c2dfae5e5b9e1000fd83ce5d05a84d6aa (diff)
downloadpx4-nuttx-b7527ff1800f938dcadc65ece0abbbe4a69821eb.tar.gz
px4-nuttx-b7527ff1800f938dcadc65ece0abbbe4a69821eb.tar.bz2
px4-nuttx-b7527ff1800f938dcadc65ece0abbbe4a69821eb.zip
Add support for kernel-mode threads
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3478 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/os_internal.h')
-rw-r--r--nuttx/sched/os_internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h
index 8cd7257b4..ceeb70df1 100644
--- a/nuttx/sched/os_internal.h
+++ b/nuttx/sched/os_internal.h
@@ -106,6 +106,18 @@ enum os_crash_codes_e
# define sched_releasefiles(t) (OK)
#endif
+/* One processor family supported by NuttX has a single, fixed hardware stack.
+ * That is the 8051 family. So for that family only, there is a variant form
+ * of kernel_thread() that does not take a stack size parameter. The following
+ * helper macro is provided to work around the ugliness of that exception.
+ */
+
+#ifndef CONFIG_CUSTOM_STACK
+# define KERNEL_THREAD(n,p,s,e,a) task_create(n,p,s,e,a)
+#else
+# define KERNEL_THREAD(n,p,s,e,a) task_create(n,p,e,a)
+#endif
+
/* A more efficient ways to access the errno */
#define SET_ERRNO(e) \
@@ -254,7 +266,13 @@ extern int task_schedsetup(FAR _TCB *tcb, int priority, start_t start,
main_t main);
extern int task_argsetup(FAR _TCB *tcb, const char *name, const char *argv[]);
extern int task_deletecurrent(void);
-
+#ifndef CONFIG_CUSTOM_STACK
+extern int kernel_thread(const char *name, int priority,
+ int stack_size, main_t entry, const char *argv[]);
+#else
+extern int kernel_thread(const char *name, int priority,
+ main_t entry, const char *argv[]);
+#endif
extern bool sched_addreadytorun(FAR _TCB *rtrtcb);
extern bool sched_removereadytorun(FAR _TCB *rtrtcb);
extern bool sched_addprioritized(FAR _TCB *newTcb, DSEG dq_queue_t *list);