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

Function proc0_init

lib/ff_init_main.c:346–524  ·  view source on GitHub ↗

*************************************************************************** **** **** 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

Source from the content-addressed store, hash-verified

344 */
345/* ARGSUSED*/
346static void
347proc0_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;

Callers

nothing calls this directly

Calls 15

init_param1Function · 0.85
init_param2Function · 0.85
threadinitFunction · 0.85
sleepinitFunction · 0.85
mtx_initFunction · 0.85
refcount_initFunction · 0.85
knlist_allocFunction · 0.85
cpuset_thread0Function · 0.85
cpuset_refFunction · 0.85
strncpyFunction · 0.85
audit_cred_kproc0Function · 0.85
mac_cred_create_swapperFunction · 0.85

Tested by

no test coverage detected