FreeBSD kernel kern code
subr_boot.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/reboot.h>
#include <sys/boot.h>
Include dependency graph for subr_boot.c:

Go to the source code of this file.

Macros

#define SETENV(k, v)   kern_setenv(k, v)
 
#define GETENV(k)   kern_getenv(k)
 
#define FREE(v)   freeenv(v)
 

Functions

 __FBSDID ("$FreeBSD$")
 
int boot_env_to_howto (void)
 convert the env vars in howto_names into a howto mask More...
 
void boot_howto_to_env (int howto)
 Set env vars from howto_names based on howto passed in. More...
 
int boot_parse_arg (char *v)
 Helper routine to parse a single arg and return its mask. More...
 
int boot_parse_cmdline_delim (char *cmdline, const char *delim)
 breakup the command line into args, and pass to boot_parse_arg More...
 
int boot_parse_cmdline (char *cmdline)
 Simplified interface for common 'space or tab separated' args. More...
 
int boot_parse_args (int argc, char *argv[])
 Pass a vector of strings to boot_parse_arg. More...
 

Variables

struct {
   const char *   ev
 
   int   mask
 
howto_names []
 

Macro Definition Documentation

◆ FREE

#define FREE (   v)    freeenv(v)

Definition at line 55 of file subr_boot.c.

◆ GETENV

#define GETENV (   k)    kern_getenv(k)

Definition at line 54 of file subr_boot.c.

◆ SETENV

#define SETENV (   k,
 
)    kern_setenv(k, v)

Definition at line 53 of file subr_boot.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ boot_env_to_howto()

int boot_env_to_howto ( void  )

convert the env vars in howto_names into a howto mask

Definition at line 93 of file subr_boot.c.

References ev, FREE, GETENV, and howto_names.

◆ boot_howto_to_env()

void boot_howto_to_env ( int  howto)

Set env vars from howto_names based on howto passed in.

Definition at line 111 of file subr_boot.c.

References ev, howto_names, mask, and SETENV.

◆ boot_parse_arg()

int boot_parse_arg ( char *  v)

Helper routine to parse a single arg and return its mask.

Parse all the - options to create a mask (or a serial speed in the case of -S). If the arg doesn't start with '-' assume it's an env variable and set that instead.

Definition at line 128 of file subr_boot.c.

References SETENV.

Referenced by boot_parse_args(), and boot_parse_cmdline_delim().

Here is the caller graph for this function:

◆ boot_parse_args()

int boot_parse_args ( int  argc,
char *  argv[] 
)

Pass a vector of strings to boot_parse_arg.

Definition at line 215 of file subr_boot.c.

References boot_parse_arg().

Here is the call graph for this function:

◆ boot_parse_cmdline()

int boot_parse_cmdline ( char *  cmdline)

Simplified interface for common 'space or tab separated' args.

Definition at line 205 of file subr_boot.c.

References boot_parse_cmdline_delim().

Here is the call graph for this function:

◆ boot_parse_cmdline_delim()

int boot_parse_cmdline_delim ( char *  cmdline,
const char *  delim 
)

breakup the command line into args, and pass to boot_parse_arg

Definition at line 187 of file subr_boot.c.

References boot_parse_arg().

Referenced by boot_parse_cmdline().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ev

◆ 

struct { ... } howto_names[]
Initial value:
= {
{ "boot_askname", RB_ASKNAME},
{ "boot_cdrom", RB_CDROM},
{ "boot_ddb", RB_KDB},
{ "boot_dfltroot", RB_DFLTROOT},
{ "boot_gdb", RB_GDB},
{ "boot_multicons", RB_MULTIPLE},
{ "boot_mute", RB_MUTE},
{ "boot_pause", RB_PAUSE},
{ "boot_serial", RB_SERIAL},
{ "boot_single", RB_SINGLE},
{ "boot_verbose", RB_VERBOSE},
{ NULL, 0}
}

Referenced by boot_env_to_howto(), and boot_howto_to_env().

◆ mask

int mask

Definition at line 65 of file subr_boot.c.

Referenced by boot_howto_to_env().