From 7499b6c1c74057921b76cf9fb0fe8ba4285d2700 Mon Sep 17 00:00:00 2001 From: jkh Date: Thu, 11 May 1995 02:21:34 +0000 Subject: Add a new `conflicts' flag for telling when a device is in conflict with others. The flag can be put in descriptive locations, e.g.: device sb0 at isa? port 0x220 irq 7 conflicts drq 1 vector sbintr or device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr But is nonetheless boolean only. You can't turn conflict checking off for only a given type of conflict. I didn't deem it worth the trouble at this stage, and it's far better than the ALLOW_CONFLICT_* that preceeded it. --- usr.sbin/config/config.h | 1 + usr.sbin/config/config.y | 6 +++++- usr.sbin/config/lang.l | 1 + usr.sbin/config/mkioconf.c | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'usr.sbin/config') diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 15adc3a..d6efbf7 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -121,6 +121,7 @@ struct device { #define UNKNOWN -2 /* -2 means not set yet */ int d_dk; /* if init 1 set to number for iostat */ int d_flags; /* flags for device init */ + int d_conflicts; /* I'm allowed to conflict */ char *d_port; /* io port base manifest constant */ int d_portn; /* io port base (if number not manifest) */ char *d_mask; /* interrupt mask */ diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 3e1dc9f..76e9a50 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -12,6 +12,7 @@ %token BIO %token COMMA %token CONFIG +%token CONFLICTS %token CONTROLLER %token CPU %token CSR @@ -633,7 +634,9 @@ Info: NET = { cur.d_mask = "net"; } | FLAGS NUMBER - = { cur.d_flags = $2; }; + = { cur.d_flags = $2; } | + CONFLICTS + = { cur.d_conflicts = 1; }; Int_spec: VECTOR Id_list @@ -909,6 +912,7 @@ init_dev(dp) dp->d_name = "OHNO!!!"; dp->d_type = DEVICE; dp->d_conn = 0; + dp->d_conflicts = 0; dp->d_vec = 0; dp->d_addr = dp->d_flags = dp->d_dk = 0; dp->d_pri = -1; diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index bc18bbf..e4c65a1 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -54,6 +54,7 @@ struct kt { { "at", AT }, #if MACHINE_I386 { "bio", BIO }, + { "conflicts", CONFLICTS }, #endif MACHINE_I386 { "config", CONFIG }, { "controller", CONTROLLER }, diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c index 0f2af8a..3866124 100644 --- a/usr.sbin/config/mkioconf.c +++ b/usr.sbin/config/mkioconf.c @@ -717,7 +717,7 @@ isa_devtab(fp, table, dev_idp) fprintf(fp, "\n\nstruct isa_device isa_devtab_%s[] = {\n", table); fprintf(fp, "\ -/* id driver iobase irq drq maddr msiz intr unit flags */\n"); +/* id driver iobase irq drq maddr msiz intr unit flags conflicts */\n"); for (dp = dtab; dp != 0; dp = dp->d_next) { if (dp->d_unit == QUES || !eq(dp->d_mask, table)) continue; @@ -729,10 +729,10 @@ isa_devtab(fp, table, dev_idp) fprintf(fp, " %8s,", dp->d_port); else fprintf(fp, " 0x%04x,", dp->d_portn); - fprintf(fp, "%6s, %2d, C 0x%05X, %5d, %8s, %2d, 0x%04X, 0, 0, 0, 0, 1 },\n", + fprintf(fp, "%6s, %2d, C 0x%05X, %5d, %8s, %2d, 0x%04X, %2d, 0, 0, 0, 0, 1 },\n", sirq(dp->d_irq), dp->d_drq, dp->d_maddr, dp->d_msize, shandler(dp), dp->d_unit, - dp->d_flags); + dp->d_flags, dp->d_conflicts); } fprintf(fp, "0\n};\n"); } -- cgit v1.1