*************************************************************************** **** **** The two following SYSINIT's are proc0 specific glue code. I am not **** convinced that they can not be safely combined, but their order of **** operation has been maintained as the same as the original init_main.c **** for right now. **** **** These probably belong in init_proc.c or kern_proc.c, since the
| 344 | */ |
| 345 | /* ARGSUSED*/ |
| 346 | static void |
| 347 | proc0_init(void *dummy __unused) |
| 348 | { |
| 349 | struct proc *p; |
| 350 | struct thread *td; |
| 351 | |
| 352 | vm_paddr_t pageablemem; |
| 353 | int i; |
| 354 | |
| 355 | GIANT_REQUIRED; |
| 356 | |
| 357 | p = &proc0; |
| 358 | td = &thread0; |
| 359 | init_param1(); |
| 360 | init_param2(physmem); |
| 361 | |
| 362 | /* |
| 363 | * Initialize magic number and osrel. |
| 364 | */ |
| 365 | p->p_magic = P_MAGIC; |
| 366 | |
| 367 | #if 0 |
| 368 | p->p_osrel = osreldate; |
| 369 | |
| 370 | |
| 371 | /* |
| 372 | * Initialize thread and process structures. |
| 373 | */ |
| 374 | procinit(); /* set up proc zone */ |
| 375 | threadinit(); /* set up UMA zones */ |
| 376 | |
| 377 | /* |
| 378 | * Initialise scheduler resources. |
| 379 | * Add scheduler specific parts to proc, thread as needed. |
| 380 | */ |
| 381 | schedinit(); /* scheduler gets its house in order */ |
| 382 | /* |
| 383 | * Initialize sleep queue hash table |
| 384 | */ |
| 385 | sleepinit(); |
| 386 | |
| 387 | /* |
| 388 | * additional VM structures |
| 389 | */ |
| 390 | vm_init2(); |
| 391 | |
| 392 | /* |
| 393 | * Create process 0 (the swapper). |
| 394 | */ |
| 395 | LIST_INSERT_HEAD(&allproc, p, p_list); |
| 396 | LIST_INSERT_HEAD(PIDHASH(0), p, p_hash); |
| 397 | mtx_init(&pgrp0.pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK); |
| 398 | p->p_pgrp = &pgrp0; |
| 399 | LIST_INSERT_HEAD(PGRPHASH(0), &pgrp0, pg_hash); |
| 400 | LIST_INIT(&pgrp0.pg_members); |
| 401 | LIST_INSERT_HEAD(&pgrp0.pg_members, p, p_pglist); |
| 402 | |
| 403 | pgrp0.pg_session = &session0; |
nothing calls this directly
no test coverage detected