diff options
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/config.h | 6 | ||||
-rw-r--r-- | usr.sbin/config/config.y | 18 | ||||
-rw-r--r-- | usr.sbin/config/main.c | 11 | ||||
-rw-r--r-- | usr.sbin/config/mkoptions.c | 30 |
4 files changed, 10 insertions, 55 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 3542349..76a1d25 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -94,13 +94,7 @@ struct config { * it will build from ``Makefile.i386'' and use ``../i386/inline'' * in the makerules, etc. */ -int machine; char *machinename; -#define MACHINE_I386 1 -#define MACHINE_PC98 2 -#define MACHINE_ALPHA 3 -#define MACHINE_IA64 4 -#define MACHINE_POWERPC 5 /* * For each machine, a set of CPU's may be specified as supported. diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 5fe6ff6..52f77c0 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -121,23 +121,7 @@ Spec: Config_spec: ARCH Save_id = { - if (!strcmp($2, "i386")) { - machine = MACHINE_I386; - machinename = "i386"; - } else if (!strcmp($2, "pc98")) { - machine = MACHINE_PC98; - machinename = "pc98"; - } else if (!strcmp($2, "alpha")) { - machine = MACHINE_ALPHA; - machinename = "alpha"; - } else if (!strcmp($2, "ia64")) { - machine = MACHINE_IA64; - machinename = "ia64"; - } else if (!strcmp($2, "powerpc")) { - machine = MACHINE_POWERPC; - machinename = "powerpc"; - } else - yyerror("Unknown machine type"); + machinename = $2; } | CPU Save_id = { diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index 32be90d..acc5647 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -146,16 +146,7 @@ main(int argc, char **argv) dtab = NULL; if (yyparse()) exit(3); - switch (machine) { - - case MACHINE_I386: - case MACHINE_PC98: - case MACHINE_ALPHA: - case MACHINE_IA64: - case MACHINE_POWERPC: - break; - - default: + if (machinename == NULL) { printf("Specify machine type, e.g. ``machine i386''\n"); exit(1); } diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c index 2bc64a6..5ff8c54 100644 --- a/usr.sbin/config/mkoptions.c +++ b/usr.sbin/config/mkoptions.c @@ -56,14 +56,7 @@ static struct users { int u_default; int u_min; int u_max; -} users[] = { - { 8, 2, 512 }, /* MACHINE_I386 */ - { 8, 2, 512 }, /* MACHINE_PC98 */ - { 8, 2, 512 }, /* MACHINE_ALPHA */ - { 8, 2, 512 }, /* MACHINE_IA64 */ - { 8, 2, 512 }, /* MACHINE_POWERPC */ -}; -#define NUSERS (sizeof (users) / sizeof (users[0])) +} users= { 8, 2, 512 }; static char *lower(char *); static void read_options(void); @@ -77,7 +70,6 @@ options(void) struct cputype *cp; struct opt_list *ol; struct opt *op; - struct users *up; /* Fake the cpu types as options. */ for (cp = cputype; cp != NULL; cp = cp->cpu_next) { @@ -88,20 +80,14 @@ options(void) opt = op; } - /* Initialize `maxusers'. */ - if ((unsigned)machine > NUSERS) { - printf("maxusers config info isn't present, using i386\n"); - up = &users[MACHINE_I386 - 1]; - } else - up = &users[machine - 1]; if (maxusers == 0) { - printf("maxusers not specified; %d assumed\n", up->u_default); - maxusers = up->u_default; - } else if (maxusers < up->u_min) { - printf("minimum of %d maxusers assumed\n", up->u_min); - maxusers = up->u_min; - } else if (maxusers > up->u_max) - printf("warning: maxusers > %d (%d)\n", up->u_max, maxusers); + printf("maxusers not specified; %d assumed\n", users.u_default); + maxusers = users.u_default; + } else if (maxusers < users.u_min) { + printf("minimum of %d maxusers assumed\n", users.u_min); + maxusers = users.u_min; + } else if (maxusers > users.u_max) + printf("warning: maxusers > %d (%d)\n", users.u_max, maxusers); /* Fake MAXUSERS as an option. */ op = (struct opt *)malloc(sizeof(*op)); |