diff options
author | chuck <chuck@cvs.openbsd.org> | 1996-01-13 03:45:04 +0000 |
---|---|---|
committer | chuck <chuck@cvs.openbsd.org> | 1996-01-13 03:45:04 +0000 |
commit | f406b38f13aa881e9c0357ce5905c8868e7acd38 (patch) | |
tree | 4aba20f91c6c7ca15cf512b7f63e14ede0afee52 /sys/arch/sparc/dev/xd.c | |
parent | 9fa3ae3f959e04fd6c1ec2d7661a53d1069b7bdd (diff) |
- call mapiodev() with sizeof(struct xdc/xyc) rather than ra_len (which is
zero since xdcmatch/xycmatch no longer sets it). [if you call
mapiodev() with a zero size it will reuse the KVA it returns, swiping
the device out from under you!]
- make xdc/xyc->iopbase point in the kernels DVMA space rather than at the
normal malloc'd KVA. this isn't compatable with sun4m [doesn't
have a kernel DVMA space] and will need to be changed later (XXX).
- move disk_attach() to before reading the disk label as per Jason.
otherwise we are reading into an unallocated buffer (oops!)
Diffstat (limited to 'sys/arch/sparc/dev/xd.c')
-rw-r--r-- | sys/arch/sparc/dev/xd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c index 680c61cbe97..7c649161b24 100644 --- a/sys/arch/sparc/dev/xd.c +++ b/sys/arch/sparc/dev/xd.c @@ -36,7 +36,7 @@ * x d . c x y l o g i c s 7 5 3 / 7 0 5 3 v m e / s m d d r i v e r * * author: Chuck Cranor <chuck@ccrc.wustl.edu> - * id: $Id: xd.c,v 1.4 1996/01/12 23:09:08 chuck Exp $ + * id: $Id: xd.c,v 1.5 1996/01/13 03:45:01 chuck Exp $ * started: 27-Feb-95 * references: [1] Xylogics Model 753 User's Manual * part number: 166-753-001, Revision B, May 21, 1988. @@ -388,7 +388,7 @@ xdcattach(parent, self, aux) * into our xdc_softc. */ ca->ca_ra.ra_vaddr = mapiodev(ca->ca_ra.ra_reg, 0, - ca->ca_ra.ra_len, ca->ca_bustype); + sizeof(struct xdc), ca->ca_bustype); xdc->xdc = (struct xdc *) ca->ca_ra.ra_vaddr; pri = ca->ca_ra.ra_intr[0].int_pri; @@ -408,6 +408,7 @@ xdcattach(parent, self, aux) xdc->dvmaiopb = (struct xd_iopb *) dvma_malloc(XDC_MAXIOPB * sizeof(struct xd_iopb), &xdc->iopbase, M_NOWAIT); + xdc->iopbase = xdc->dvmaiopb; /* XXX TMP HACK */ bzero(xdc->iopbase, XDC_MAXIOPB * sizeof(struct xd_iopb)); /* Setup device view of DVMA address */ xdc->dvmaiopb = (struct xd_iopb *) ((u_long) xdc->iopbase - DVMA_BASE); @@ -652,6 +653,9 @@ xdattach(parent, self, aux) newstate = XD_DRIVE_NOLABEL; xd->hw_spt = spt; + /* Attach the disk: must be before getdisklabel to malloc label */ + disk_attach(&xd->sc_dk); + if (xdgetdisklabel(xd, xa->buf) != XD_ERR_AOK) goto done; @@ -718,9 +722,6 @@ xdattach(parent, self, aux) bootdv = &xd->sc_dev; } - /* Attach the disk. */ - disk_attach(&xd->sc_dk); - dk_establish(&xd->sc_dk, &xd->sc_dev); /* XXX */ done: |