diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-05 08:46:30 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-05 08:46:30 +0000 |
commit | 49b916899d59400770153330f03125781269b5e5 (patch) | |
tree | e51cb78f1ac051688cf52cb124f2b3e4909d6a46 /sys/arch | |
parent | 6274e12d024541bb7fa5dc0d7e6aa0693b4e98f1 (diff) |
In ubareset(), be sure to destroy the uba extent before recreating it, to
avoid a diagnostic assertion failure.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/vax/uba/uba.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/vax/uba/uba.c b/sys/arch/vax/uba/uba.c index 74f369a6ab2..49d602eeeea 100644 --- a/sys/arch/vax/uba/uba.c +++ b/sys/arch/vax/uba/uba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uba.c,v 1.22 2006/01/20 23:27:26 miod Exp $ */ +/* $OpenBSD: uba.c,v 1.23 2006/06/05 08:46:29 miod Exp $ */ /* $NetBSD: uba.c,v 1.43 2000/01/24 02:40:36 matt Exp $ */ /* * Copyright (c) 1996 Jonathan Stone. @@ -69,7 +69,7 @@ static int ubaprint(void *, const char *); #if 0 static void ubastray(int); #endif -static void ubainitmaps(struct uba_softc *); +static void ubainitmaps(struct uba_softc *, int); extern struct cfdriver uba_cd; @@ -719,13 +719,16 @@ ubarelse(uh, amr) } void -ubainitmaps(uhp) - register struct uba_softc *uhp; +ubainitmaps(uhp, reset) + struct uba_softc *uhp; + int reset; { int error; if (uhp->uh_memsize > UBA_MAXMR) uhp->uh_memsize = UBA_MAXMR; + if (reset) + extent_destroy(uhp->uh_ext); uhp->uh_ext = extent_create("uba", 0, uhp->uh_memsize * VAX_NBPG, M_DEVBUF, uhp->uh_extspace, EXTENT_FIXED_STORAGE_SIZE(UAMSIZ), EX_NOWAIT); @@ -751,7 +754,7 @@ ubareset(uban) SIMPLEQ_INIT(&uh->uh_resq); uh->uh_bdpwant = 0; uh->uh_mrwant = 0; - ubainitmaps(uh); + ubainitmaps(uh, 1); wakeup((caddr_t)&uh->uh_bdpwant); wakeup((caddr_t)&uh->uh_mrwant); printf("%s: reset", uh->uh_dev.dv_xname); @@ -821,7 +824,7 @@ uba_attach(sc, iopagephys) M_DEVBUF, M_NOWAIT); if (sc->uh_extspace == NULL) panic("uba_attach"); - ubainitmaps(sc); + ubainitmaps(sc, 0); /* * Map the first page of UNIBUS i/o space to the first page of memory |