From fd400e0ddcdc330c02c8cd4e2864584b7b415acc Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 22 Mar 1999 07:40:57 +0000 Subject: 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.) --- sys/dev/isapnp/isapnp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit