Add a kluge to ignore I/O and memory ranges with a size of zero, so we don't

blow up in bus_space_{map,unmap}().  At least one card uses this to `disable'
a logical device.
(XXX There's probably a better way to do this.)
This commit is contained in:
mycroft 1999-03-22 07:40:57 +00:00
parent ccbad3061c
commit fd400e0ddc
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: isapnp.c,v 1.31 1999/01/10 10:23:24 augustss Exp $ */
/* $NetBSD: isapnp.c,v 1.32 1999/03/22 07:40:57 mycroft Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -204,6 +204,9 @@ isapnp_free_region(t, r)
bus_space_tag_t t;
struct isapnp_region *r;
{
if (r->length == 0)
return;
#ifdef _KERNEL
bus_space_unmap(t, r->h, r->length);
#endif
@ -220,6 +223,11 @@ isapnp_alloc_region(t, r)
{
int error = 0;
if (r->length == 0) {
r->base = 0;
return 0;
}
for (r->base = r->minbase; r->base <= r->maxbase;
r->base += r->align) {
#ifdef _KERNEL