4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
30 * Copyright 1999,2000,2001 Bernie Innocenti <bernie@codewiz.org>
34 * \brief Kernel configuration parameters
38 * \author Bernie Innocenti <bernie@codewiz.org>
44 #include "cfg/cfg_arch.h" /* ARCH_EMUL */
47 * Multithreading kernel.
49 #define CONFIG_KERNEL 1
52 * \name Modules activation
56 /* Module/option Active Dependencies */
57 #define CONFIG_KERN_SCHED (1)
58 #define CONFIG_KERN_SIGNALS (1 && CONFIG_KERN_SCHED)
59 #define CONFIG_KERN_TIMER (1)
60 #define CONFIG_KERN_HEAP (0)
61 #define CONFIG_KERN_SEMAPHORES (0 && CONFIG_KERN_SIGNALS)
62 #define CONFIG_KERN_MONITOR (1 && CONFIG_KERN_SCHED)
66 #define CONFIG_KERN_PREEMPTIVE (0 && CONFIG_KERN_SCHED && CONFIG_KERN_TIMER)
68 #define CONFIG_KERN_QUANTUM 50 /**< Time sharing quantum in timer ticks. */
70 #if (ARCH & ARCH_EMUL)
71 /* We need a large stack because system libraries are bloated */
72 #define CONFIG_PROC_DEFSTACKSIZE 65536
75 * Default stack size for each thread, in bytes.
77 * The goal here is to allow a minimal task to save all of its
78 * registers twice, plus push a maximum of 32 variables on the
81 * The actual size computed by the default formula is:
87 * Note that on most 16bit architectures, interrupts will also
88 * run on the stack of the currently running process. Nested
89 * interrupts will greatly increases the amount of stack space
90 * required per process. Use irqmanager to minimize stack
93 #define CONFIG_PROC_DEFSTACKSIZE \
94 (CPU_SAVED_REGS_CNT * 2 * sizeof(cpustack_t) \
99 #define CONFIG_KERN_DEFSTACKSIZE CONFIG_PROC_DEFSTACKSIZE
101 /* Memory fill codes to help debugging */
102 #if CONFIG_KERN_MONITOR
103 #include <cpu/types.h>
104 #if (SIZEOF_CPUSTACK_T == 1)
105 /* 8bit cpustack_t */
106 #define CONFIG_KERN_STACKFILLCODE 0xA5
107 #define CONFIG_KERN_MEMFILLCODE 0xDB
108 #elif (SIZEOF_CPUSTACK_T == 2)
109 /* 16bit cpustack_t */
110 #define CONFIG_KERN_STACKFILLCODE 0xA5A5
111 #define CONFIG_KERN_MEMFILLCODE 0xDBDB
112 #elif (SIZEOF_CPUSTACK_T == 4)
113 /* 16bit cpustack_t */
114 #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5UL
115 #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBUL
116 #elif (SIZEOF_CPUSTACK_T == 8)
117 /* 16bit cpustack_t */
118 #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5A5A5A5A5UL
119 #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBDBDBDBDBUL
121 #error No cpustack_t size supported!
125 #endif /* CFG_KERN_H */