MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mips_proc0_init

Function mips_proc0_init

freebsd/mips/mips/machdep.c:280–312  ·  view source on GitHub ↗

* Initialize mips and configure to run kernel */

Source from the content-addressed store, hash-verified

278 * Initialize mips and configure to run kernel
279 */
280void
281mips_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
314void
315cpu_initclocks(void)

Callers 9

mips_initFunction · 0.85
platform_startFunction · 0.85
platform_startFunction · 0.85
platform_startFunction · 0.85
mips_initFunction · 0.85
mips_initFunction · 0.85
mips_initFunction · 0.85
mips_initFunction · 0.85
mips_initFunction · 0.85

Calls 5

proc_linkup0Function · 0.85
dpcpu_initFunction · 0.85
pmap_steal_memoryFunction · 0.85
platform_processor_idFunction · 0.50
panicFunction · 0.50

Tested by

no test coverage detected