From: asterix Date: Mon, 26 May 2008 16:00:19 +0000 (+0000) Subject: Rename and move kenel conf on cfg dir. X-Git-Tag: 2.0.0~560 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=98ded3ca8170745170c334b507e9896fdf0a3f4a;p=bertos.git Rename and move kenel conf on cfg dir. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1374 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cfg/cfg_kern.h b/bertos/cfg/cfg_kern.h new file mode 100644 index 00000000..8211f68b --- /dev/null +++ b/bertos/cfg/cfg_kern.h @@ -0,0 +1,121 @@ +/** + * \file + * + * + * \brief Kernel configuration parameters + * + * \version $Id$ + * + * \author Bernardo Innocenti + */ + +#ifndef CONFIG_KERN_H +#define CONFIG_KERN_H + +#include /* ARCH_EMUL */ + +/** + * \name Modules activation + * + * \{ + */ +/* Module/option Active Dependencies */ +#define CONFIG_KERN_SCHED (1) +#define CONFIG_KERN_SIGNALS (1 && CONFIG_KERN_SCHED) +#define CONFIG_KERN_TIMER (1) +#define CONFIG_KERN_HEAP (0) +#define CONFIG_KERN_SEMAPHORES (0 && CONFIG_KERN_SIGNALS) +#define CONFIG_KERN_MONITOR (1 && CONFIG_KERN_SCHED) +/*\}*/ + +/* EXPERIMENTAL */ +#define CONFIG_KERN_PREEMPTIVE (0 && CONFIG_KERN_SCHED && CONFIG_KERN_TIMER) + +#define CONFIG_KERN_QUANTUM 50 /**< Time sharing quantum in timer ticks. */ + +#if (ARCH & ARCH_EMUL) + /* We need a large stack because system libraries are bloated */ + #define CONFIG_PROC_DEFSTACKSIZE 65536 +#else + /** + * Default stack size for each thread, in bytes. + * + * The goal here is to allow a minimal task to save all of its + * registers twice, plus push a maximum of 32 variables on the + * stack. + * + * The actual size computed by the default formula is: + * AVR: 102 + * i386: 156 + * ARM: 164 + * x86_64: 184 + * + * Note that on most 16bit architectures, interrupts will also + * run on the stack of the currently running process. Nested + * interrupts will greatly increases the amount of stack space + * required per process. Use irqmanager to minimize stack + * usage. + */ + #define CONFIG_PROC_DEFSTACKSIZE \ + (CPU_SAVED_REGS_CNT * 2 * sizeof(cpustack_t) \ + + 32 * sizeof(int)) +#endif + +/* OBSOLETE */ +#define CONFIG_KERN_DEFSTACKSIZE CONFIG_PROC_DEFSTACKSIZE + +/* Memory fill codes to help debugging */ +#if CONFIG_KERN_MONITOR + #include + #if (SIZEOF_CPUSTACK_T == 1) + /* 8bit cpustack_t */ + #define CONFIG_KERN_STACKFILLCODE 0xA5 + #define CONFIG_KERN_MEMFILLCODE 0xDB + #elif (SIZEOF_CPUSTACK_T == 2) + /* 16bit cpustack_t */ + #define CONFIG_KERN_STACKFILLCODE 0xA5A5 + #define CONFIG_KERN_MEMFILLCODE 0xDBDB + #elif (SIZEOF_CPUSTACK_T == 4) + /* 16bit cpustack_t */ + #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5UL + #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBUL + #elif (SIZEOF_CPUSTACK_T == 8) + /* 16bit cpustack_t */ + #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5A5A5A5A5UL + #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBDBDBDBDBUL + #else + #error No cpustack_t size supported! + #endif +#endif + + +#endif /* CONFIG_KERN_H */ diff --git a/bertos/config_kern.h b/bertos/config_kern.h deleted file mode 100644 index 8211f68b..00000000 --- a/bertos/config_kern.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * \file - * - * - * \brief Kernel configuration parameters - * - * \version $Id$ - * - * \author Bernardo Innocenti - */ - -#ifndef CONFIG_KERN_H -#define CONFIG_KERN_H - -#include /* ARCH_EMUL */ - -/** - * \name Modules activation - * - * \{ - */ -/* Module/option Active Dependencies */ -#define CONFIG_KERN_SCHED (1) -#define CONFIG_KERN_SIGNALS (1 && CONFIG_KERN_SCHED) -#define CONFIG_KERN_TIMER (1) -#define CONFIG_KERN_HEAP (0) -#define CONFIG_KERN_SEMAPHORES (0 && CONFIG_KERN_SIGNALS) -#define CONFIG_KERN_MONITOR (1 && CONFIG_KERN_SCHED) -/*\}*/ - -/* EXPERIMENTAL */ -#define CONFIG_KERN_PREEMPTIVE (0 && CONFIG_KERN_SCHED && CONFIG_KERN_TIMER) - -#define CONFIG_KERN_QUANTUM 50 /**< Time sharing quantum in timer ticks. */ - -#if (ARCH & ARCH_EMUL) - /* We need a large stack because system libraries are bloated */ - #define CONFIG_PROC_DEFSTACKSIZE 65536 -#else - /** - * Default stack size for each thread, in bytes. - * - * The goal here is to allow a minimal task to save all of its - * registers twice, plus push a maximum of 32 variables on the - * stack. - * - * The actual size computed by the default formula is: - * AVR: 102 - * i386: 156 - * ARM: 164 - * x86_64: 184 - * - * Note that on most 16bit architectures, interrupts will also - * run on the stack of the currently running process. Nested - * interrupts will greatly increases the amount of stack space - * required per process. Use irqmanager to minimize stack - * usage. - */ - #define CONFIG_PROC_DEFSTACKSIZE \ - (CPU_SAVED_REGS_CNT * 2 * sizeof(cpustack_t) \ - + 32 * sizeof(int)) -#endif - -/* OBSOLETE */ -#define CONFIG_KERN_DEFSTACKSIZE CONFIG_PROC_DEFSTACKSIZE - -/* Memory fill codes to help debugging */ -#if CONFIG_KERN_MONITOR - #include - #if (SIZEOF_CPUSTACK_T == 1) - /* 8bit cpustack_t */ - #define CONFIG_KERN_STACKFILLCODE 0xA5 - #define CONFIG_KERN_MEMFILLCODE 0xDB - #elif (SIZEOF_CPUSTACK_T == 2) - /* 16bit cpustack_t */ - #define CONFIG_KERN_STACKFILLCODE 0xA5A5 - #define CONFIG_KERN_MEMFILLCODE 0xDBDB - #elif (SIZEOF_CPUSTACK_T == 4) - /* 16bit cpustack_t */ - #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5UL - #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBUL - #elif (SIZEOF_CPUSTACK_T == 8) - /* 16bit cpustack_t */ - #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5A5A5A5A5UL - #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBDBDBDBDBUL - #else - #error No cpustack_t size supported! - #endif -#endif - - -#endif /* CONFIG_KERN_H */