From: imp Date: Thu, 19 Sep 1996 19:44:57 +0000 (+0000) Subject: KLUDGE: make the bounce buffers work on rPC44 as well as the Tyne. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b81cd7cdccdcfe140c1d8c1f635d84c0b61a2f01;p=openbsd KLUDGE: make the bounce buffers work on rPC44 as well as the Tyne. --- diff --git a/sys/arch/arc/dti/btl.c b/sys/arch/arc/dti/btl.c index 3c60cbb18ba..888f8ab1ced 100644 --- a/sys/arch/arc/dti/btl.c +++ b/sys/arch/arc/dti/btl.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,7 @@ #include #include +#include /* XXX for cpu types */ #ifndef DDB #define Debugger() panic("should call debugger here (bt742a.c)") @@ -98,8 +100,10 @@ struct bt_mbx { struct bt_mbx_in *tmbi; /* Target Mail Box in */ }; +extern int cputype; /* XXX */ + #define KVTOPHYS(x) (((int)(x) & 0x7fffff) | 0x800000) -#define PHYSTOKV(x) (((int)(x) & 0x7fffff) | TYNE_V_BOUNCE) +#define PHYSTOKV(x) (((int)(x) & 0x7fffff) | (cputype == DESKSTATION_TYNE ? TYNE_V_BOUNCE : 0)) #include "aha.h" #include "btl.h" @@ -368,6 +372,8 @@ btattach(parent, self, aux) struct bt_ccb *ccb; struct bt_buf *buf; u_int bouncearea; + u_int bouncebase; + u_int bouncesize; if (bt_find(ia, sc) != 0) panic("btattach: bt_find of %s failed", self->dv_xname); @@ -376,8 +382,15 @@ btattach(parent, self, aux) /* * create mbox area */ - sc->sc_mbx = (struct bt_mbx *)TYNE_V_BOUNCE; - bouncearea = TYNE_V_BOUNCE + sizeof(struct bt_mbx); + if (cputype == DESKSTATION_TYNE) { + bouncebase = TYNE_V_BOUNCE; + bouncesize = TYNE_S_BOUNCE; + } else { + bouncesize = TYNE_S_BOUNCE; /* Good enough? XXX */ + bouncebase = (u_int) malloc( bouncesize, M_DEVBUF, M_NOWAIT); + } + bouncearea = bouncebase + sizeof(struct bt_mbx); + sc->sc_mbx = (struct bt_mbx *)bouncebase; bt_inquire_setup_information(sc); bt_init(sc); @@ -398,7 +411,7 @@ btattach(parent, self, aux) /* * fill up with bufs's */ - while ((bouncearea + sizeof(struct bt_buf)) < (TYNE_V_BOUNCE + TYNE_S_BOUNCE)) { + while ((bouncearea + sizeof(struct bt_buf)) < bouncebase + bouncesize) { buf = (struct bt_buf *)bouncearea; bouncearea += sizeof(struct bt_buf); TAILQ_INSERT_HEAD(&sc->sc_free_buf, buf, chain);