diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-01 21:05:55 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-01 21:05:55 +0000 |
commit | 08680a039b6ffc922731d9a1cfdff20ef204dbba (patch) | |
tree | 25bb704377c624f2d63c4bb5ad1df332d44aa78a /nuttx/sched/os_start.c | |
parent | 129dd27cc4deb042d2f88c65927adc49c338756d (diff) | |
download | px4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.tar.gz px4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.tar.bz2 px4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.zip |
This creates a 8051 build that can run in 24Kb of RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@26 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/os_start.c')
-rw-r--r-- | nuttx/sched/os_start.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index d8106ed16..5cf7c940f 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -53,7 +53,9 @@ #ifndef CONFIG_DISABLE_MQUEUE # include "mq_internal.h" #endif -#include "pthread_internal.h" +#ifndef CONFIG_DISABLE_PTHREAD +# include "pthread_internal.h" +#endif #include "clock_internal.h" #include "irq_internal.h" @@ -140,14 +142,16 @@ sq_queue_t g_delayeddeallocations; pid_t g_lastpid; /* The following hash table is used for two things: + * * 1. This hash table greatly speeds the determination of * a new unique process ID for a task, and * 2. Is used to quickly map a process ID into a TCB. * It has the side effects of using more memory and limiting - * the number of tasks to MAX_TASKS_ALLOWED. + * + * the number of tasks to CONFIG_MAX_TASKS. */ -pidhash_t g_pidhash[MAX_TASKS_ALLOWED]; +pidhash_t g_pidhash[CONFIG_MAX_TASKS]; /* This is a table of task lists. This table is indexed by * the task state enumeration type (tstate_t) and provides @@ -185,6 +189,10 @@ const tasklist_t g_tasklisttable[NUM_TASK_STATES] = static FAR _TCB g_idletcb; +/* This is the name of the idle task */ + +static FAR char g_idlename[] = "Idle Task"; + /************************************************************ * Private Function Prototypes ************************************************************/ @@ -225,7 +233,7 @@ void os_start(void) /* Initialize the logic that determine unique process IDs. */ g_lastpid = 0; - for (i = 0; i < MAX_TASKS_ALLOWED; i++) + for (i = 0; i < CONFIG_MAX_TASKS; i++) { g_pidhash[i].tcb = NULL; g_pidhash[i].pid = INVALID_PROCESS_ID; @@ -248,10 +256,10 @@ void os_start(void) g_idletcb.entry.main = (main_t)os_start; #if CONFIG_TASK_NAME_SIZE > 0 - strncpy(g_idletcb.name, "Idle Task", CONFIG_TASK_NAME_SIZE-1); + strncpy(g_idletcb.name, g_idlename, CONFIG_TASK_NAME_SIZE-1); g_idletcb.argv[0] = g_idletcb.name; #else - g_idletcb.argv[0] = "Idle Task"; + g_idletcb.argv[0] = g_idlename; #endif /* CONFIG_TASK_NAME_SIZE */ /* Then add the idle task's TCB to the head of the ready to run list */ @@ -347,21 +355,25 @@ void os_start(void) /* Initialize the thread-specific data facility (if in link) */ +#ifndef CONFIG_DISABLE_PTHREAD #ifdef CONFIG_HAVE_WEAKFUNCTIONS if (pthread_initialize != NULL) #endif { pthread_initialize(); } +#endif /* Initialize the file system (needed to support device drivers) */ +#if CONFIG_NFILE_DESCRIPTORS > 0 #ifdef CONFIG_HAVE_WEAKFUNCTIONS if (fs_initialize != NULL) #endif { fs_initialize(); } +#endif /* The processor specific details of running the operating system * will be handled here. Such things as setting up interrupt |