[1] check return value from malloc() for NULL before trying to bzero it.
[2] use "=" rather than "|=" when writing to CSR (otherwise you may
ACK something you don't mean to!).
* 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.6 1996/02/08 04:43:45 chuck Exp $
+ * id: $Id: xd.c,v 1.7 1996/03/04 20:35:23 chuck Exp $
* started: 27-Feb-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
(ADDR) = ((ADDR) >> 8); \
(XDC)->xdc_iopbaddr3 = (ADDR); \
(XDC)->xdc_iopbamod = XDC_ADDRMOD; \
- (XDC)->xdc_csr |= XDC_ADDIOPB; /* go! */ \
+ (XDC)->xdc_csr = XDC_ADDIOPB; /* go! */ \
}
/*
xdc->reqs = (struct xd_iorq *)
malloc(XDC_MAXIOPB * sizeof(struct xd_iorq), M_DEVBUF, M_NOWAIT);
- bzero(xdc->reqs, XDC_MAXIOPB * sizeof(struct xd_iorq));
if (xdc->reqs == NULL)
panic("xdc malloc");
+ bzero(xdc->reqs, XDC_MAXIOPB * sizeof(struct xd_iorq));
/* init free list, iorq to iopb pointers, and non-zero fields in the
* iopb which never change. */
if (del <= 0)
panic("xdc_reset");
} else {
- xdcsc->xdc->xdc_csr |= XDC_CLRRIO; /* clear RIO */
+ xdcsc->xdc->xdc_csr = XDC_CLRRIO; /* clear RIO */
}
bcopy(&tmpiopb, xdcsc->iopbase, sizeof(tmpiopb));
}
* done bit.
*/
if (xdc->xdc_csr & XDC_REMIOPB) {
- xdc->xdc_csr |= XDC_CLRRIO;
+ xdc->xdc_csr = XDC_CLRRIO;
}
for (rqno = 0; rqno < XDC_MAXIOPB; rqno++) {
* x y . c x y l o g i c s 4 5 0 / 4 5 1 s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
- * id: $Id: xy.c,v 1.6 1996/02/21 03:43:18 chuck Exp $
+ * id: $Id: xy.c,v 1.7 1996/03/04 20:35:25 chuck Exp $
* started: 14-Sep-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
(XYC)->xyc_reloc_lo = ((ADDR) & 0xff); \
(ADDR) = ((ADDR) >> 8); \
(XYC)->xyc_reloc_hi = (ADDR); \
- (XYC)->xyc_csr |= XYC_GBSY; /* go! */ \
+ (XYC)->xyc_csr = XYC_GBSY; /* go! */ \
}
/*
xyc->dvmaiopb = (struct xy_iopb *) ((u_long)dtmp - DVMA_BASE);
xyc->reqs = (struct xy_iorq *)
malloc(XYC_MAXIOPB * sizeof(struct xy_iorq), M_DEVBUF, M_NOWAIT);
- bzero(xyc->reqs, XYC_MAXIOPB * sizeof(struct xy_iorq));
if (xyc->reqs == NULL)
panic("xyc malloc");
+ bzero(xyc->reqs, XYC_MAXIOPB * sizeof(struct xy_iorq));
/*
* init iorq to iopb pointers, and non-zero fields in the
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
panic("xyc_reset");
} else {
- xycsc->xyc->xyc_csr |= XYC_IPND; /* clear IPND */
+ xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
}
bcopy(&tmpiopb, xycsc->ciopb, sizeof(tmpiopb));
}
*/
if (xyc->xyc_csr & XYC_ERR) {
- xyc->xyc_csr |= XYC_ERR; /* clear error condition */
+ xyc->xyc_csr = XYC_ERR; /* clear error condition */
}
if (xyc->xyc_csr & XYC_IPND) {
- xyc->xyc_csr |= XYC_IPND; /* clear interrupt */
+ xyc->xyc_csr = XYC_IPND; /* clear interrupt */
}
for (rq = 0; rq < XYC_MAXIOPB; rq++) {
* 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/02/08 04:43:47 chuck Exp $
+ * id: $Id: xd.c,v 1.5 1996/03/04 20:35:27 chuck Exp $
* started: 27-Feb-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
(ADDR) = ((ADDR) >> 8); \
(XDC)->xdc_iopbaddr3 = (ADDR); \
(XDC)->xdc_iopbamod = XDC_ADDRMOD; \
- (XDC)->xdc_csr |= XDC_ADDIOPB; /* go! */ \
+ (XDC)->xdc_csr = XDC_ADDIOPB; /* go! */ \
}
/*
dvma_kvtopa((long) xdc->iopbase, BUS_VME32);
xdc->reqs = (struct xd_iorq *)
malloc(XDC_MAXIOPB * sizeof(struct xd_iorq), M_DEVBUF, M_NOWAIT);
- bzero(xdc->reqs, XDC_MAXIOPB * sizeof(struct xd_iorq));
if (xdc->reqs == NULL)
panic("xdc malloc");
+ bzero(xdc->reqs, XDC_MAXIOPB * sizeof(struct xd_iorq));
/* init free list, iorq to iopb pointers, and non-zero fields in the
* iopb which never change. */
block = block / iorq->xd->nhead;
iopb->cylno = block;
}
- dp = dvma_kvtopa((long)iorq->dbuf, BUS_VME32);
- iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 : dp;
+ iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 :
+ dvma_kvtopa((long)iorq->dbuf, BUS_VME32);
iopb->addrmod = XDC_ADDRMOD;
}
}
if (del <= 0)
panic("xdc_reset");
} else {
- xdcsc->xdc->xdc_csr |= XDC_CLRRIO; /* clear RIO */
+ xdcsc->xdc->xdc_csr = XDC_CLRRIO; /* clear RIO */
}
bcopy(&tmpiopb, xdcsc->iopbase, sizeof(tmpiopb));
}
* done bit.
*/
if (xdc->xdc_csr & XDC_REMIOPB) {
- xdc->xdc_csr |= XDC_CLRRIO;
+ xdc->xdc_csr = XDC_CLRRIO;
}
for (rqno = 0; rqno < XDC_MAXIOPB; rqno++) {
* x y . c x y l o g i c s 4 5 0 / 4 5 1 s m d d r i v e r
*
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
- * id: $Id: xy.c,v 1.4 1996/02/21 03:44:01 chuck Exp $
+ * id: $Id: xy.c,v 1.5 1996/03/04 20:35:29 chuck Exp $
* started: 14-Sep-95
* references: [1] Xylogics Model 753 User's Manual
* part number: 166-753-001, Revision B, May 21, 1988.
(XYC)->xyc_reloc_lo = ((ADDR) & 0xff); \
(ADDR) = ((ADDR) >> 8); \
(XYC)->xyc_reloc_hi = (ADDR); \
- (XYC)->xyc_csr |= XYC_GBSY; /* go! */ \
+ (XYC)->xyc_csr = XYC_GBSY; /* go! */ \
}
/*
dvma_kvtopa((long) xyc->iopbase, BUS_VME16);
xyc->reqs = (struct xy_iorq *)
malloc(XYC_MAXIOPB * sizeof(struct xy_iorq), M_DEVBUF, M_NOWAIT);
- bzero(xyc->reqs, XYC_MAXIOPB * sizeof(struct xy_iorq));
if (xyc->reqs == NULL)
panic("xyc malloc");
+ bzero(xyc->reqs, XYC_MAXIOPB * sizeof(struct xy_iorq));
/*
* init iorq to iopb pointers, and non-zero fields in the
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
panic("xyc_reset");
} else {
- xycsc->xyc->xyc_csr |= XYC_IPND; /* clear IPND */
+ xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
}
bcopy(&tmpiopb, xycsc->ciopb, sizeof(tmpiopb));
}
*/
if (xyc->xyc_csr & XYC_ERR) {
- xyc->xyc_csr |= XYC_ERR; /* clear error condition */
+ xyc->xyc_csr = XYC_ERR; /* clear error condition */
}
if (xyc->xyc_csr & XYC_IPND) {
- xyc->xyc_csr |= XYC_IPND; /* clear interrupt */
+ xyc->xyc_csr = XYC_IPND; /* clear interrupt */
}
for (rq = 0; rq < XYC_MAXIOPB; rq++) {