Changes in kernel/generic/src/main/main.c [9dae191e:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/main.c
r9dae191e r7a0359b 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 115 116 #ifdef CONFIG_SMP 116 117 static void main_ap_separated_stack(void); 117 118 #endif 118 119 119 #define CONFIG_STACK_SIZE 120 #define CONFIG_STACK_SIZE ((1 << STACK_FRAMES) * STACK_SIZE) 120 121 121 122 /** Main kernel routine for bootstrap CPU. … … 130 131 * 131 132 */ 132 void main_bsp(void)133 NO_TRACE void main_bsp(void) 133 134 { 134 135 config.cpu_count = 1; … … 151 152 init.tasks[i].size, config.stack_size); 152 153 } 153 154 154 155 /* Avoid placing stack on top of boot allocations. */ 155 156 if (ballocs.size) { … … 170 171 } 171 172 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. */ … … 183 183 version_print(); 184 184 185 LOG("\nconfig.base=% #" PRIp "config.kernel_size=%" PRIs186 "\nconfig.stack_base=% #" PRIp "config.stack_size=%" PRIs,185 LOG("\nconfig.base=%p config.kernel_size=%" PRIs 186 "\nconfig.stack_base=%p config.stack_size=%" PRIs, 187 187 config.base, config.kernel_size, config.stack_base, 188 188 config.stack_size); … … 194 194 * commands. 195 195 */ 196 LOG_EXEC(kconsole_init());196 kconsole_init(); 197 197 #endif 198 198 … … 201 201 * starts adding its own handlers 202 202 */ 203 LOG_EXEC(exc_init());203 exc_init(); 204 204 205 205 /* 206 206 * Memory management subsystems initialization. 207 207 */ 208 LOG_EXEC(arch_pre_mm_init());209 LOG_EXEC(frame_init());208 arch_pre_mm_init(); 209 frame_init(); 210 210 211 211 /* Initialize at least 1 memory segment big enough for slab to work. */ 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());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(); 223 223 224 224 /* Slab must be initialized after we know the number of processors. */ 225 LOG_EXEC(slab_enable_cpucache());225 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 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());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(); 239 239 240 240 if (init.cnt > 0) { 241 241 size_t i; 242 242 for (i = 0; i < init.cnt; i++) 243 LOG("init[%" PRIs "].addr=% #" PRIp ", init[%" PRIs244 "].size=% #" PRIs, i, init.tasks[i].addr, i,243 LOG("init[%" PRIs "].addr=%p, init[%" PRIs 244 "].size=%" PRIs, i, init.tasks[i].addr, i, 245 245 init.tasks[i].size); 246 246 } else 247 247 printf("No init binaries found.\n"); 248 248 249 LOG_EXEC(ipc_init());250 LOG_EXEC(event_init());251 LOG_EXEC(klog_init());252 LOG_EXEC(stats_init());249 ipc_init(); 250 event_init(); 251 klog_init(); 252 stats_init(); 253 253 254 254 /* … … 266 266 if (!kinit_thread) 267 267 panic("Cannot create kinit thread."); 268 LOG_EXEC(thread_ready(kinit_thread));268 thread_ready(kinit_thread); 269 269 270 270 /* … … 276 276 } 277 277 278 279 278 #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 329 328 /** Main kernel routine for application CPUs using new stack. 330 329 * … … 338 337 */ 339 338 timeout_init(); 340 339 341 340 waitq_wakeup(&ap_completion_wq, WAKEUP_FIRST); 342 341 scheduler(); 343 342 /* not reached */ 344 343 } 344 345 345 #endif /* CONFIG_SMP */ 346 346
Note:
See TracChangeset
for help on using the changeset viewer.