diff options
| author | mycroft <mycroft@NetBSD.org> | 1999-03-22 07:40:57 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1999-03-22 07:40:57 +0000 |
| commit | fd400e0ddcdc330c02c8cd4e2864584b7b415acc (patch) | |
| tree | 85362e2859bc219cbd133d7797aa51d1608b8438 | |
| parent | ccbad3061c53f857d87b9c4080d8a3b9e8620287 (diff) | |
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.)
| -rw-r--r-- | sys/dev/isapnp/isapnp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/isapnp/isapnp.c b/sys/dev/isapnp/isapnp.c index 8e256dfad7e..17dabbd11b8 100644 --- a/sys/dev/isapnp/isapnp.c +++ b/sys/dev/isapnp/isapnp.c @@ -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 |
