summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2001-12-24 09:37:53 +0000
committerchristos <christos@NetBSD.org>2001-12-24 09:37:53 +0000
commitd0b18148da9a8c2d50d0a17a7e9ff68cb73c31e7 (patch)
treebfd43f8fbff5bd19b22fa865946d895b956c9b1f /sys/dev
parent0e9f2d7a359d4988fc90c13e01d365145279647d (diff)
make sure that we adjust the end of the subrange if we adjusted the beginning
of it, but the offset of the card. Fixes 'cannot map i/o space' on 3c562d
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/rbus.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/cardbus/rbus.c b/sys/dev/cardbus/rbus.c
index e1443701651..f737b3ddc2d 100644
--- a/sys/dev/cardbus/rbus.c
+++ b/sys/dev/cardbus/rbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rbus.c,v 1.11 2001/11/15 09:48:02 lukem Exp $ */
+/* $NetBSD: rbus.c,v 1.12 2001/12/24 09:37:53 christos Exp $ */
/*
* Copyright (c) 1999 and 2000
* HAYAKAWA Koichi. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rbus.c,v 1.11 2001/11/15 09:48:02 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus.c,v 1.12 2001/12/24 09:37:53 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,7 +90,7 @@ rbus_space_alloc_subregion(rbt, substart, subend, addr, size, mask, align, flags
bus_space_handle_t *bshp;
{
bus_addr_t decodesize = mask + 1;
- bus_addr_t boundary, search_addr;
+ bus_addr_t boundary, search_addr, search_end;
int val;
bus_addr_t result;
int exflags = EX_FAST | EX_NOWAIT | EX_MALLOCOK;
@@ -139,13 +139,13 @@ rbus_space_alloc_subregion(rbt, substart, subend, addr, size, mask, align, flags
boundary = decodesize > align ? decodesize : align;
search_addr = (substart & ~(boundary - 1)) + addr;
+ search_end = subend + addr;
if (search_addr < substart) {
search_addr += boundary;
}
-
val = 1;
- for (; search_addr + size <= subend;
+ for (; search_addr + size <= search_end;
search_addr += boundary) {
val = extent_alloc_subregion(rbt->rb_ext,
search_addr, search_addr + size, size,