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 Bernardo Innocenti <bernie@develer.com>
34 * \brief Kernel configuration parameters
38 * \author Bernardo Innocenti <bernie@develer.com>
44 #include <cfg/arch_config.h> /* ARCH_EMUL */
47 * \name Modules activation
51 /* Module/option Active Dependencies */
52 #define CONFIG_KERN_SCHED (1)
53 #define CONFIG_KERN_SIGNALS (1 && CONFIG_KERN_SCHED)
54 #define CONFIG_KERN_TIMER (1)
55 #define CONFIG_KERN_HEAP (0)
56 #define CONFIG_KERN_SEMAPHORES (0 && CONFIG_KERN_SIGNALS)
57 #define CONFIG_KERN_MONITOR (1 && CONFIG_KERN_SCHED)
61 #define CONFIG_KERN_PREEMPTIVE (0 && CONFIG_KERN_SCHED && CONFIG_KERN_TIMER)
63 #define CONFIG_KERN_QUANTUM 50 /**< Time sharing quantum in timer ticks. */
65 #if (ARCH & ARCH_EMUL)
66 /* We need a large stack because system libraries are bloated */
67 #define CONFIG_PROC_DEFSTACKSIZE 65536
70 * Default stack size for each thread, in bytes.
72 * The goal here is to allow a minimal task to save all of its
73 * registers twice, plus push a maximum of 32 variables on the
76 * The actual size computed by the default formula is:
82 * Note that on most 16bit architectures, interrupts will also
83 * run on the stack of the currently running process. Nested
84 * interrupts will greatly increases the amount of stack space
85 * required per process. Use irqmanager to minimize stack
88 #define CONFIG_PROC_DEFSTACKSIZE \
89 (CPU_SAVED_REGS_CNT * 2 * sizeof(cpustack_t) \
94 #define CONFIG_KERN_DEFSTACKSIZE CONFIG_PROC_DEFSTACKSIZE
96 /* Memory fill codes to help debugging */
97 #if CONFIG_KERN_MONITOR
98 #include <cpu/types.h>
99 #if (SIZEOF_CPUSTACK_T == 1)
100 /* 8bit cpustack_t */
101 #define CONFIG_KERN_STACKFILLCODE 0xA5
102 #define CONFIG_KERN_MEMFILLCODE 0xDB
103 #elif (SIZEOF_CPUSTACK_T == 2)
104 /* 16bit cpustack_t */
105 #define CONFIG_KERN_STACKFILLCODE 0xA5A5
106 #define CONFIG_KERN_MEMFILLCODE 0xDBDB
107 #elif (SIZEOF_CPUSTACK_T == 4)
108 /* 16bit cpustack_t */
109 #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5UL
110 #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBUL
111 #elif (SIZEOF_CPUSTACK_T == 8)
112 /* 16bit cpustack_t */
113 #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5A5A5A5A5UL
114 #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBDBDBDBDBUL
116 #error No cpustack_t size supported!
121 #endif /* CONFIG_KERN_H */