* Initialize mips and configure to run kernel */
| 278 | * Initialize mips and configure to run kernel |
| 279 | */ |
| 280 | void |
| 281 | mips_proc0_init(void) |
| 282 | { |
| 283 | #ifdef SMP |
| 284 | if (platform_processor_id() != 0) |
| 285 | panic("BSP must be processor number 0"); |
| 286 | #endif |
| 287 | proc_linkup0(&proc0, &thread0); |
| 288 | |
| 289 | KASSERT((kstack0 & PAGE_MASK) == 0, |
| 290 | ("kstack0 is not aligned on a page boundary: 0x%0lx", |
| 291 | (long)kstack0)); |
| 292 | thread0.td_kstack = kstack0; |
| 293 | thread0.td_kstack_pages = KSTACK_PAGES; |
| 294 | /* |
| 295 | * Do not use cpu_thread_alloc to initialize these fields |
| 296 | * thread0 is the only thread that has kstack located in KSEG0 |
| 297 | * while cpu_thread_alloc handles kstack allocated in KSEG2. |
| 298 | */ |
| 299 | thread0.td_pcb = (struct pcb *)(thread0.td_kstack + |
| 300 | thread0.td_kstack_pages * PAGE_SIZE) - 1; |
| 301 | thread0.td_frame = &thread0.td_pcb->pcb_regs; |
| 302 | |
| 303 | /* Steal memory for the dynamic per-cpu area. */ |
| 304 | dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); |
| 305 | |
| 306 | PCPU_SET(curpcb, thread0.td_pcb); |
| 307 | /* |
| 308 | * There is no need to initialize md_upte array for thread0 as it's |
| 309 | * located in .bss section and should be explicitly zeroed during |
| 310 | * kernel initialization. |
| 311 | */ |
| 312 | } |
| 313 | |
| 314 | void |
| 315 | cpu_initclocks(void) |
no test coverage detected