From 2f443d2d8fc592dc7d3859e267e665ef898ff3e8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 20 Apr 2006 04:20:41 +0000 Subject: [PATCH] Set the rid for any resource obtained from rman_reserve_resource. Reviewed by: wollman, jmg (as were the other commits fixing this problem) --- sys/sparc64/ebus/ebus.c | 1 + sys/sparc64/pci/psycho.c | 2 +- sys/sparc64/sbus/sbus.c | 1 + sys/sparc64/sparc64/nexus.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/sparc64/ebus/ebus.c b/sys/sparc64/ebus/ebus.c index 29a820090e5..7fb8a3ad51c 100644 --- a/sys/sparc64/ebus/ebus.c +++ b/sys/sparc64/ebus/ebus.c @@ -321,6 +321,7 @@ ebus_alloc_resource(device_t bus, device_t child, int type, int *rid, flags, child); if (res == NULL) return (NULL); + rman_set_rid(res, *rid); bt = rman_get_bustag(ri->eri_res); rman_set_bustag(res, bt); rv = bus_space_subregion(bt, rman_get_bushandle(ri->eri_res), diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c index d79ed7151e7..dd00e259273 100644 --- a/sys/sparc64/pci/psycho.c +++ b/sys/sparc64/pci/psycho.c @@ -1057,7 +1057,7 @@ psycho_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == NULL) return (NULL); - + rman_set_rid(rv, *rid); bh += rman_get_start(rv); rman_set_bustag(rv, bt); rman_set_bushandle(rv, bh); diff --git a/sys/sparc64/sbus/sbus.c b/sys/sparc64/sbus/sbus.c index 7837bc7534d..3f5469c45a6 100644 --- a/sys/sparc64/sbus/sbus.c +++ b/sys/sparc64/sbus/sbus.c @@ -805,6 +805,7 @@ sbus_alloc_resource(device_t bus, device_t child, int type, int *rid, child); if (rv == NULL) return (NULL); + rman_set_rid(rv, *rid); rman_set_bustag(rv, sc->sc_cbustag); rman_set_bushandle(rv, bh + rman_get_start(rv)); if (needactivate) { diff --git a/sys/sparc64/sparc64/nexus.c b/sys/sparc64/sparc64/nexus.c index eb88c23cf00..4f4a8c8b0aa 100644 --- a/sys/sparc64/sparc64/nexus.c +++ b/sys/sparc64/sparc64/nexus.c @@ -367,6 +367,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == NULL) return (NULL); + rman_set_rid(rv, *rid); if (type == SYS_RES_MEMORY) { rman_set_bustag(rv, &nexus_bustag); rman_set_bushandle(rv, rman_get_start(rv));