2 * Global kernel configuration
7 #include <globalconfig.h>
8 #include "config_tcbsize.h"
11 // special magic to allow old compilers to inline constants
13 #define STRINGIFY_(x) #x
14 #define STRINGIFY(x) STRINGIFY_(x)
17 # if defined(__GNUC_PATCHLEVEL__)
18 # define COMPILER STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__) "." STRINGIFY(__GNUC_PATCHLEVEL__)
20 # define COMPILER STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__)
22 # define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
24 # define COMPILER "Non-GCC"
25 # define GCC_VERSION 0
28 #define GREETING_COLOR_ANSI_OFF "\033[0m"
30 #define FIASCO_KERNEL_SUBVERSION 0
36 static const char *const kernel_warn_config_string;
45 static void init_arch();
47 // global kernel configuration
48 static const unsigned kernel_version_id
49 = 0x87004444 | (FIASCO_KERNEL_SUBVERSION << 16); // "DD....."
51 static const Mword thread_block_size = THREAD_BLOCK_SIZE;
53 static const bool conservative = false;
55 #ifdef CONFIG_FINE_GRAINED_CPUTIME
56 static const bool fine_grained_cputime = true;
58 static const bool fine_grained_cputime = false;
61 static bool irq_ack_in_kernel;
64 static unsigned tbuf_entries;
67 static bool profiling;
69 static const bool profiling = false;
71 #ifdef CONFIG_STACK_DEPTH
72 static const bool stack_depth = true;
74 static const bool stack_depth = false;
76 static const int profiling_rate = 100;
77 static const int profile_irq = 0;
79 // kernel (idle) task definitions
80 static const unsigned kernel_prio = 0;
81 static const unsigned kernel_mcp = 255;
83 // sigma0 task definitions
84 static const unsigned sigma0_prio = 0x10;
85 static const unsigned sigma0_mcp = 0;
87 // root (boot) task definitions
88 static const unsigned boot_prio = 0x10;
89 static const unsigned boot_mcp = 255;
91 static const int warn_level = CONFIG_WARN_LEVEL;
93 static const unsigned kernel_taskno = 0;
94 static const unsigned sigma0_taskno = 2;
95 static const unsigned boot_taskno = 4;
99 #ifdef CONFIG_ASSEMBLER_IPC_SHORTCUT
100 Assembler_ipc_shortcut = 1,
102 Assembler_ipc_shortcut = 0,
104 #ifdef CONFIG_NO_FRAME_PTR
110 #ifdef CONFIG_DEBUG_KERNEL_PAGE_FAULTS
111 Log_kernel_page_faults = 1,
113 Log_kernel_page_faults = 0,
121 #ifdef CONFIG_JDB_LOGGING
126 #ifdef CONFIG_JDB_ACCOUNTING
132 Max_num_cpus = CONFIG_MP_MAX_CPUS,
139 #define GREETING_COLOR_ANSI_TITLE "\033[1;32m"
140 #define GREETING_COLOR_ANSI_INFO "\033[0;32m"
143 #define ARCH_NAME "ia32"
144 #define TARGET_NAME CONFIG_IA32_TARGET
147 #define ARCH_NAME "arm"
150 #define ARCH_NAME "amd64"
151 #define TARGET_NAME CONFIG_IA32_TARGET
154 #define ARCH_NAME "ppc32"
157 #define CONFIG_KERNEL_VERSION_STRING \
158 GREETING_COLOR_ANSI_TITLE "Welcome to Fiasco.OC ("CONFIG_XARCH")!\\n" \
159 GREETING_COLOR_ANSI_INFO "L4/Fiasco.OC " ARCH_NAME " " \
160 "microkernel (C) 1998-2010 TU Dresden\\n" \
161 "Rev: " CODE_VERSION " compiled with gcc " COMPILER \
162 " for " TARGET_NAME " [" CONFIG_LABEL "]\\n" \
163 "Build: #" BUILD_NR " " BUILD_DATE "\\n" \
164 GREETING_COLOR_ANSI_OFF
167 //---------------------------------------------------------------------------
170 EXTENSION class Config
173 // 32MB RAM => 2.5MB kmem, 128MB RAM => 16MB kmem, >=512MB RAM => 64MB kmem
174 static const unsigned kernel_mem_per_cent = 8;
177 kernel_mem_max = 64 << 20
181 //---------------------------------------------------------------------------
184 EXTENSION class Config
187 // 32MB RAM => 2.5MB kmem, 128MB RAM => 16MB kmem, >=512MB RAM => 60MB kmem
188 static const unsigned kernel_mem_per_cent = 8;
191 kernel_mem_max = 60 << 20
195 //---------------------------------------------------------------------------
198 EXTENSION class Config
201 static int serial_esc;
204 //---------------------------------------------------------------------------
207 EXTENSION class Config
210 static const int serial_esc = 0;
213 //---------------------------------------------------------------------------
220 #include "initcalls.h"
223 KIP_KERNEL_ABI_VERSION(STRINGIFY(FIASCO_KERNEL_SUBVERSION));
226 bool Config::esc_hack = false;
228 int Config::serial_esc = Config::SERIAL_NO_ESC;
230 bool Config::irq_ack_in_kernel = false;
232 #ifdef CONFIG_PROFILE
233 bool Config::profiling = false;
236 unsigned Config::tbuf_entries = 0x20000 / sizeof(Mword); //1024;
238 //-----------------------------------------------------------------------------
239 IMPLEMENTATION [!arm && !ppc32]:
241 IMPLEMENT FIASCO_INIT
244 char const *cmdline = Cmdline::cmdline();
248 if (strstr(cmdline, " -esc"))
251 #ifdef CONFIG_PROFILE
252 if (strstr(cmdline, " -profile"))
256 if (strstr(cmdline, " -always_irqack"))
257 irq_ack_in_kernel = true;
260 if ( strstr(cmdline, " -serial_esc")
261 && !strstr(cmdline, " -noserial")
263 && strstr(cmdline, " -nokdb")
265 && !strstr(cmdline, " -nojdb"))
267 serial_esc = SERIAL_ESC_IRQ;
273 //----------------------------------------------------------------------------
274 IMPLEMENTATION[rotext]:
279 { return strstr(Cmdline::cmdline()," -rotext"); }
281 //----------------------------------------------------------------------------
282 IMPLEMENTATION[!rotext]: