diff options
author | phk <phk@FreeBSD.org> | 2005-09-28 18:06:25 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-09-28 18:06:25 +0000 |
commit | 48a3daa37c6443e81007d489a5a5df4ab2205b4d (patch) | |
tree | 93bbc1cddf41f301ccc4f06c37aa32c562ada9b3 /sys/dev/puc | |
parent | 5f9e2766d4f292d097aa16237a8fa1e548a8f819 (diff) | |
download | FreeBSD-src-48a3daa37c6443e81007d489a5a5df4ab2205b4d.zip FreeBSD-src-48a3daa37c6443e81007d489a5a5df4ab2205b4d.tar.gz |
puc(4) does strange things to resources in order to fool the
subdrivers to hook up.
It should probably be rewritten to implement a simple bus to which
the sub drivers attach using some kind of hint.
Until then, provide a couple of crutch functions with big warning
signs so it can survive the recent changes to struct resource.
Diffstat (limited to 'sys/dev/puc')
-rw-r--r-- | sys/dev/puc/puc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index 8eb8034..8866bb1 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -316,8 +316,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed == 0) { rle->res = sc->sc_bar_mappings[bidx].res; } else { - rle->res = malloc(sizeof(struct resource), M_DEVBUF, - M_WAITOK | M_ZERO); + rle->res = rman_secret_puc_alloc_resource(M_WAITOK); if (rle->res == NULL) { free(pdev, M_DEVBUF); return (ENOMEM); @@ -352,7 +351,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed) { bus_space_unmap(rman_get_bustag(rle->res), rman_get_bushandle(rle->res), ressz); - free(rle->res, M_DEVBUF); + rman_secret_puc_free_resource(rle->res); free(pdev, M_DEVBUF); } continue; @@ -372,7 +371,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed) { bus_space_unmap(rman_get_bustag(rle->res), rman_get_bushandle(rle->res), ressz); - free(rle->res, M_DEVBUF); + rman_secret_puc_free_resource(rle->res); free(pdev, M_DEVBUF); } } |