Use the new resource_list_print_type() function.

Pass the bus device to isa_init() (this is needed for the sparc64
version).
This commit is contained in:
tmm 2001-12-21 21:54:56 +00:00
parent 2c2912c0f7
commit 75b7f8ff07
6 changed files with 10 additions and 45 deletions

View File

@ -98,7 +98,7 @@ isa_irq_mask(void)
}
void
isa_init(void)
isa_init(device_t dev)
{
isa_init_intr();
}

View File

@ -68,7 +68,7 @@
#include <isa/isa_common.h>
void
isa_init(void)
isa_init(device_t dev)
{
}

View File

@ -68,7 +68,7 @@
#include <isa/isa_common.h>
void
isa_init(void)
isa_init(device_t dev)
{
}

View File

@ -69,7 +69,7 @@
#include <isa/isa_common.h>
void
isa_init(void)
isa_init(device_t dev)
{
}

View File

@ -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;
}
@ -633,37 +633,6 @@ isa_add_child(device_t dev, int order, const char *name, int unit)
return child;
}
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)
{
@ -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));

View File

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