FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_kdb.h"
#include "opt_init_path.h"
#include "opt_verbose_sysinit.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/boottrace.h>
#include <sys/conf.h>
#include <sys/cpuset.h>
#include <sys/dtrace_bsd.h>
#include <sys/epoch.h>
#include <sys/eventhandler.h>
#include <sys/exec.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/imgact.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/loginclass.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/reboot.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
#include <sys/sx.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/unistd.h>
#include <sys/vmmeter.h>
#include <sys/vnode.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/vm_extern.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 | BOOTHOWTO 0 |
#define | BOOTVERBOSE 0 |
#define | INIT_SHUTDOWN_TIMEOUT 120 |
Functions | |
__FBSDID ("$FreeBSD$") | |
void | mi_startup (void) |
struct thread0_storage thread0_st | __aligned (32) |
int | linux_alloc_current_noop (struct thread *td __unused, int flags __unused) |
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) |
static void | null_set_syscall_retval (struct thread *td __unused, int error __unused) |
static void | null_set_fork_retval (struct thread *td __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) | |
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_MIDDLE, kick_init, NULL) | |
Variables | |
static struct session | session0 |
static struct pgrp | pgrp0 |
struct proc | proc0 |
struct vmspace | vmspace0 |
struct proc * | initproc |
int(* | lkpi_alloc_current )(struct thread *, int) = linux_alloc_current_noop |
int | boothowto = BOOTHOWTO |
int | bootverbose = 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 BOOTHOWTO 0 |
Definition at line 122 of file init_main.c.
#define BOOTVERBOSE 0 |
Definition at line 129 of file init_main.c.
#define INIT_SHUTDOWN_TIMEOUT 120 |
Definition at line 708 of file init_main.c.
struct thread0_storage thread0_st __aligned | ( | 32 | ) |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 808 of file init_main.c.
References crcopy(), crcowfree(), crcowget(), crfree(), crget(), fork1(), initproc, panic(), proc_set_cred(), proctree_lock, and start_init().
|
static |
Definition at line 853 of file init_main.c.
References initproc, and sched_add().
int linux_alloc_current_noop | ( | struct thread *td | __unused, |
int flags | __unused | ||
) |
Definition at line 115 of file init_main.c.
void mi_startup | ( | void | ) |
Definition at line 231 of file init_main.c.
References boothowto, bootverbose, data, free(), Giant, newsysinit, newsysinit_end, printf(), symbol_name(), sysinit, and sysinit_end.
|
static |
Definition at line 397 of file init_main.c.
References panic().
|
static |
Definition at line 411 of file init_main.c.
|
static |
Definition at line 404 of file init_main.c.
References panic().
|
static |
Definition at line 354 of file init_main.c.
References data, and printf().
|
static |
Definition at line 360 of file init_main.c.
References printf().
|
static |
Definition at line 458 of file init_main.c.
References allproc, callout_init(), chgproccnt(), cpuset_thread0(), crfree(), crget(), dfldsiz, dflssiz, fdinit(), kdtrace_proc_ctor(), kdtrace_thread_ctor(), knlist_alloc(), lim_alloc(), loginclass_find(), maxdsiz, maxfiles, maxproc, maxssiz, null_sysvec, pdinit(), pgrp0, prison0, prison0_init(), proc0, proc_set_cred_init(), procinit(), pstats_alloc(), schedinit(), session0, sigacts_alloc(), siginit(), thread_cow_get_proc(), thread_ctor(), thread_init(), threadinit(), tidhash_add(), uifind(), and vmspace0.
|
static |
Definition at line 646 of file init_main.c.
References allproc_lock, cpu_ticks, microuptime(), rufetch(), and ticks.
SET_DECLARE | ( | sysinit_set | , |
struct sysinit | |||
) |
|
static |
Definition at line 720 of file init_main.c.
References boothowto, bootverbose, exec_alloc_args(), exec_args_add_arg(), exec_args_add_fname(), exec_cleanup(), free(), freeenv(), init_path, kern_execve(), kern_getenv(), kern_unsetenv(), panic(), path, printf(), 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 | ( | announce | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_FIRST | , | ||
print_caddr_t | , | ||
copyright | |||
) |
SYSINIT | ( | init | , |
SI_SUB_CREATE_INIT | , | ||
SI_ORDER_FIRST | , | ||
create_init | , | ||
NULL | |||
) |
SYSINIT | ( | kickinit | , |
SI_SUB_KTHREAD_INIT | , | ||
SI_ORDER_MIDDLE | , | ||
kick_init | , | ||
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 | ( | placeholder | , |
SI_SUB_DUMMY | , | ||
SI_ORDER_ANY | , | ||
NULL | , | ||
NULL | |||
) |
SYSINIT | ( | trademark | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_SECOND | , | ||
print_caddr_t | , | ||
trademark | |||
) |
SYSINIT | ( | version | , |
SI_SUB_COPYRIGHT | , | ||
SI_ORDER_THIRD | , | ||
print_version | , | ||
NULL | |||
) |
Definition at line 171 of file init_main.c.
References count, free(), malloc(), newsysinit, newsysinit_end, panic(), set, sysinit, and sysinit_end.
Referenced by linker_preload().
int boothowto = BOOTHOWTO |
Definition at line 124 of file init_main.c.
Referenced by cninit(), mi_startup(), start_init(), and vfs_mountroot_conf0().
int bootverbose = BOOTVERBOSE |
Definition at line 131 of file init_main.c.
Referenced by clockcalib(), cpu_tick_calibrate(), devclass_alloc_unit(), device_attach(), device_probe(), et_register(), firmware_register(), ktls_alloc_thread(), ktls_init(), ktls_work_thread(), linker_preload(), loadimage(), maxbcachebuf_adjust(), mi_startup(), msgbuf_reinit(), parse_mount(), power_profile_set_state(), prison0_init(), read_clocks(), settime_task_func(), start_init(), tc_init(), tdq_setup(), and vntblinit().
|
static |
Definition at line 694 of file init_main.c.
Referenced by start_init().
|
static |
Definition at line 710 of file init_main.c.
struct proc* initproc |
Definition at line 112 of file init_main.c.
Referenced by create_init(), do_fork(), exit1(), kern_ptrace(), kern_reboot(), kern_reroot(), kick_init(), kproc_exit(), p_candebug(), reap_release(), reap_status(), reaper_abandon_children(), shutdown_nice(), shutdown_nice_task_fn(), and uprintf().
int(* lkpi_alloc_current) (struct thread *, int) | ( | struct thread * | , |
int | |||
) | = linux_alloc_current_noop |
Definition at line 119 of file init_main.c.
struct sysinit** newsysinit |
Definition at line 164 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct sysinit ** newsysinit_end |
Definition at line 164 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct sysentvec null_sysvec |
Definition at line 416 of file init_main.c.
Referenced by proc0_init().
|
static |
Definition at line 108 of file init_main.c.
Referenced by proc0_init().
struct proc proc0 |
Definition at line 109 of file init_main.c.
Referenced by do_fork(), dotrace(), kproc_create(), kthread_add(), mutex_init(), proc0_init(), proc_wkilled(), and wakeup().
|
static |
Definition at line 107 of file init_main.c.
Referenced by proc0_init().
struct sysinit** sysinit |
Definition at line 163 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 163 of file init_main.c.
Referenced by mi_startup(), and sysinit_add().
struct vmspace vmspace0 |
Definition at line 111 of file init_main.c.
Referenced by proc0_init().