Changes in kernel/generic/src/main/main.c [263bda2:9dae191e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/main.c
r263bda2 r9dae191e 104 104 105 105 /** Lowest safe stack virtual address. */ 106 uintptr_t stack_safe = 0; 106 uintptr_t stack_safe = 0; 107 107 108 108 /* … … 113 113 */ 114 114 static void main_bsp_separated_stack(void); 115 116 115 #ifdef CONFIG_SMP 117 116 static void main_ap_separated_stack(void); 118 117 #endif 119 118 120 #define CONFIG_STACK_SIZE 119 #define CONFIG_STACK_SIZE ((1 << STACK_FRAMES) * STACK_SIZE) 121 120 122 121 /** Main kernel routine for bootstrap CPU. … … 152 151 init.tasks[i].size, config.stack_size); 153 152 } 154 153 155 154 /* Avoid placing stack on top of boot allocations. */ 156 155 if (ballocs.size) { … … 171 170 } 172 171 172 173 173 /** Main kernel routine for bootstrap CPU using new stack. 174 174 * … … 176 176 * 177 177 */ 178 void main_bsp_separated_stack(void) 178 void main_bsp_separated_stack(void) 179 179 { 180 180 /* Keep this the first thing. */ … … 194 194 * commands. 195 195 */ 196 kconsole_init();196 LOG_EXEC(kconsole_init()); 197 197 #endif 198 198 … … 201 201 * starts adding its own handlers 202 202 */ 203 exc_init();203 LOG_EXEC(exc_init()); 204 204 205 205 /* 206 206 * Memory management subsystems initialization. 207 207 */ 208 arch_pre_mm_init();209 frame_init();208 LOG_EXEC(arch_pre_mm_init()); 209 LOG_EXEC(frame_init()); 210 210 211 211 /* Initialize at least 1 memory segment big enough for slab to work. */ 212 slab_cache_init();213 sysinfo_init();214 btree_init();215 as_init();216 page_init();217 tlb_init();218 ddi_init();219 tasklet_init();220 arch_post_mm_init();221 arch_pre_smp_init();222 smp_init();212 LOG_EXEC(slab_cache_init()); 213 LOG_EXEC(sysinfo_init()); 214 LOG_EXEC(btree_init()); 215 LOG_EXEC(as_init()); 216 LOG_EXEC(page_init()); 217 LOG_EXEC(tlb_init()); 218 LOG_EXEC(ddi_init()); 219 LOG_EXEC(tasklet_init()); 220 LOG_EXEC(arch_post_mm_init()); 221 LOG_EXEC(arch_pre_smp_init()); 222 LOG_EXEC(smp_init()); 223 223 224 224 /* Slab must be initialized after we know the number of processors. */ 225 slab_enable_cpucache();225 LOG_EXEC(slab_enable_cpucache()); 226 226 227 227 printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n", 228 228 config.cpu_count, SIZE2MB(zones_total_size())); 229 230 cpu_init();231 232 calibrate_delay_loop();233 clock_counter_init();234 timeout_init();235 scheduler_init();236 task_init();237 thread_init();238 futex_init();229 230 LOG_EXEC(cpu_init()); 231 232 LOG_EXEC(calibrate_delay_loop()); 233 LOG_EXEC(clock_counter_init()); 234 LOG_EXEC(timeout_init()); 235 LOG_EXEC(scheduler_init()); 236 LOG_EXEC(task_init()); 237 LOG_EXEC(thread_init()); 238 LOG_EXEC(futex_init()); 239 239 240 240 if (init.cnt > 0) { … … 247 247 printf("No init binaries found.\n"); 248 248 249 ipc_init();250 event_init();251 klog_init();252 stats_init();249 LOG_EXEC(ipc_init()); 250 LOG_EXEC(event_init()); 251 LOG_EXEC(klog_init()); 252 LOG_EXEC(stats_init()); 253 253 254 254 /* … … 266 266 if (!kinit_thread) 267 267 panic("Cannot create kinit thread."); 268 thread_ready(kinit_thread);268 LOG_EXEC(thread_ready(kinit_thread)); 269 269 270 270 /* … … 276 276 } 277 277 278 278 279 #ifdef CONFIG_SMP 279 280 280 /** Main kernel routine for application CPUs. 281 281 * … … 296 296 */ 297 297 config.cpu_active++; 298 298 299 299 /* 300 300 * The THE structure is well defined because ctx.sp is used as stack. … … 311 311 calibrate_delay_loop(); 312 312 arch_post_cpu_init(); 313 313 314 314 the_copy(THE, (the_t *) CPU->stack); 315 315 316 316 /* 317 317 * If we woke kmp up before we left the kernel stack, we could … … 326 326 } 327 327 328 328 329 /** Main kernel routine for application CPUs using new stack. 329 330 * … … 337 338 */ 338 339 timeout_init(); 339 340 340 341 waitq_wakeup(&ap_completion_wq, WAKEUP_FIRST); 341 342 scheduler(); 342 343 /* not reached */ 343 344 } 344 345 345 #endif /* CONFIG_SMP */ 346 346
Note:
See TracChangeset
for help on using the changeset viewer.