Remove the need to list each and every cpu platform. Config will now

take your word for the 'machine' switch.
This commit is contained in:
Peter Wemm 2001-02-04 13:17:38 +00:00
parent fc2ffbe604
commit 3b10a240e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72000
4 changed files with 10 additions and 55 deletions

View File

@ -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.

View File

@ -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
= {

View File

@ -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);
}

View File

@ -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));