diff options
author | tmm <tmm@FreeBSD.org> | 2001-12-21 21:54:56 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2001-12-21 21:54:56 +0000 |
commit | 9c8c691fbfe4076adbe3fcb04d7b487bf6d01620 (patch) | |
tree | aeb014db2e4857145a2ae37732a82134e4baebab /sys | |
parent | fe2f3a4e09e1db7afd528deaf26ef80c71e27ad7 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/alpha/isa/isa.c | 2 | ||||
-rw-r--r-- | sys/amd64/isa/isa.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/isa.c | 2 | ||||
-rw-r--r-- | sys/ia64/isa/isa.c | 2 | ||||
-rw-r--r-- | sys/isa/isa_common.c | 45 | ||||
-rw-r--r-- | sys/isa/isa_common.h | 2 |
6 files changed, 10 insertions, 45 deletions
diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c index 694f4c1..00c0ee9 100644 --- a/sys/alpha/isa/isa.c +++ b/sys/alpha/isa/isa.c @@ -98,7 +98,7 @@ isa_irq_mask(void) } void -isa_init(void) +isa_init(device_t dev) { isa_init_intr(); } diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index 4888029..87c9036 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -68,7 +68,7 @@ #include <isa/isa_common.h> void -isa_init(void) +isa_init(device_t dev) { } diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index 4888029..87c9036 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -68,7 +68,7 @@ #include <isa/isa_common.h> void -isa_init(void) +isa_init(device_t dev) { } diff --git a/sys/ia64/isa/isa.c b/sys/ia64/isa/isa.c index 8ac1516..b171a60 100644 --- a/sys/ia64/isa/isa.c +++ b/sys/ia64/isa/isa.c @@ -69,7 +69,7 @@ #include <isa/isa_common.h> void -isa_init(void) +isa_init(device_t dev) { } 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, |