modsysfile.c revision 986fd29a0dc13f7608ef7f508f6e700bd7bc2720
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A#if defined(_PSM_MODULES)
2N/A char *m_machname;
2N/A#if defined(_RTC_CONFIG)
2N/A * driver.conf parse thread control structure
2N/Astruct hwc_parse_mt {
2N/A ddi_prop_t **);
2N/Astatic void check_system_file(void);
2N/Astatic char *sysparam_type_to_str(int);
2N/Astatic int parse_debug_on = 0;
2N/A if (parse_debug_on) {
#ifdef DEBUG
char *tokennames[] = {
char *cp;
switch (ch) {
if (--remain == 0) {
goto out;
remain++;
cp--;
badquote = 0;
switch (ch) {
if (--remain == 0) {
goto out;
oval = 0;
if (--remain == 0) {
goto out;
if (--remain == 0) {
goto out;
remain++;
cp--;
if (--remain == 0) {
goto out;
if (--remain == 0) {
goto out;
if (--remain == 0) {
goto out;
goto digit;
if (--remain == 0) {
goto out;
remain++;
cp--;
if (--remain == 0) {
goto out;
out:
#ifdef DEBUG
return (token);
int ch;
static struct sysparam *
char *cp;
int ch;
VM_SLEEP);
case MOD_INCLUDE:
case MOD_EXCLUDE:
case MOD_FORCELOAD:
case MOD_ROOTFS:
case MOD_SWAPFS:
goto bad;
goto bad;
return (NULL);
VM_SLEEP);
case MOD_SET:
case MOD_SET64:
case MOD_SET32:
char *var;
goto bad;
goto bad;
VM_SLEEP);
switch (op) {
case EQUALS:
case AMPERSAND:
case BIT_OR:
goto bad;
case STRING:
goto bad;
goto bad;
case HEXVAL:
case DECVAL:
goto bad;
goto bad;
#ifdef _LP64
return (NULL);
return (NULL);
case MOD_MODDIR:
goto bad;
goto bad;
goto bad;
cp--;
VM_SLEEP);
case MOD_SWAPDEV:
case MOD_ROOTDEV:
goto bad;
goto bad;
VM_SLEEP);
case MOD_UNKNOWN:
goto bad;
return (sysp);
bad:
return (NULL);
if (ask)
switch (token) {
case STAR:
case POUND:
case NEWLINE:
case NAME:
param_preset();
param_check();
if (ask == 0)
setparams();
check_system_file(void)
case MOD_ROOTDEV:
case MOD_ROOTFS:
case MOD_SWAPDEV:
case MOD_SWAPFS:
case MOD_MODDIR:
case SETOP_ASSIGN:
(*cnt)++;
case SETOP_AND:
case SETOP_OR:
(*cnt)++;
switch (type) {
case MOD_ROOTDEV:
case MOD_ROOTFS:
case MOD_SWAPDEV:
case MOD_SWAPFS:
case MOD_MODDIR:
char *name;
switch (fcn) {
case SYS_FORCELOAD:
case SYS_SET_KVAR:
case SYS_SET_MVAR:
case SYS_CHECK_EXCLUDE:
int err;
return (err);
int size;
switch (size) {
case SETOP_ASSIGN:
case SETOP_AND:
case SETOP_OR:
case SETOP_ASSIGN:
case SETOP_AND:
case SETOP_OR:
case SETOP_ASSIGN:
case SETOP_AND:
case SETOP_OR:
case SETOP_ASSIGN:
case SETOP_AND:
case SETOP_OR:
char *cp;
char *start = (char *)0;
int len = 0;
len--;
len--;
len--;
int radix;
int onescompl = 0;
int negate = 0;
token++;
negate++;
token++;
token++;
c = *token;
token++;
while ((c = *token++)) {
switch (radix) {
if (onescompl)
if (negate)
case MOD_ROOTDEV:
case MOD_SWAPDEV:
case MOD_ROOTFS:
case MOD_SWAPFS:
char *name;
while (list) {
struct val_list {
} val_type;
int val_size;
char *string;
int integer;
} val;
static struct val_list *
#ifdef DEBUG
return (new_val);
for (i = 0; i < len; i++) {
char **valsp;
int *valip;
#ifdef DEBUG
if (val) {
propcnt++;
while (vl) {
#ifdef DEBUG
valip++;
while (vl) {
#ifdef DEBUG
valsp++;
!= DDI_PROP_SUCCESS) {
#ifdef DEBUG
!= DDI_PROP_SUCCESS) {
} hwc_state_t;
static struct hwc_spec *
char *prop_name;
#ifdef DEBUG
switch (token) {
case NAME:
switch (state) {
case prop:
case prop_equals_string:
case prop_equals_integer:
if (prop_name) {
if (val_list) {
case hwc_begin:
case EQUALS:
switch (state) {
case drvname:
case parent:
case drvclass:
case prop:
case STRING:
switch (state) {
case name_equals:
goto bad;
KM_SLEEP);
case parent_equals:
goto bad;
case drvclass_equals:
goto bad;
case prop_equals:
case prop_equals_string_comma:
tokbuf);
case HEXVAL:
case DECVAL:
switch (state) {
case prop_equals:
case COMMA:
switch (state) {
case prop_equals_string:
case prop_equals_integer:
case NEWLINE:
case POUND:
case EOF:
goto bad;
goto bad;
switch (state) {
case prop:
case prop_equals_string:
case prop_equals_integer:
case hwc_begin:
if (prop_name)
if (val_list)
return (hwcp);
bad:
if (prop_name)
if (val_list)
return (NULL);
* This is the primary kernel interface to parse driver.conf files.
int ret;
return (ret);
thread_exit();
static struct hwc_parse_mt *
return (pltp);
char *tokval;
switch (token) {
case POUND:
case NAME:
case NEWLINE:
} state;
int done = 0;
while (!done) {
switch (token) {
case POUND:
case NAME:
case STRING:
switch (state) {
case AL_NEW:
case AL_DRVNAME_COMMA:
case AL_ALIAS_COMMA:
case AL_DRVNAME:
case AL_ALIAS:
case COMMA:
switch (state) {
case AL_DRVNAME:
case AL_ALIAS:
case EOF:
case NEWLINE:
* - /etc/path_to_inst
* - /etc/name_to_major
* - /etc/name_to_sysnum
} state;
int maxnum = 0;
int done = 0;
while (!done) {
switch (token) {
case POUND:
case NAME:
case STRING:
switch (state) {
case B_NEW:
case B_VAL:
KM_SLEEP);
case HEXVAL:
case DECVAL:
case EOF:
case NEWLINE:
hashtab) == 0)
if (name) {
if (bind_name) {
return (maxnum);
* The syntax of a line in the dacf.conf file is:
char *fname;
int done = 0;
static char w_dupargs[] =
return (ENOENT);
while (!done) {
switch (token) {
case EQUALS:
switch (state) {
case DACF_NT_SPEC:
case DACF_OPARG_SPEC:
case NAME:
switch (state) {
case DACF_BEGIN:
case DACF_NT_DATA:
sizeof (mn_modname_buf));
case DACF_MN_MODNAME:
sizeof (mn_opset_buf));
tokbuf);
case DACF_MN_COLON:
sizeof (mn_opset_buf));
case DACF_MN_OPSET:
tokbuf);
case DACF_OP_NAME:
case DACF_OPT_COMMA:
tokbuf);
case DACF_OPT_END:
case DACF_OPT_OPTION:
case DACF_OPARG_DATA:
sizeof (arg_spec_buf));
case DACF_OPARG_EQUALS:
tokbuf) != 0) {
case STRING:
switch (state) {
case DACF_NT_EQUALS:
sizeof (nt_data_buf));
case DACF_OPARG_EQUALS:
tokbuf) != 0) {
case COMMA:
switch (state) {
case DACF_OPT_OPTION:
case COLON:
case EOF:
case NEWLINE:
opts = 0;
* If exporter's major is not registered in /etc/name_to_major,
if (buf)
read_class_file(void)
} state;
int done = 0;
while (!done) {
switch (token) {
case POUND:
case NAME:
case STRING:
switch (state) {
case C_BEGIN:
case C_EXPORTER:
case C_END:
case EOF:
case NEWLINE:
if (exporter)
if (class)
int nmajor = 0;
extern int devcnt;
nmajor++;
nmajor++;
return (nmajor);
while (pl) {
while (hp) {
#if defined(_PSM_MODULES)
open_mach_list(void)
switch (token) {
case POUND:
case NAME:
case STRING:
case NEWLINE:
if (machp)
if (machp)
return (machp);
close_mach_list(void)
while (pmach_head) {
#if defined(_RTC_CONFIG)
process_rtc_config_file(void)
} state;
long zone_lag = 0;
int done = 0;
while (!done) {
switch (token) {
case POUND:
case NAME:
case STRING:
case EQUALS:
case DECVAL:
tokbuf);
case EOF:
case NEWLINE:
return (zone_lag);
static major_t
return (major);
if (tmp)
return (major);
if (parent) {
parent);
while (*props)