1 /* IA32/AMD64 specific */
12 // can access user memory directly
13 Access_user_mem = Access_user_mem_direct,
17 Tbuf_irq = Max_num_dirqs + 0,
19 Max_num_irqs = Max_num_dirqs + 4,
21 /// Timer vector used with APIC timer or IOAPIC
22 Apic_timer_vector = APIC_IRQ_BASE + 0,
33 static unsigned scheduler_irq_vector;
36 static const bool enable_io_protection = true;
38 static const bool enable_io_protection = false;
41 #ifdef CONFIG_SCHED_PIT
42 static const unsigned scheduler_mode = SCHED_PIT;
43 static const unsigned scheduler_granularity = 1000U;
44 static const unsigned default_time_slice = 10 * scheduler_granularity;
47 #ifdef CONFIG_SCHED_RTC
48 static const unsigned scheduler_mode = SCHED_RTC;
49 # ifdef CONFIG_SLOW_RTC
50 static const unsigned scheduler_granularity = 15625U;
51 static const unsigned default_time_slice = 10 * scheduler_granularity;
53 static const unsigned scheduler_granularity = 976U;
54 static const unsigned default_time_slice = 10 * scheduler_granularity;
58 #ifdef CONFIG_ONE_SHOT
59 static const bool scheduler_one_shot = true;
61 static const bool scheduler_one_shot = false;
64 #ifdef CONFIG_SCHED_APIC
65 static const unsigned scheduler_mode = SCHED_APIC;
66 # ifdef CONFIG_ONE_SHOT
67 static const unsigned scheduler_granularity = 1U;
68 static const unsigned default_time_slice = 10000 * scheduler_granularity;
70 static const unsigned scheduler_granularity = 1000U;
71 static const unsigned default_time_slice = 10 * scheduler_granularity;
75 #ifdef CONFIG_SCHED_HPET
76 static const unsigned scheduler_mode = SCHED_HPET;
77 static const unsigned scheduler_granularity = 1000U;
78 static const unsigned default_time_slice = 10 * scheduler_granularity;
81 #ifdef CONFIG_POWERSAVE_GETCHAR
82 static const bool getchar_does_hlt = true;
84 static const bool getchar_does_hlt = false;
87 static bool getchar_does_hlt_works_ok;
90 #ifdef CONFIG_WATCHDOG
93 static const bool watchdog = false;
96 // static const bool hlt_works_ok = false;
97 static bool hlt_works_ok;
98 static const bool pic_prio_modify = true;
99 #ifdef CONFIG_SYNC_TSC
100 static const bool kinfo_timer_uses_rdtsc = true;
102 static const bool kinfo_timer_uses_rdtsc = false;
105 static const bool old_sigma0_adapter_hack = false;
107 // the default uart to use for serial console
108 static const unsigned default_console_uart = 1;
109 static const unsigned default_console_uart_baudrate = 115200;
111 static char const char_micro;
113 static bool found_vmware;
120 IMPLEMENTATION[ia32,amd64]:
125 bool Config::hlt_works_ok = true;
127 bool Config::found_vmware = false;
128 char const Config::char_micro = '\265';
129 bool Config::apic = false;
130 bool Config::getchar_does_hlt_works_ok = false;
132 #ifdef CONFIG_WATCHDOG
133 bool Config::watchdog = false;
136 const char *const Config::kernel_warn_config_string =
137 #ifdef CONFIG_SCHED_RTC
138 " CONFIG_SCHED_RTC is on\n"
140 #ifndef CONFIG_INLINE
141 " CONFIG_INLINE is off\n"
143 #ifndef CONFIG_NDEBUG
144 " CONFIG_NDEBUG is off\n"
146 #ifdef CONFIG_PROFILE
147 " CONFIG_PROFILE is on\n"
149 #ifndef CONFIG_NO_FRAME_PTR
150 " CONFIG_NO_FRAME_PTR is off\n"
152 #ifdef CONFIG_LIST_ALLOC_SANITY
153 " CONFIG_LIST_ALLOC_SANITY is on\n"
155 #ifdef CONFIG_BEFORE_IRET_SANITY
156 " CONFIG_BEFORE_IRET_SANITY is on\n"
158 #ifdef CONFIG_FINE_GRAINED_CPUTIME
159 " CONFIG_FINE_GRAINED_CPUTIME is on\n"
161 #ifdef CONFIG_JDB_ACCOUNTING
162 " CONFIG_JDB_ACCOUNTING is on\n"
166 IMPLEMENT FIASCO_INIT
170 char const *cmdline = Cmdline::cmdline();
172 #ifdef CONFIG_WATCHDOG
173 if (strstr(cmdline, " -watchdog"))
180 if (strstr(cmdline, " -nohlt"))
181 hlt_works_ok = false;
183 if (strstr(cmdline, " -apic"))
186 if (scheduler_mode == SCHED_APIC)
190 #ifdef CONFIG_IO_PROT
192 KIP_KERNEL_FEATURE("io_prot");
196 IMPLEMENTATION[(ia32 | amd64) && pit_timer]:
198 unsigned Config::scheduler_irq_vector = 0x20U;
201 IMPLEMENTATION[(ia32 | amd64) && rtc_timer]:
203 unsigned Config::scheduler_irq_vector = 0x28U;
206 IMPLEMENTATION[(ia32 | amd64) && apic_timer]:
208 unsigned Config::scheduler_irq_vector = Config::Apic_timer_vector;
210 IMPLEMENTATION[(ia32 | amd64) && hpet_timer]:
212 unsigned Config::scheduler_irq_vector;