diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-28 13:21:11 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-28 13:21:11 +0000 |
commit | b197eb1609652b2b766bb79caf00b23ef07eed40 (patch) | |
tree | 95eb7d346489c2ca197bed15c1b08f2d70e1aec8 /nuttx/include | |
parent | 640f2d23662509b3e5ed691cfa7e5e6c4bce971e (diff) | |
download | px4-nuttx-b197eb1609652b2b766bb79caf00b23ef07eed40.tar.gz px4-nuttx-b197eb1609652b2b766bb79caf00b23ef07eed40.tar.bz2 px4-nuttx-b197eb1609652b2b766bb79caf00b23ef07eed40.zip |
Move helper macro into sched.h
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3430 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/sched.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/nuttx/include/sched.h b/nuttx/include/sched.h index 4bb1fbe78..739f6a98b 100644 --- a/nuttx/include/sched.h +++ b/nuttx/include/sched.h @@ -1,7 +1,7 @@ /******************************************************************************** * include/sched.h * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ * Pre-processor Definitions ********************************************************************************/ -/* Task Management Definitins ***************************************************/ +/* Task Management Definitions **************************************************/ /* POSIX-like scheduling policies */ @@ -63,6 +63,21 @@ #define PTHREAD_KEYS_MAX CONFIG_NPTHREAD_KEYS +/* Non-standard Helper **********************************************************/ +/* 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 task_create() that does not task a stack size of a parameter. The following + * helper macro is provided to work around the ugliness of that exception. + */ + +#ifndef CONFIG_CUSTOM_STACK +# define TASK_INIT(t,n,p,m,s,e,a) task_init(t,n,p,m,s,e,a) +# define TASK_CREATE(n,p,s,e,a) task_create(n,p,s,e,a) +#else +# define TASK_INIT(t,n,p,m,s,e,a) task_init(t,n,p,e,a) +# define TASK_CREATE(n,p,s,e,a) task_create(n,p,e,a) +#endif + /******************************************************************************** * Global Type Definitions ********************************************************************************/ @@ -126,8 +141,8 @@ EXTERN int sched_lock(void); EXTERN int sched_unlock(void); EXTERN int32_t sched_lockcount(void); -/* If instrumentation of the scheduler is enabled, then some - * outboard logic must provide the following interfaces. +/* If instrumentation of the scheduler is enabled, then some outboard logic + * must provide the following interfaces. */ #ifdef CONFIG_SCHED_INSTRUMENTATION @@ -149,3 +164,4 @@ EXTERN void sched_note_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb); #endif /* __ASSEMBLY__ */ #endif /* __INCLUDE_SCHED_H */ + |