FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_init_path.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/exec.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/jail.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/loginclass.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/systm.h>
#include <sys/signalvar.h>
#include <sys/vnode.h>
#include <sys/sysent.h>
#include <sys/reboot.h>
#include <sys/sched.h>
#include <sys/sx.h>
#include <sys/sysproto.h>
#include <sys/vmmeter.h>
#include <sys/unistd.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/cpuset.h>
#include <machine/cpu.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <sys/copyright.h>
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
Go to the source code of this file.
Macros | |
#define | INIT_SHUTDOWN_TIMEOUT 120 |
Functions | |
__FBSDID ("$BSDSUniX$") | |
void | mi_startup (void) |
struct thread thread0 | __aligned (16) |
SYSCTL_INT (_debug, OID_AUTO, boothowto, CTLFLAG_RD,&boothowto, 0,"Boot control flags, passed from loader") | |
SYSCTL_INT (_debug, OID_AUTO, bootverbose, CTLFLAG_RW,&bootverbose, 0,"Control the output of verbose kernel messages") | |
SYSINIT (placeholder, SI_SUB_DUMMY, SI_ORDER_ANY, NULL, NULL) | |
SET_DECLARE (sysinit_set, struct sysinit) | |
void | sysinit_add (struct sysinit **set, struct sysinit **set_end) |
static void | print_caddr_t (void *data) |
static void | print_version (void *data __unused) |
SYSINIT (announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright) | |
SYSINIT (trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, trademark) | |
SYSINIT (version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL) | |
static int | null_fetch_syscall_args (struct thread *td __unused, struct syscall_args *sa __unused) |
static void | null_set_syscall_retval (struct thread *td __unused, int error __unused) |
static void | proc0_init (void *dummy __unused) |
SYSINIT (p0init, SI_SUB_INTRINSIC, SI_ORDER_FIRST, proc0_init, NULL) | |
static void | proc0_post (void *dummy __unused) |
SYSINIT (p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL) | |
static void | random_init (void *dummy __unused) |
SYSINIT (random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL) | |
SYSCTL_STRING (_kern, OID_AUTO, init_path, CTLFLAG_RD, init_path, 0,"Path used to search the init process") | |
SYSCTL_INT (_kern, OID_AUTO, init_shutdown_timeout, CTLFLAG_RW,&init_shutdown_timeout, 0,"Shutdown timeout of init(8). ""Unused within kernel, but used to control init(8)") | |
static void | start_init (void *dummy) |
static void | create_init (const void *udata __unused) |
SYSINIT (init, SI_SUB_CREATE_INIT, SI_ORDER_FIRST, create_init, NULL) | |
static void | kick_init (const void *udata __unused) |
SYSINIT (kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, kick_init, NULL) | |
Variables | |
static struct session | session0 |
static struct pgrp | pgrp0 |
struct proc | proc0 |
struct vmspace | vmspace0 |
struct proc * | initproc |
int | boothowto = 0 |
int | bootverbose |
struct sysinit ** | sysinit |
struct sysinit ** | sysinit_end |
struct sysinit ** | newsysinit |
struct sysinit ** | newsysinit_end |
struct sysentvec | null_sysvec |
static char | init_path [MAXPATHLEN] |
static int | init_shutdown_timeout = INIT_SHUTDOWN_TIMEOUT |
#define INIT_SHUTDOWN_TIMEOUT 120 |
Definition at line 679 of file init_main.c.
struct thread thread0 __aligned | ( | 16 | ) |
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 813 of file init_main.c.
References crcopy(), cred_update_thread(), crfree(), crget(), fork1(), initproc, panic(), and start_init().
|
static |
Definition at line 847 of file init_main.c.
References initproc, and sched_add().
void mi_startup | ( | void | ) |
Definition at line 191 of file init_main.c.
References boothowto, bootverbose, free(), Giant, newsysinit, newsysinit_end, printf(), symbol_name(), sysinit, and sysinit_end.
|
static |
Definition at line 359 of file init_main.c.
References panic().
|
static |
Definition at line 367 of file init_main.c.
References panic().
|
static |
Definition at line 316 of file init_main.c.
References printf().
|
static |
Definition at line 322 of file init_main.c.
References printf().
|
static |
Definition at line 423 of file init_main.c.
References allproc, callout_init(), chgproccnt(), cpuset_ref(), cpuset_thread0(), crget(), crhold(), dfldsiz, dflssiz, fdinit(), knlist_init_mtx(), lim_alloc(), loginclass_find(), maxdsiz, maxfiles, maxproc, maxssiz, mtx_init(), null_sysvec, pgrp0, prison0, proc0, procinit(), pstats_alloc(), racct_add_force(), racct_create(), schedinit(), session0, sigacts_alloc(), siginit(), sleepinit(), thread_ctor(), thread_init(), threadinit(), uifind(), and vmspace0.
|
static |
Definition at line 593 of file init_main.c.
References allproc_lock, cpu_ticks, microuptime(), nanotime(), rufetch(), and ticks.
|
static |
Definition at line 631 of file init_main.c.
SET_DECLARE | ( | sysinit_set | , |
struct sysinit | |||
) |
|
static |
Definition at line 691 of file init_main.c.
References execve_args::argv, boothowto, bootverbose, execve_args::envv, execve_args::fname, freeenv(), getenv(), Giant, panic(), path, printf(), suword, sys_execve(), ucp, and vfs_mountroot().
Referenced by create_init().
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
boothowto | , | ||
CTLFLAG_RD | , | ||
& | boothowto, | ||
0 | , | ||
"Boot control | flags, | ||
passed from loader" | |||
) |
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
bootverbose | , | ||
CTLFLAG_RW | , | ||
& | bootverbose, | ||
0 | , | ||
"Control the output of verbose kernel messages" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
init_shutdown_timeout | , | ||
CTLFLAG_RW | , | ||
& | init_shutdown_timeout, | ||
0 | , | ||
"Shutdown timeout of init(8). ""Unused within | kernel, | ||
but used to control init(8)" | |||
) |
SYSCTL_STRING | ( | _kern | , |
OID_AUTO | , | ||
init_path | , | ||
CTLFLAG_RD | , | ||
init_path | , | ||
0 | , | ||
"Path used to search the init process" | |||
) |
SYSINIT | ( | placeholder | , |
SI_SUB_DUMMY | , | ||
SI_ORDER_ANY | , | ||
NULL | , | ||
NULL | |||
) |
SYSINIT | ( | announce | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_FIRST | , | ||
print_caddr_t | , | ||
copyright | |||
) |
SYSINIT | ( | trademark | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_SECOND | , | ||
print_caddr_t | , | ||
trademark | |||
) |
SYSINIT | ( | version | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_THIRD | , | ||
print_version | , | ||
NULL | |||
) |
SYSINIT | ( | p0init | , |
SI_SUB_INTRINSIC | , | ||
SI_ORDER_FIRST | , | ||
proc0_init | , | ||
NULL | |||
) |
SYSINIT | ( | p0post | , |
SI_SUB_INTRINSIC_POST | , | ||
SI_ORDER_FIRST | , | ||
proc0_post | , | ||
NULL | |||
) |
SYSINIT | ( | random | , |
SI_SUB_RANDOM | , | ||
SI_ORDER_FIRST | , | ||
random_init | , | ||
NULL | |||
) |
SYSINIT | ( | init | , |
SI_SUB_CREATE_INIT | , | ||
SI_ORDER_FIRST | , | ||
create_init | , | ||
NULL | |||
) |
SYSINIT | ( | kickinit | , |
SI_SUB_KTHREAD_INIT | , | ||
SI_ORDER_FIRST | , | ||
kick_init | , | ||
NULL | |||
) |
Definition at line 131 of file init_main.c.
References count, free(), malloc(), newsysinit, newsysinit_end, panic(), set, sysinit, and sysinit_end.
Referenced by linker_preload().
int boothowto = 0 |
Definition at line 104 of file init_main.c.
Referenced by mi_startup(), STAILQ_HEAD(), start_init(), and vfs_mountroot_conf0().
int bootverbose |
Definition at line 107 of file init_main.c.
Referenced by clock_register(), cpu_tick_calibrate(), devclass_alloc_unit(), device_attach(), device_probe(), et_register(), firmware_register(), linker_preload(), mi_startup(), msgbuf_reinit(), power_profile_set_state(), start_init(), tc_init(), tdq_setup(), vfs_mountroot_shuffle(), and vntblinit().
|
static |
Definition at line 665 of file init_main.c.
|
static |
Definition at line 681 of file init_main.c.
struct proc* initproc |
Definition at line 102 of file init_main.c.
Referenced by create_init(), do_fork(), exit1(), kern_ptrace(), kick_init(), kproc_exit(), p_candebug(), proc_realparent(), and shutdown_nice().
struct sysinit** newsysinit |
Definition at line 124 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct sysinit ** newsysinit_end |
Definition at line 124 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct sysentvec null_sysvec |
Definition at line 373 of file init_main.c.
Referenced by proc0_init().
|
static |
Definition at line 98 of file init_main.c.
Referenced by proc0_init().
struct proc proc0 |
Definition at line 99 of file init_main.c.
Referenced by do_fork(), kproc_create(), kthread_add(), mutex_init(), proc0_init(), schedinit(), and wakeup().
|
static |
Definition at line 97 of file init_main.c.
Referenced by proc0_init().
struct sysinit** sysinit |
Definition at line 123 of file init_main.c.
Referenced by linker_file_sysinit(), linker_file_sysuninit(), linker_preload(), mi_startup(), and sysinit_add().
struct sysinit ** sysinit_end |
Definition at line 123 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct vmspace vmspace0 |
Definition at line 101 of file init_main.c.
Referenced by proc0_init().