00001
00002
00003 #ifndef config_h
00004 #define config_h
00005
00006 #include <globalconfig.h>
00007 #include "config_tcbsize.h"
00008 #include "l4_types.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #define STRINGIFY_(x) #x
00022 #define STRINGIFY(x) STRINGIFY_(x)
00023
00024 #if defined(__GNUC__)
00025 # if defined(__GNUC_PATCHLEVEL__)
00026 # define COMPILER STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__) "." STRINGIFY(__GNUC_PATCHLEVEL__)
00027 # else
00028 # define COMPILER STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__)
00029 # endif
00030 # define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
00031 #else
00032 # define COMPILER "Non-GCC"
00033 # define GCC_VERSION 0
00034 #endif
00035
00036 #define GREETING_COLOR_ANSI_OFF "\033[0m"
00037
00038 class Config
00039 {
00040 public:
00041
00042 static const char *const kernel_warn_config_string;
00043
00044 enum {
00045 SERIAL_ESC_IRQ = 2,
00046 SERIAL_ESC_NOIRQ = 1,
00047 SERIAL_NO_ESC = 0,
00048 };
00049
00050 static void init();
00051 static void init_arch();
00052
00053 static const unsigned max_threads();
00054
00055
00056 static const unsigned kernel_version_id = 0x01004444;
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 static const Mword thread_block_size = THREAD_BLOCK_SIZE;
00067
00068 static const bool conservative = false;
00069 static const bool monitor_page_faults = conservative;
00070
00071 #ifdef CONFIG_DECEIT_BIT_DISABLES_SWITCH
00072 static const bool deceit_bit_disables_switch = true;
00073 #else
00074 static const bool deceit_bit_disables_switch = false;
00075 #endif
00076 #ifdef CONFIG_FINE_GRAINED_CPUTIME
00077 static const bool fine_grained_cputime = true;
00078 #else
00079 static const bool fine_grained_cputime = false;
00080 #endif
00081
00082 static bool irq_ack_in_kernel;
00083 static bool esc_hack;
00084
00085 static unsigned tbuf_entries;
00086
00087 #ifdef CONFIG_PROFILE
00088 static bool profiling;
00089 #else
00090 static const bool profiling = false;
00091 #endif
00092 #ifdef CONFIG_STACK_DEPTH
00093 static const bool stack_depth = true;
00094 #else
00095 static const bool stack_depth = false;
00096 #endif
00097 static const int profiling_rate = 100;
00098 static const int profile_irq = 0;
00099
00100
00101 static const unsigned kernel_prio = 0;
00102 static const unsigned kernel_mcp = 255;
00103
00104
00105 static const unsigned sigma0_prio = 0x10;
00106 static const unsigned sigma0_mcp = 0;
00107
00108
00109 static const unsigned boot_prio = 0x10;
00110 static const unsigned boot_mcp = 255;
00111
00112 static const int warn_level = CONFIG_WARN_LEVEL;
00113
00114 static const L4_uid kernel_id;
00115 static const unsigned kernel_taskno = 0;
00116
00117 static const L4_uid sigma0_id;
00118 static const unsigned sigma0_taskno = 2;
00119
00120 static const L4_uid boot_id;
00121 static const unsigned boot_taskno = 4;
00122
00123 enum {
00124 #ifndef CONFIG_KIP_SYSCALLS
00125 Kip_syscalls = 0,
00126 #else
00127 Kip_syscalls = 1,
00128 #endif
00129 #ifdef CONFIG_SMALL_SPACES
00130 Small_spaces = 1,
00131 #else
00132 Small_spaces = 0,
00133 #endif
00134 #ifdef CONFIG_ASSEMBLER_IPC_SHORTCUT
00135 Assembler_ipc_shortcut = 1,
00136 #else
00137 Assembler_ipc_shortcut = 0,
00138 #endif
00139 #ifdef CONFIG_NO_FRAME_PTR
00140 Have_frame_ptr = 0,
00141 #else
00142 Have_frame_ptr = 1,
00143 #endif
00144 Mapdb_ram_only = 1,
00145 #ifdef CONFIG_DEBUG_KERNEL_PAGE_FAULTS
00146 Log_kernel_page_faults = 1,
00147 #else
00148 Log_kernel_page_faults = 0,
00149 #endif
00150
00151 #ifdef CONFIG_JDB_LOGGING
00152 Jdb_logging = 1,
00153 #else
00154 Jdb_logging = 0,
00155 #endif
00156 #ifdef CONFIG_JDB_ACCOUNTING
00157 Jdb_accounting = 1,
00158 #else
00159 Jdb_accounting = 0,
00160 #endif
00161 #ifdef CONFIG_MULTI_IRQ_ATTACH
00162 Multi_irq_attach = 1,
00163 #else
00164 Multi_irq_attach = 0,
00165 #endif
00166 };
00167 private:
00168
00169 public:
00170 enum
00171 {
00172 Abi_v2 = 1,
00173 };
00174 private:
00175
00176 public:
00177
00178 static const unsigned kernel_mem_per_cent = 8;
00179 static const unsigned kernel_mem_max = 60 << 20;
00180 private:
00181
00182 public:
00183 static int serial_esc;
00184 private:
00185
00186 public:
00187
00188 enum {
00189 PAGE_SHIFT = 12,
00190 PAGE_SIZE = 1 << PAGE_SHIFT,
00191 PAGE_MASK = ~( PAGE_SIZE - 1),
00192
00193 SUPERPAGE_SHIFT = 22,
00194 SUPERPAGE_SIZE = 1 << SUPERPAGE_SHIFT,
00195 SUPERPAGE_MASK = ~( SUPERPAGE_SIZE -1 ),
00196
00197 Max_num_irqs = 20,
00198 Max_num_dirqs = 16,
00199 Irq_shortcut = 1,
00200 };
00201
00202 enum {
00203 SCHED_PIT = 0,
00204 SCHED_RTC = 1,
00205 SCHED_APIC = 2,
00206 };
00207 private:
00208
00209 public:
00210
00211 enum
00212 {
00213 Tbuf_irq = 16,
00214 Vkey_irq = 17,
00215 };
00216
00217 static const bool backward_compatibility = true;
00218
00219 #ifdef CONFIG_IO_PROT
00220 static const bool enable_io_protection = true;
00221 #else
00222 static const bool enable_io_protection = false;
00223 #endif
00224
00225 #ifdef CONFIG_SCHED_PIT
00226 static const unsigned scheduler_mode = SCHED_PIT;
00227 static const unsigned scheduler_irq_vector = 0x20U;
00228 static const unsigned scheduler_granularity = 1000U;
00229 static const unsigned default_time_slice = 10 * scheduler_granularity;
00230 #endif
00231
00232 #ifdef CONFIG_SCHED_RTC
00233 static const unsigned scheduler_mode = SCHED_RTC;
00234 static const unsigned scheduler_irq_vector = 0x28U;
00235 # ifdef CONFIG_SLOW_RTC
00236 static const unsigned scheduler_granularity = 15625U;
00237 static const unsigned default_time_slice = 10 * scheduler_granularity;
00238 # else
00239 static const unsigned scheduler_granularity = 976U;
00240 static const unsigned default_time_slice = 10 * scheduler_granularity;
00241 # endif
00242 #endif
00243
00244 #ifdef CONFIG_SCHED_APIC
00245 static const unsigned scheduler_mode = SCHED_APIC;
00246 static const unsigned scheduler_irq_vector = 0x3dU;
00247 # ifdef CONFIG_ONE_SHOT
00248 static const bool scheduler_one_shot = true;
00249 static const unsigned scheduler_granularity = 1U;
00250 static const unsigned default_time_slice = 10000 * scheduler_granularity;
00251 # else
00252 static const bool scheduler_one_shot = false;
00253 static const unsigned scheduler_granularity = 1000U;
00254 static const unsigned default_time_slice = 10 * scheduler_granularity;
00255 # endif
00256 #endif
00257
00258 #ifdef CONFIG_POWERSAVE_GETCHAR
00259 static const bool getchar_does_hlt = true;
00260 #else
00261 static const bool getchar_does_hlt = false;
00262 #endif
00263
00264 static bool getchar_does_hlt_works_ok;
00265 static bool apic;
00266
00267 #ifdef CONFIG_WATCHDOG
00268 static bool watchdog;
00269 #else
00270 static const bool watchdog = false;
00271 #endif
00272
00273 static const bool hlt_works_ok = true;
00274 static const bool pic_prio_modify = true;
00275 #ifdef CONFIG_SYNC_TSC
00276 static const bool kinfo_timer_uses_rdtsc = true;
00277 #else
00278 static const bool kinfo_timer_uses_rdtsc = false;
00279 #endif
00280
00281
00282 static const unsigned default_console_uart = 2;
00283 static const unsigned default_console_uart_baudrate = 115200;
00284
00285 static char const char_micro;
00286
00287 static bool found_vmware;
00288 };
00289
00290 #define GREETING_COLOR_ANSI_TITLE "\033[1;32m"
00291 #define GREETING_COLOR_ANSI_INFO "\033[0;32m"
00292
00293 #ifdef CONFIG_ARM
00294 #define ARCH_NAME "arm"
00295 #else
00296 #define ARCH_NAME "x86"
00297 #endif
00298
00299 #define CONFIG_KERNEL_VERSION_STRING \
00300 GREETING_COLOR_ANSI_TITLE "Welcome to Fiasco("CONFIG_XARCH")!\\n" \
00301 GREETING_COLOR_ANSI_INFO "DD-L4("CONFIG_ABI")/" ARCH_NAME " " \
00302 "microkernel (C) 1998-2005 TU Dresden\\n" \
00303 "Rev: " CODE_VERSION " compiled with gcc " COMPILER \
00304 " for " CONFIG_IA32_TARGET \
00305 GREETING_COLOR_ANSI_OFF
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319 inline unsigned const
00320 Config::max_threads()
00321 {
00322 return L4_uid::max_threads();
00323 }
00324
00325 #endif // config_h