summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2001-12-21 21:54:56 +0000
committertmm <tmm@FreeBSD.org>2001-12-21 21:54:56 +0000
commit9c8c691fbfe4076adbe3fcb04d7b487bf6d01620 (patch)
treeaeb014db2e4857145a2ae37732a82134e4baebab /sys/isa
parentfe2f3a4e09e1db7afd528deaf26ef80c71e27ad7 (diff)
downloadFreeBSD-src-9c8c691fbfe4076adbe3fcb04d7b487bf6d01620.zip
FreeBSD-src-9c8c691fbfe4076adbe3fcb04d7b487bf6d01620.tar.gz
Use the new resource_list_print_type() function.
Pass the bus device to isa_init() (this is needed for the sparc64 version).
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/isa_common.c45
-rw-r--r--sys/isa/isa_common.h2
2 files changed, 6 insertions, 41 deletions
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index d5aee38..71409f0 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -92,7 +92,7 @@ static int
isa_probe(device_t dev)
{
device_set_desc(dev, "ISA bus");
- isa_init(); /* Allow machdep code to initialise */
+ isa_init(dev); /* Allow machdep code to initialise */
return 0;
}
@@ -634,37 +634,6 @@ isa_add_child(device_t dev, int order, const char *name, int unit)
}
static int
-isa_print_resources(struct resource_list *rl, const char *name, int type,
- int count, const char *format)
-{
- struct resource_list_entry *rle;
- int printed;
- int i, retval = 0;;
-
- printed = 0;
- for (i = 0; i < count; i++) {
- rle = resource_list_find(rl, type, i);
- if (rle) {
- if (printed == 0)
- retval += printf(" %s ", name);
- else if (printed > 0)
- retval += printf(",");
- printed++;
- retval += printf(format, rle->start);
- if (rle->count > 1) {
- retval += printf("-");
- retval += printf(format,
- rle->start + rle->count - 1);
- }
- } else if (i > 3) {
- /* check the first few regardless */
- break;
- }
- }
- return retval;
-}
-
-static int
isa_print_all_resources(device_t dev)
{
struct isa_device *idev = DEVTOISA(dev);
@@ -674,14 +643,10 @@ isa_print_all_resources(device_t dev)
if (SLIST_FIRST(rl) || device_get_flags(dev))
retval += printf(" at");
- retval += isa_print_resources(rl, "port", SYS_RES_IOPORT,
- ISA_NPORT, "%#lx");
- retval += isa_print_resources(rl, "iomem", SYS_RES_MEMORY,
- ISA_NMEM, "%#lx");
- retval += isa_print_resources(rl, "irq", SYS_RES_IRQ,
- ISA_NIRQ, "%ld");
- retval += isa_print_resources(rl, "drq", SYS_RES_DRQ,
- ISA_NDRQ, "%ld");
+ retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
+ retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
+ retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
+ retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld");
if (device_get_flags(dev))
retval += printf(" flags %#x", device_get_flags(dev));
diff --git a/sys/isa/isa_common.h b/sys/isa/isa_common.h
index a2f39f8..dc559ad 100644
--- a/sys/isa/isa_common.h
+++ b/sys/isa/isa_common.h
@@ -65,7 +65,7 @@ struct isa_device {
/*
* These functions are architecture dependant.
*/
-extern void isa_init(void);
+extern void isa_init(device_t dev);
extern struct resource *isa_alloc_resource(device_t bus, device_t child,
int type, int *rid,
u_long start, u_long end,
OpenPOWER on IntegriCloud