diff options
author | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-06-12 09:40:04 +0000 |
commit | bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a (patch) | |
tree | ddf23af998adfeb85fbbf912b89e3fa83f84fd4b /sys/pc98 | |
parent | b44fc46ed5521eb3028aafbc0c4aef220ed24141 (diff) | |
download | FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.zip FreeBSD-src-bbbe8875f0844bdf4e10cbc01dc9c7f2a2c8368a.tar.gz |
Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
inconvenient temporary ioconf table from config(). We already had a
fallback to using strings before malloc/vm was running anyway.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/fdc.c | 11 | ||||
-rw-r--r-- | sys/pc98/i386/machdep.c | 2 | ||||
-rw-r--r-- | sys/pc98/pc98/fd.c | 11 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 2 | ||||
-rw-r--r-- | sys/pc98/pc98/wd.c | 8 |
5 files changed, 16 insertions, 18 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 02e2b10..629d37a 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -1041,8 +1041,8 @@ static int fdc_attach(device_t dev) { struct fdc_data *fdc; - int i, error; - const char *name; + int i, error, dunit; + const char *name, *dname; fdc = device_get_softc(dev); error = fdc_alloc_resources(fdc); @@ -1082,10 +1082,9 @@ fdc_attach(device_t dev) * devices from the BIOS unless overridden. */ name = device_get_nameunit(dev); - i = -1; - while ((i = resource_query_string(i, "at", name)) != -1) - fdc_add_child(dev, resource_query_name(i), - resource_query_unit(i)); + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0) + fdc_add_child(dev, dname, dunit); return (bus_generic_attach(dev)); } diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 53fe789..a5b0c4a 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -49,7 +49,7 @@ #include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" -#include "opt_userconfig.h" +/* #include "opt_userconfig.h" */ #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 02e2b10..629d37a 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -1041,8 +1041,8 @@ static int fdc_attach(device_t dev) { struct fdc_data *fdc; - int i, error; - const char *name; + int i, error, dunit; + const char *name, *dname; fdc = device_get_softc(dev); error = fdc_alloc_resources(fdc); @@ -1082,10 +1082,9 @@ fdc_attach(device_t dev) * devices from the BIOS unless overridden. */ name = device_get_nameunit(dev); - i = -1; - while ((i = resource_query_string(i, "at", name)) != -1) - fdc_add_child(dev, resource_query_name(i), - resource_query_unit(i)); + i = 0; + while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0) + fdc_add_child(dev, dname, dunit); return (bus_generic_attach(dev)); } diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 53fe789..a5b0c4a 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -49,7 +49,7 @@ #include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" -#include "opt_userconfig.h" +/* #include "opt_userconfig.h" */ #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index 5779d39..1c07bf1 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -471,6 +471,7 @@ wdattach(struct isa_device *dvp) struct softc *du; struct wdparams *wp; static char buf[] = "wdcXXX"; + const char *dname; dvp->id_intr = wdintr; @@ -486,13 +487,12 @@ wdattach(struct isa_device *dvp) bioq_init(&wdtab[dvp->id_unit].controller_queue); sprintf(buf, "wdc%d", dvp->id_unit); - i = -1; - while ((i = resource_query_string(i, "at", buf)) != -1) { - if (strcmp(resource_query_name(i), "wd")) + i = 0; + while ((resource_find_match(&i, &dname, &lunit, "at", buf)) == 0) { + if (strcmp(dname, "wd")) /* Avoid a bit of foot shooting. */ continue; - lunit = resource_query_unit(i); if (lunit >= NWD) continue; #ifdef PC98 |