summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-10-05 20:27:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-10-05 20:27:49 +0000
commit1cda5c3c6e83883671d3cfe85271e4cc71d02304 (patch)
tree946cfc61015a696684c1002cd2812fb5e61acd50 /sys/arch/mvme88k/dev
parentf2d9588f8a014d214667991ae0da96d66b2df72a (diff)
Kill vm_offset_t and vm_size_t, in favor of the [pv]addr_t and [pv]size_t
typedefs.
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r--sys/arch/mvme88k/dev/cl.c83
-rw-r--r--sys/arch/mvme88k/dev/if_ie.c42
-rw-r--r--sys/arch/mvme88k/dev/if_ve.c40
-rw-r--r--sys/arch/mvme88k/dev/memc.c4
-rw-r--r--sys/arch/mvme88k/dev/memdevs.c8
-rw-r--r--sys/arch/mvme88k/dev/pcctwo.c12
-rw-r--r--sys/arch/mvme88k/dev/ssh.c109
-rw-r--r--sys/arch/mvme88k/dev/sshdma.c21
-rw-r--r--sys/arch/mvme88k/dev/vme.c40
-rw-r--r--sys/arch/mvme88k/dev/vs.c152
-rw-r--r--sys/arch/mvme88k/dev/vsvar.h22
-rw-r--r--sys/arch/mvme88k/dev/vx.c186
12 files changed, 337 insertions, 382 deletions
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index b46f2c14e4b..310c1f23616 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: cl.c,v 1.31 2003/10/03 16:44:50 miod Exp $ */
+/* $OpenBSD: cl.c,v 1.32 2003/10/05 20:27:47 miod Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -22,7 +22,7 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ */
/* DMA mode still does not work!!! */
@@ -64,7 +64,7 @@
#define CL_RXDMAINT 0x82
#define CL_TXDMAINT 0x42
#define CL_TXMASK 0x47
-#define CL_RXMASK 0x87
+#define CL_RXMASK 0x87
#define CL_TXINTR 0x02
#define CL_RXINTR 0x02
@@ -189,13 +189,13 @@ void cloutput(struct tty *tp);
void cl_chkinput(void);
#endif
-struct cfattach cl_ca = {
+struct cfattach cl_ca = {
sizeof(struct clsoftc), clprobe, clattach
-};
-
+};
+
struct cfdriver cl_cd = {
NULL, "cl", DV_TTY, 0
-};
+};
#define CLCDBUF 80
@@ -213,7 +213,7 @@ struct tty *cltty(dev)
int unit, channel;
struct clsoftc *sc;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (NULL);
}
@@ -221,19 +221,19 @@ struct tty *cltty(dev)
return sc->sc_cl[channel].tty;
}
-int
+int
clprobe(parent, self, aux)
struct device *parent;
void *self;
void *aux;
{
/* probing onboard 166/167/187 CL-cd2400
- * should be previously configured,
+ * should be previously configured,
* we can check the value before resetting the chip
*/
struct clreg *cl_reg;
struct confargs *ca = aux;
-
+
if (brdtyp == BRD_188)
return 0;
@@ -241,7 +241,7 @@ clprobe(parent, self, aux)
ca->ca_vaddr = ca->ca_paddr = (void *)CD2400_BASE_ADDR;
cl_reg = (struct clreg *)ca->ca_vaddr;
- if (badvaddr((vm_offset_t)&cl_reg->cl_gfrcr,1))
+ if (badvaddr((vaddr_t)&cl_reg->cl_gfrcr,1))
return 0;
return 1;
}
@@ -377,7 +377,7 @@ cl_initchannel(sc, channel)
cl_reg->cl_ier = 0x00;
/* if the port is not the console, should be init for all ports??*/
if (sc->sc_cl[channel].cl_consio != 1) {
- cl_reg->cl_cmr = 0x02;
+ cl_reg->cl_cmr = 0x02;
cl_reg->cl_cor1 = 0x17;
cl_reg->cl_cor2 = 0x00;
cl_reg->cl_cor3 = 0x02;
@@ -483,7 +483,6 @@ clmctl(dev, bits, how)
if( msvr & 0x01) {
bits |= TIOCM_RTS;
}
-
}
break;
}
@@ -516,9 +515,9 @@ clopen(dev, flag, mode, p)
struct cl_info *cl;
struct clsoftc *sc;
struct tty *tp;
-
+
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -582,7 +581,7 @@ clopen(dev, flag, mode, p)
#ifdef CL_DMA_WORKS
{
sc->cl_reg->cl_cmr =
- /* CL_TXDMAINT | */ CL_RXDMAINT;
+ /* CL_TXDMAINT | */ CL_RXDMAINT;
sc->cl_reg->cl_ier = 0xa8;
sc->cl_reg->cl_licr = 0x00;
}
@@ -612,11 +611,11 @@ if (channel == 2) { /* test one channel now */
#if 0
/* tx only */
sc->cl_reg->cl_licr = (CL_DMAMODE << 4);
- sc->cl_reg->cl_cmr = 0x42;
+ sc->cl_reg->cl_cmr = 0x42;
#endif
/* rx only */
sc->cl_reg->cl_licr = 0x00;
- sc->cl_reg->cl_cmr = 0x82;
+ sc->cl_reg->cl_cmr = 0x82;
}
sc->cl_reg->cl_ccr = 0x20;
while (sc->cl_reg->cl_ccr != 0) {
@@ -660,7 +659,7 @@ clparam(tp, t)
dev = tp->t_dev;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -689,7 +688,7 @@ cloutput(tp)
dev = tp->t_dev;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return;
}
@@ -729,7 +728,7 @@ clclose(dev, flag, mode, p)
struct clsoftc *sc;
int s;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -739,7 +738,7 @@ clclose(dev, flag, mode, p)
(*linesw[tp->t_line].l_close)(tp, flag);
s = splcl();
-
+
sc->cl_reg->cl_car = channel;
if(cl->cl_consio == 0 && (tp->t_cflag & HUPCL) != 0) {
sc->cl_reg->cl_msvr_rts = 0x00;
@@ -771,7 +770,7 @@ clread(dev, uio, flag)
struct cl_info *cl;
struct clsoftc *sc;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -794,7 +793,7 @@ clwrite(dev, uio, flag)
struct cl_info *cl;
struct clsoftc *sc;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -820,7 +819,7 @@ clioctl(dev, cmd, data, flag, p)
struct cl_info *cl;
struct clsoftc *sc;
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -874,9 +873,9 @@ clioctl(dev, cmd, data, flag, p)
*(int *)data = cl->cl_swflags;
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p, 0);
if (error != 0)
- return(EPERM);
+ return(EPERM);
cl->cl_swflags = *(int *)data;
cl->cl_swflags &= /* only allow valid flags */
@@ -940,7 +939,7 @@ clcninit(cp)
struct consdev *cp;
{
struct clreg *volatile cl_reg;
-
+
cl_cons.cl_paddr = (void *)CD2400_BASE_ADDR;
cl_cons.cl_vaddr = (struct clreg *)IIOV(cl_cons.cl_paddr);
cl_cons.pcctwoaddr = (void *)IIOV(0xfff42000);
@@ -1048,7 +1047,7 @@ clcngetc(dev)
cl_reg->cl_teoir = 0x00;
}
}
-
+
return data;
}
@@ -1146,7 +1145,7 @@ cl_chkinput()
if (dopoll == 0)
return;
for (unit = 0; unit < cl_cd.cd_ndevs; unit++) {
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
continue;
}
@@ -1173,7 +1172,7 @@ cl_chkinput()
}
#endif
-u_char
+u_char
clgetc(sc, channel)
struct clsoftc *sc;
int *channel;
@@ -1237,7 +1236,7 @@ clccparam(sc, par, channel)
s = splcl();
sc->cl_reg->cl_car = channel;
- if (par->c_ospeed == 0) {
+ if (par->c_ospeed == 0) {
/* dont kill the console */
if(sc->sc_cl[channel].cl_consio == 0) {
/* disconnect, drop RTS DTR stop receiver */
@@ -1293,7 +1292,7 @@ clccparam(sc, par, channel)
} else {
cor1 = 0x10 | clen; /* ignore parity */
}
- if (sc->cl_reg->cl_cor1 != cor1) {
+ if (sc->cl_reg->cl_cor1 != cor1) {
sc->cl_reg->cl_cor1 = cor1;
sc->cl_reg->cl_ccr = 0x20;
while (sc->cl_reg->cl_ccr != 0) {
@@ -1337,7 +1336,7 @@ clccparam(sc, par, channel)
static int clknum = 0;
-u_char
+u_char
cl_clkdiv(speed)
int speed;
{
@@ -1355,7 +1354,7 @@ cl_clkdiv(speed)
return cl_clocks[4].divisor;
}
-u_char
+u_char
cl_clknum(speed)
int speed;
{
@@ -1374,7 +1373,7 @@ cl_clknum(speed)
return cl_clocks[4].clock;
}
-u_char
+u_char
cl_clkrxtimeout(speed)
int speed;
{
@@ -1423,7 +1422,7 @@ clstart(tp)
}
#endif
unit = CL_UNIT(dev);
- if (unit >= cl_cd.cd_ndevs ||
+ if (unit >= cl_cd.cd_ndevs ||
(sc = (struct clsoftc *) cl_cd.cd_devs[unit]) == NULL) {
return;
}
@@ -1486,7 +1485,7 @@ cl_mintr(arg)
log(LOG_WARNING, "cl_mintr: channel %x timer 2 unexpected\n",channel);
}
if (misr & 0x20) {
- log(LOG_WARNING, "cl_mintr: channel %x cts %x\n",channel,
+ log(LOG_WARNING, "cl_mintr: channel %x cts %x\n",channel,
((msvr & 0x20) != 0x0)
);
}
@@ -1642,7 +1641,7 @@ cl_rxintr(arg)
int i;
u_char reoir;
u_char buffer[CL_FIFO_MAX +1];
-
+
rir = sc->cl_reg->cl_rir;
if((rir & 0x40) == 0x0) {
/* only if intr is not shared ??? */
@@ -1706,7 +1705,7 @@ log(LOG_WARNING, "cl_txintr: DMAMODE channel %x dmabsts %x risrl %x risrh %x\n",
#endif
#if USE_BUFFER
cl_appendbufn(sc, channel, sc->rx[nbuf], cnt);
-#else
+#else
{
int i;
u_char *pbuf;
diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c
index 3bd029ea9fa..75822401e63 100644
--- a/sys/arch/mvme88k/dev/if_ie.c
+++ b/sys/arch/mvme88k/dev/if_ie.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: if_ie.c,v 1.25 2003/09/29 09:08:19 miod Exp $ */
+/* $OpenBSD: if_ie.c,v 1.26 2003/10/05 20:27:47 miod Exp $ */
/*-
- * Copyright (c) 1998 Steve Murphree, Jr.
+ * Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
* Copyright (c) 1992, 1993, University of Vermont and State
@@ -59,7 +59,7 @@
*
* Majorly cleaned up and 3C507 code merged by Charles Hannum.
*
- * Converted to SUN ie driver by Charles D. Cranor,
+ * Converted to SUN ie driver by Charles D. Cranor,
* October 1994, January 1995.
* This sun version based on i386 version 1.30.
*/
@@ -194,10 +194,10 @@ struct ie_softc {
struct ie_sys_ctl_block *volatile scb;
/*
- * pointer and size of a block of KVA where the buffers
+ * pointer and size of a block of KVA where the buffers
* are to be allocated from
*/
-
+
caddr_t buf_area;
int buf_area_sz;
@@ -343,7 +343,7 @@ ie_ack(sc, mask)
command_and_wait(sc, scb->ie_status & mask, 0, 0);
}
-int
+int
iematch(parent, vcf, args)
struct device *parent;
void *vcf, *args;
@@ -353,7 +353,7 @@ iematch(parent, vcf, args)
if (badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)){
return(0);
}
- return(1);
+ return(1);
}
/*
@@ -410,7 +410,7 @@ ieattach(parent, self, aux)
extern void myetheraddr(u_char *); /* should be elsewhere */
int pri = ca->ca_ipl;
struct ieob *volatile ieo;
- vm_offset_t pa;
+ paddr_t pa;
sc->reset_596 = ie_obreset;
sc->chan_attn = ie_obattend;
@@ -533,7 +533,7 @@ ieintr(v)
void *v;
{
struct ie_softc *sc = v;
- register u_short status;
+ u_short status;
status = sc->scb->ie_status;
/*printf("I");*/
@@ -604,9 +604,9 @@ ierint(sc)
sc->sc_arpcom.ac_if.if_ipackets++;
if (!--timesthru) {
sc->sc_arpcom.ac_if.if_ierrors +=
- MK_32(scb->ie_err_crc) +
+ MK_32(scb->ie_err_crc) +
MK_32(scb->ie_err_align) +
- MK_32(scb->ie_err_resource) +
+ MK_32(scb->ie_err_resource) +
MK_32(scb->ie_err_overrun) +
MK_32(scb->ie_err_coll) +
MK_32(scb->ie_err_short);
@@ -905,7 +905,7 @@ sc->xmit_cbuffs[sc->xctail]);
ASWAP(sc->xmit_buffs[sc->xctail]);
sc->xmit_cmds[sc->xctail]->ie_xmit_count = 0;
- sc->scb->ie_command_list =
+ sc->scb->ie_command_list =
ASWAP(sc->xmit_cmds[sc->xctail]);
command_and_wait(sc, IE_CU_START, 0, 0);
@@ -921,7 +921,7 @@ sc->xmit_cbuffs[sc->xctail]);
* length of the data available. This enables us to allocate mbuf
* clusters in many situations where before we would have had a long
* chain of partially-full mbufs. This should help to speed up the
- * operation considerably. (Provided that it works, of course.)
+ * operation considerably. (Provided that it works, of course.)
*/
int
ieget(sc, mp, ehp, to_bpf)
@@ -1252,7 +1252,7 @@ iestart(ifp)
len = 0;
buffer = sc->xmit_cbuffs[sc->xchead];
- for (m0 = m; m && (len +m->m_len) < IE_TBUF_SIZE;
+ for (m0 = m; m && (len +m->m_len) < IE_TBUF_SIZE;
m = m->m_next) {
bcopy(mtod(m, caddr_t), buffer, m->m_len);
buffer += m->m_len;
@@ -1285,7 +1285,7 @@ iestart(ifp)
/*
* set up IE's ram space
*/
-int
+int
ie_setupram(sc)
struct ie_softc *sc;
{
@@ -1374,9 +1374,9 @@ chan_attn_timeout(rock)
* or be accepted, depending on the command. If the command pointer
* is null, then pretend that the command is not an action command.
* If the command pointer is not null, and the command is an action
- * command, wait for
- * ((struct ie_cmd_common *volatile)pcmd)->ie_cmd_status & MASK
- * to become true.
+ * command, wait for
+ * ((struct ie_cmd_common *volatile)pcmd)->ie_cmd_status & MASK
+ * to become true.
*/
int
command_and_wait(sc, cmd, pcmd, mask)
@@ -1514,7 +1514,7 @@ Align(ptr)
* note: this function was written to be easy to understand, rather than
* highly efficient (it isn't in the critical path).
*/
-void
+void
setup_bufs(sc)
struct ie_softc *sc;
{
@@ -1731,7 +1731,7 @@ ieinit(sc)
cmd->com.ie_cmd_cmd = IE_CMD_IASETUP | IE_CMD_LAST;
cmd->com.ie_cmd_link = 0xffffffff;
- (sc->memcopy)(sc->sc_arpcom.ac_enaddr,
+ (sc->memcopy)(sc->sc_arpcom.ac_enaddr,
(caddr_t)&cmd->ie_address, sizeof cmd->ie_address);
if (command_and_wait(sc, IE_CU_START, cmd, IE_STAT_COMPL) ||
@@ -1780,7 +1780,7 @@ iestop(sc)
int
ieioctl(ifp, cmd, data)
- register struct ifnet *ifp;
+ struct ifnet *ifp;
u_long cmd;
caddr_t data;
{
diff --git a/sys/arch/mvme88k/dev/if_ve.c b/sys/arch/mvme88k/dev/if_ve.c
index 53fb1538987..a9c828fb65d 100644
--- a/sys/arch/mvme88k/dev/if_ve.c
+++ b/sys/arch/mvme88k/dev/if_ve.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ve.c,v 1.20 2003/09/29 09:08:19 miod Exp $ */
+/* $OpenBSD: if_ve.c,v 1.21 2003/10/05 20:27:47 miod Exp $ */
/*-
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1982, 1992, 1993
@@ -36,7 +36,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/mbuf.h>
+#include <sys/mbuf.h>
#include <sys/syslog.h>
#include <sys/socket.h>
#include <sys/device.h>
@@ -86,7 +86,7 @@ void ve_tint(struct vam7990_softc *);
int ve_put(struct vam7990_softc *, int, struct mbuf *);
struct mbuf *ve_get(struct vam7990_softc *, int, int);
-void ve_read(struct vam7990_softc *, int, int);
+void ve_read(struct vam7990_softc *, int, int);
void ve_shutdown(void *);
@@ -148,9 +148,9 @@ nvram_cmd(sc, cmd, addr)
struct vereg1 *reg1 = ((struct ve_softc *)sc)->sc_r1;
for (i=0;i<8;i++) {
- reg1->ver1_ear=((cmd|(addr<<1))>>i);
- CDELAY;
- }
+ reg1->ver1_ear=((cmd|(addr<<1))>>i);
+ CDELAY;
+ }
}
/* read nvram one bit at a time */
@@ -171,12 +171,12 @@ nvram_read(sc, nvram_addr)
ENABLE_NVRAM;
nvram_cmd(sc, NVRAM_READ, nvram_addr);
for (wbit=0; wbit<15; wbit++) {
- (reg1->ver1_ear & 0x01) ?
+ (reg1->ver1_ear & 0x01) ?
(val = (val | mask)) : (val = (val & (~mask)));
mask = mask>>1;
CDELAY;
}
- (reg1->ver1_ear & 0x01) ?
+ (reg1->ver1_ear & 0x01) ?
(val = (val | 0x8000)) : (val = (val & 0x7FFF));
CDELAY;
DISABLE_NVRAM;
@@ -271,7 +271,7 @@ veattach(parent, self, aux)
/* Are we the boot device? */
if (ca->ca_paddr == bootaddr)
bootdv = self;
-
+
lesc->sc_r1 = (struct vereg1 *)ca->ca_vaddr;
lesc->sc_ipl = ca->ca_ipl;
lesc->sc_vec = ca->ca_vec;
@@ -291,13 +291,13 @@ veattach(parent, self, aux)
default:
panic("ve: invalid address");
}
-
+
sc->sc_mem = (void *)mapiodev(addr, LEMEMSIZE);
-
+
if (sc->sc_mem == NULL) panic("ve: no more memory in external I/O map");
sc->sc_memsize = LEMEMSIZE;
sc->sc_conf3 = LE_C3_BSWP;
- sc->sc_addr = kvtop((vm_offset_t)sc->sc_mem);
+ sc->sc_addr = kvtop((vaddr_t)sc->sc_mem);
/* get ether address via bug call */
veetheraddr(sc);
@@ -400,7 +400,7 @@ ve_config(sc)
printf("\n%s: address %s\n", sc->sc_dev.dv_xname,
ether_sprintf(sc->sc_arpcom.ac_enaddr));
- printf("%s: %d receive buffers, %d transmit buffers\n",
+ printf("%s: %d receive buffers, %d transmit buffers\n",
sc->sc_dev.dv_xname, sc->sc_nrbuf, sc->sc_ntbuf);
sc->sc_sh = shutdownhook_establish(ve_shutdown, sc);
@@ -882,7 +882,7 @@ ve_intr(arg)
/* clear the interrupting condition */
(*sc->sc_wrcsr)(sc, LE_CSR0,
- isr & (LE_C0_INEA | LE_C0_BABL | LE_C0_MISS |
+ isr & (LE_C0_INEA | LE_C0_BABL | LE_C0_MISS |
LE_C0_MERR | LE_C0_RINT | LE_C0_TINT | LE_C0_IDON));
if (isr & LE_C0_ERR) {
if (isr & LE_C0_BABL) {
@@ -1294,8 +1294,8 @@ ve_copytobuf_contig(sc, from, boff, len)
{
volatile caddr_t buf = sc->sc_mem;
volatile caddr_t phys = (caddr_t)sc->sc_addr;
- dma_cachectl((vm_offset_t)phys + boff, len, DMA_CACHE_SYNC);
- dma_cachectl((vm_offset_t)buf + boff, len, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)phys + boff, len, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)buf + boff, len, DMA_CACHE_SYNC);
/*
* Just call bcopy() to do the work.
@@ -1311,8 +1311,8 @@ ve_copyfrombuf_contig(sc, to, boff, len)
{
volatile caddr_t buf = sc->sc_mem;
volatile caddr_t phys = (caddr_t)sc->sc_addr;
- dma_cachectl((vm_offset_t)phys + boff, len, DMA_CACHE_SYNC_INVAL);
- dma_cachectl((vm_offset_t)buf + boff, len, DMA_CACHE_SYNC_INVAL);
+ dma_cachectl((vaddr_t)phys + boff, len, DMA_CACHE_SYNC_INVAL);
+ dma_cachectl((vaddr_t)buf + boff, len, DMA_CACHE_SYNC_INVAL);
/*
* Just call bcopy() to do the work.
*/
@@ -1326,8 +1326,8 @@ ve_zerobuf_contig(sc, boff, len)
{
volatile caddr_t buf = sc->sc_mem;
volatile caddr_t phys = (caddr_t)sc->sc_addr;
- dma_cachectl((vm_offset_t)phys + boff, len, DMA_CACHE_SYNC);
- dma_cachectl((vm_offset_t)buf + boff, len, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)phys + boff, len, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)buf + boff, len, DMA_CACHE_SYNC);
/*
* Just let bzero() do the work
diff --git a/sys/arch/mvme88k/dev/memc.c b/sys/arch/mvme88k/dev/memc.c
index 2f7907ed407..2f312096b77 100644
--- a/sys/arch/mvme88k/dev/memc.c
+++ b/sys/arch/mvme88k/dev/memc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memc.c,v 1.7 2003/06/02 07:06:56 deraadt Exp $ */
+/* $OpenBSD: memc.c,v 1.8 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -78,7 +78,7 @@ memcmatch(parent, vcf, args)
struct confargs *ca = args;
struct memcreg *memc = (struct memcreg *)ca->ca_vaddr;
- if (badvaddr((vm_offset_t)memc, 4))
+ if (badvaddr((vaddr_t)memc, 4))
return (0);
if (memc->memc_chipid==MEMC_CHIPID || memc->memc_chipid==MCECC_CHIPID)
return (1);
diff --git a/sys/arch/mvme88k/dev/memdevs.c b/sys/arch/mvme88k/dev/memdevs.c
index 6d0f3212ce9..fe6eaa3aa97 100644
--- a/sys/arch/mvme88k/dev/memdevs.c
+++ b/sys/arch/mvme88k/dev/memdevs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memdevs.c,v 1.4 2003/06/04 04:11:37 deraadt Exp $ */
+/* $OpenBSD: memdevs.c,v 1.5 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -46,9 +46,9 @@ memdevrw(base, len, uio, flags)
struct uio *uio;
int flags;
{
- register vm_offset_t v;
- register int c;
- register struct iovec *iov;
+ vaddr_t v;
+ int c;
+ struct iovec *iov;
int error = 0;
while (uio->uio_resid > 0 && error == 0) {
diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c
index 4d8143edb46..39eb2d53b12 100644
--- a/sys/arch/mvme88k/dev/pcctwo.c
+++ b/sys/arch/mvme88k/dev/pcctwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcctwo.c,v 1.17 2003/06/02 07:06:56 deraadt Exp $ */
+/* $OpenBSD: pcctwo.c,v 1.18 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
* All rights reserved.
@@ -96,7 +96,7 @@ void *vcf, *args;
return (0);
}
- if (badvaddr((vm_offset_t)pcc2, 4)) {
+ if (badvaddr((vaddr_t)pcc2, 4)) {
printf("==> pcctwo: failed address check.\n");
return (0);
}
@@ -171,7 +171,7 @@ void *args;
*/
sc->sc_paddr = ca->ca_paddr;
sc->sc_vaddr = (void *)IIOV(sc->sc_paddr);
-
+
pcc2bus = ca->ca_bustype;
switch (pcc2bus) {
@@ -181,16 +181,16 @@ void *args;
#if NBUSSW > 0
case BUS_BUSSWITCH:
sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr;
- /*
+ /*
* fake up our address so that pcc2 child devices
* are offeset of 0xFFF00000 - XXX smurph
*/
sc->sc_paddr -= PCC2_PCC2CHIP_OFF;
sc->sc_vaddr -= PCC2_PCC2CHIP_OFF;
/* make sure the bus is mc68040 compatible */
- sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_C040;
+ sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_C040;
break;
-#endif
+#endif
}
sys_pcc2 = sc->sc_pcc2;
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index d47a7f8d869..e3031e38262 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.15 2003/09/22 21:39:39 miod Exp $ */
+/* $OpenBSD: ssh.c,v 1.16 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -80,7 +80,7 @@ void ssh_sched(struct ssh_softc *);
int ssh_poll(struct ssh_softc *, struct ssh_acb *);
int sshintr(struct ssh_softc *);
void scsi_period_to_ssh(struct ssh_softc *, int);
-void ssh_start(struct ssh_softc *, int, int, u_char *, int, u_char *, int);
+void ssh_start(struct ssh_softc *, int, int, u_char *, int, u_char *, int);
void ssh_dump_acb(struct ssh_acb *);
void sshinitialize(struct ssh_softc *sc);
@@ -218,7 +218,7 @@ ssh_scsicmd(xs)
sc = slp->adapter_softc;
flags = xs->flags;
xs->error = XS_NOERROR;
-
+
/* XXXX ?? */
if (flags & SCSI_DATA_UIO)
panic("ssh: scsi data uio requested");
@@ -254,10 +254,10 @@ ssh_scsicmd(xs)
* We should move this ssh_sched() XXX
*/
if (xs->flags & SCSI_DATA_IN) { /* read */
- dma_cachectl((vm_offset_t)xs->data, xs->datalen,
+ dma_cachectl((vaddr_t)xs->data, xs->datalen,
DMA_CACHE_SYNC_INVAL);
} else { /* write */
- dma_cachectl((vm_offset_t)xs->data, xs->datalen,
+ dma_cachectl((vaddr_t)xs->data, xs->datalen,
DMA_CACHE_SYNC);
}
@@ -472,7 +472,7 @@ ssh_scsidone(acb, stat)
TAILQ_REMOVE(&sc->ready_list, acb, chain);
SSH_TRACE('d','r',stat,0)
} else {
- register struct ssh_acb *acb2;
+ struct ssh_acb *acb2;
for (acb2 = sc->nexus_list.tqh_first; acb2;
acb2 = acb2->chain.tqe_next)
if (acb2 == acb) {
@@ -510,7 +510,7 @@ ssh_scsidone(acb, stat)
void
sshabort(sc, rp, where)
- register struct ssh_softc *sc;
+ struct ssh_softc *sc;
ssh_regmap_p rp;
char *where;
{
@@ -572,15 +572,15 @@ sshinitialize(sc)
* Also should verify that dev doesn't span non-contiguous
* physical pages.
*/
- sc->sc_scriptspa = kvtop((vm_offset_t)scripts);
+ sc->sc_scriptspa = kvtop((vaddr_t)scripts);
/*
* malloc sc_acb to ensure that DS is on a long word boundary.
*/
- MALLOC(sc->sc_acb, struct ssh_acb *,
+ MALLOC(sc->sc_acb, struct ssh_acb *,
sizeof(struct ssh_acb) * SSH_NACB, M_DEVBUF, M_NOWAIT);
- if (sc->sc_acb == NULL)
+ if (sc->sc_acb == NULL)
panic("sshinitialize: ACB malloc failed!");
sc->sc_tcp[1] = 1000 / sc->sc_clock_freq;
@@ -674,9 +674,9 @@ sshreset(sc)
for (i = 0; i < SSH_NACB; i++) {
pmap_cache_ctrl(pmap_kernel(),
- trunc_page((vm_offset_t)acb),
- round_page((vm_offset_t)acb+sizeof(*acb)),
- CACHE_INH);
+ trunc_page((vaddr_t)acb),
+ round_page((vaddr_t)acb + sizeof(*acb)),
+ CACHE_INH);
TAILQ_INSERT_TAIL(&sc->free_list, acb, chain);
acb++;
@@ -746,20 +746,20 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
acb->msg[0] = -1;
acb->ds.scsi_addr = (0x10000 << target) | (sc->sc_sync[target].sxfer << 8);
acb->ds.idlen = 1;
- acb->ds.idbuf = (char *) kvtop((vm_offset_t)&acb->msgout[0]);
+ acb->ds.idbuf = (char *) kvtop((vaddr_t)&acb->msgout[0]);
acb->ds.cmdlen = clen;
- acb->ds.cmdbuf = (char *) kvtop((vm_offset_t)cbuf);
+ acb->ds.cmdbuf = (char *) kvtop((vaddr_t)cbuf);
acb->ds.stslen = 1;
- acb->ds.stsbuf = (char *) kvtop((vm_offset_t)&acb->stat[0]);
+ acb->ds.stsbuf = (char *) kvtop((vaddr_t)&acb->stat[0]);
acb->ds.msglen = 1;
- acb->ds.msgbuf = (char *) kvtop((vm_offset_t)&acb->msg[0]);
+ acb->ds.msgbuf = (char *) kvtop((vaddr_t)&acb->msg[0]);
acb->msg[1] = -1;
acb->ds.msginlen = 1;
acb->ds.extmsglen = 1;
acb->ds.synmsglen = 3;
- acb->ds.msginbuf = (char *) kvtop((vm_offset_t)&acb->msg[1]);
- acb->ds.extmsgbuf = (char *) kvtop((vm_offset_t)&acb->msg[2]);
- acb->ds.synmsgbuf = (char *) kvtop((vm_offset_t)&acb->msg[3]);
+ acb->ds.msginbuf = (char *) kvtop((vaddr_t)&acb->msg[1]);
+ acb->ds.extmsgbuf = (char *) kvtop((vaddr_t)&acb->msg[2]);
+ acb->ds.synmsgbuf = (char *) kvtop((vaddr_t)&acb->msg[3]);
bzero(&acb->ds.chain, sizeof (acb->ds.chain));
if (sc->sc_sync[target].state == SYNC_START) {
@@ -803,7 +803,7 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
addr = buf;
dmaend = NULL;
while (count > 0) {
- acb->ds.chain[nchain].databuf = (char *) kvtop((vm_offset_t)addr);
+ acb->ds.chain[nchain].databuf = (char *) kvtop((vaddr_t)addr);
if (count < (tcount = NBPG - ((int) addr & PGOFSET)))
tcount = count;
acb->ds.chain[nchain].datalen = tcount;
@@ -840,12 +840,7 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
}
#endif
-#if CACHECTL
- /* push data cache for all data the 53c710 needs to access */
- dma_cachectl(sc, sizeof (struct ssh_softc), DMA_CACHE_SYNC);
- dma_cachectl(acb, sizeof (*acb), DMA_CACHE_SYNC);
-#endif
- dma_cachectl((vm_offset_t)cbuf, clen, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)cbuf, clen, DMA_CACHE_SYNC);
/*
* Flushing the buf from data cache is very important for MVME187
@@ -855,10 +850,10 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
*/
if (buf != NULL && len != 0) {
if (acb->xs->flags & SCSI_DATA_IN) { /* read */
- dma_cachectl((vm_offset_t)buf, len,
+ dma_cachectl((vaddr_t)buf, len,
DMA_CACHE_SYNC_INVAL);
} else { /* write */
- dma_cachectl((vm_offset_t)buf, len, DMA_CACHE_SYNC);
+ dma_cachectl((vaddr_t)buf, len, DMA_CACHE_SYNC);
}
}
@@ -877,7 +872,7 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
sc->sc_dev.dv_xname);
rp->ssh_temp = 0;
rp->ssh_sbcl = sc->sc_sync[target].sbcl;
- rp->ssh_dsa = kvtop((vm_offset_t)&acb->ds);
+ rp->ssh_dsa = kvtop((vaddr_t)&acb->ds);
rp->ssh_dsp = sc->sc_scriptspa;
SSH_TRACE('s',1,0,0)
} else {
@@ -961,9 +956,9 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff00) {
/* Normal completion status, or check condition */
#ifdef DEBUG
- if (rp->ssh_dsa != kvtop((vm_offset_t)&acb->ds)) {
+ if (rp->ssh_dsa != kvtop((vaddr_t)&acb->ds)) {
printf ("ssh: invalid dsa: %x %x\n", rp->ssh_dsa,
- kvtop((vm_offset_t)&acb->ds));
+ kvtop((vaddr_t)&acb->ds));
panic("*** ssh DSA invalid ***");
}
#endif
@@ -1021,10 +1016,6 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
scsi_period_to_ssh (sc, target);
}
}
-#if CACHECTL
- /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->stat[0]), 1);*/
- dma_cachectl(&acb->stat[0], 1);
-#endif
*status = acb->stat[0];
#ifdef DEBUG
if (rp->ssh_sbcl & SSH_BSY) {
@@ -1259,10 +1250,6 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
}
if (j < DMAMAXIO)
acb->ds.chain[j].datalen = 0;
-#if CACHECTL
- dma_cachectl(acb->ds.chain,
- sizeof(acb->ds.chain));
-#endif
}
++sc->sc_tinfo[target].dconns;
/*
@@ -1324,10 +1311,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
sc->sc_nexus = acb;
sc->sc_flags |= acb->status;
acb->status = 0;
-#if CACHECTL
- dma_cachectl(&acb->stat[0], sizeof(acb->stat[0]));
-#endif
- rp->ssh_dsa = kvtop((vm_offset_t)&acb->ds);
+ rp->ssh_dsa = kvtop((vaddr_t)&acb->ds);
rp->ssh_sxfer = sc->sc_sync[acb->xs->sc_link->target].sxfer;
rp->ssh_sbcl = sc->sc_sync[acb->xs->sc_link->target].sbcl;
break;
@@ -1338,9 +1322,6 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
sc->nexus_list.tqh_first);
panic("unable to find reselecting device");
}
-#if CACHECTL
- dma_cachectl (acb, sizeof(*acb));
-#endif
rp->ssh_temp = 0;
rp->ssh_dcntl |= SSH_DCNTL_STD;
return (0);
@@ -1373,7 +1354,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
}
target = sc->sc_nexus->xs->sc_link->target;
rp->ssh_temp = 0;
- rp->ssh_dsa = kvtop((vm_offset_t)&sc->sc_nexus->ds);
+ rp->ssh_dsa = kvtop((vaddr_t)&sc->sc_nexus->ds);
rp->ssh_sxfer = sc->sc_sync[target].sxfer;
rp->ssh_sbcl = sc->sc_sync[target].sbcl;
rp->ssh_dsp = sc->sc_scriptspa;
@@ -1384,14 +1365,10 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
printf("%s: Bad message-in with no active command?\n",
sc->sc_dev.dv_xname);
/* Unrecognized message in byte */
-#if CACHECTL
- /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->msg[1]), 1);*/
- dma_cachectl (&acb->msg[1],1);
-#endif
printf ("%s: Unrecognized message in data sfbr %x msg %x sbcl %x\n",
sc->sc_dev.dv_xname, rp->ssh_sfbr, acb->msg[1], rp->ssh_sbcl);
/* what should be done here? */
- /*DCIAS(kvtop((vm_offset_t)&acb->msg[1]));*/
+ /*DCIAS(kvtop((vaddr_t)&acb->msg[1]));*/
rp->ssh_dsp = sc->sc_scriptspa + Ent_switch;
return (0);
}
@@ -1472,7 +1449,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
goto bad_phase;
}
#if XXX
- switch (rp->ssh_sbcl & 7)
+ switch (rp->ssh_sbcl & 7)
#endif
switch (rp->ssh_sstat2 & 7) {
case 0: /* data out */
@@ -1538,7 +1515,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
* mode and single step mode, which we are not using.
* I will give it a shot... nivas
*/
-
+
if (kludge_city) {
dummy = rp->ssh_dsp;
rp->ssh_dsp = dummy;
@@ -1596,12 +1573,6 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
}
if (sstat0 == 0 && dstat & SSH_DSTAT_SIR) {
-#if CACHECTL
- /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->stat[0]), 1); */
- /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->msg[0]), 1); */
- dma_cachectl (&acb->stat[0], 1);
- dma_cachectl (&acb->msg[0], 1);
-#endif
printf ("SSH interrupt: %lx sts %x msg %x %x sbcl %x\n",
rp->ssh_dsps, acb->stat[0], acb->msg[0], acb->msg[1],
rp->ssh_sbcl);
@@ -1634,7 +1605,7 @@ bad_phase:
*/
printf ("sshchkintr: target %x ds %x\n", target, &acb->ds);
printf ("scripts %x ds %x rp %x dsp %x dcmd %x\n", sc->sc_scriptspa,
- kvtop((vm_offset_t)&acb->ds), kvtop((vm_offset_t)rp), rp->ssh_dsp,
+ kvtop((vaddr_t)&acb->ds), kvtop((vaddr_t)rp), rp->ssh_dsp,
*((long *)&rp->ssh_dcmd));
printf ("sshchkintr: istat %x dstat %x sstat0 %x dsps %x "
"dsa %x sbcl %x sts %x msg %x %x sfbr %x\n",
@@ -1702,10 +1673,10 @@ ssh_select(sc)
int
sshintr (sc)
- register struct ssh_softc *sc;
+ struct ssh_softc *sc;
{
ssh_regmap_p rp;
- register u_char istat, dstat, sstat0;
+ u_char istat, dstat, sstat0;
int status;
int s = splbio();
@@ -1722,7 +1693,7 @@ sshintr (sc)
sstat0 = sc->sc_sstat0;
if (dstat & SSH_DSTAT_SIR)
sc->sc_intcode = rp->ssh_dsps; /* XXX use sc_intcode instead of dsps */
-
+
/* Clear the copies in sc */
sc->sc_istat = 0;
sc->sc_dstat = 0;
@@ -1740,12 +1711,6 @@ sshintr (sc)
#ifdef DEBUG
if (ssh_debug & 5) {
-#if CACHECTL
- /*cmmu_inval_cache(kvtop((vm_offset_t)&sc->sc_nexus->stat[0]),
- sizeof(sc->sc_nexus->stat[0])); */
- dma_cachectl(&sc->sc_nexus->stat[0],
- sizeof(sc->sc_nexus->stat[0]));
-#endif
printf ("%s: intr istat %x dstat %x sstat0 %x dsps %x sbcl %x sts %x msg %x\n",
sc->sc_dev.dv_xname, istat, dstat, sstat0,
rp->ssh_dsps, rp->ssh_sbcl,
@@ -1786,7 +1751,7 @@ sshintr (sc)
* not be correct for other 53c710 boards.
* XXX fix this - nivas
*/
-void
+void
scsi_period_to_ssh (sc, target)
struct ssh_softc *sc;
int target;
diff --git a/sys/arch/mvme88k/dev/sshdma.c b/sys/arch/mvme88k/dev/sshdma.c
index 176edc072c5..5254ab41824 100644
--- a/sys/arch/mvme88k/dev/sshdma.c
+++ b/sys/arch/mvme88k/dev/sshdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshdma.c,v 1.12 2003/06/02 23:27:52 millert Exp $ */
+/* $OpenBSD: sshdma.c,v 1.13 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
@@ -83,11 +83,11 @@ struct scsi_device afsc_scsidev = {
struct cfattach ssh_ca = {
sizeof(struct ssh_softc), afscmatch, afscattach,
-};
-
+};
+
struct cfdriver ssh_cd = {
- NULL, "ssh", DV_DULL, 0
-};
+ NULL, "ssh", DV_DULL, 0
+};
int
afscmatch(pdp, vcf, args)
@@ -96,7 +96,7 @@ afscmatch(pdp, vcf, args)
{
struct confargs *ca = args;
- if (badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) {
+ if (badvaddr((vaddr_t)IIOV(ca->ca_vaddr), 4)) {
return(0);
}
@@ -164,10 +164,9 @@ afscattach(parent, self, auxp)
*/
struct pcctworeg *pcc2 = (struct pcctworeg *)ca->ca_master;
-
- pmap_cache_ctrl(pmap_kernel(), trunc_page((vm_offset_t)sc),
- round_page((vm_offset_t)sc + sizeof(*sc)),
- CACHE_INH);
+
+ pmap_cache_ctrl(pmap_kernel(), trunc_page((vaddr_t)sc),
+ round_page((vaddr_t)sc + sizeof(*sc)), CACHE_INH);
pcctwointr_establish(PCC2V_NCR, &sc->sc_ih);
/* enable interrupts at ca_ipl */
@@ -184,7 +183,7 @@ afscattach(parent, self, auxp)
* (see dk_establish).
*/
tmp = bootpart;
- if (ca->ca_paddr != bootaddr)
+ if (ca->ca_paddr != bootaddr)
bootpart = -1; /* invalid flag to dk_establish */
config_found(self, &sc->sc_link, scsiprint);
bootpart = tmp; /* restore old value */
diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c
index c404f19efe5..0c206d0c8de 100644
--- a/sys/arch/mvme88k/dev/vme.c
+++ b/sys/arch/mvme88k/dev/vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.c,v 1.21 2003/09/28 22:14:33 miod Exp $ */
+/* $OpenBSD: vme.c,v 1.22 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -49,7 +49,7 @@
#include "syscon.h"
#include <mvme88k/dev/vme.h>
-#if NSYSCON > 0
+#if NSYSCON > 0
#include <mvme88k/dev/sysconreg.h>
#endif
@@ -72,11 +72,11 @@ struct vme2reg *sys_vme2 = NULL;
struct cfattach vme_ca = {
sizeof(struct vmesoftc), vmematch, vmeattach
-};
-
+};
+
struct cfdriver vme_cd = {
NULL, "vme", DV_DULL, 0
-};
+};
int
vmematch(parent, cf, args)
@@ -186,9 +186,9 @@ vmerw(sc, uio, flags, bus)
int flags;
int bus;
{
- register vm_offset_t v;
- register int c;
- register struct iovec *iov;
+ vaddr_t v;
+ int c;
+ struct iovec *iov;
void *vme;
int error = 0;
@@ -263,7 +263,7 @@ vmescan(parent, child, args, bustype)
oca.ca_len = 4096;
oca.ca_offset = (u_int)oca.ca_paddr;
- oca.ca_vaddr = vmemap(sc, (vm_offset_t)oca.ca_paddr, oca.ca_len,
+ oca.ca_vaddr = vmemap(sc, (vaddr_t)oca.ca_paddr, oca.ca_len,
oca.ca_bustype);
if (!oca.ca_vaddr)
oca.ca_vaddr = (void *)-1;
@@ -276,7 +276,7 @@ vmescan(parent, child, args, bustype)
}
/*
* If match works, the driver is responsible for
- * vmunmap()ing if it does not need the mapping.
+ * vmunmap()ing if it does not need the mapping.
*/
config_attach(parent, cf, &oca, vmeprint);
return (1);
@@ -358,12 +358,12 @@ vme_findvec(void)
*/
/*
- * All VME bus devices will use a vector starting with VBR1 + 0x10
- * and determined by intr_findvec(). (in machdep.c) vmeintr_establish()
- * should be called with the 'vec' argument = 0 to 'auto vector' a
+ * All VME bus devices will use a vector starting with VBR1 + 0x10
+ * and determined by intr_findvec(). (in machdep.c) vmeintr_establish()
+ * should be called with the 'vec' argument = 0 to 'auto vector' a
* VME device.
*
- * The 8 SW interrupters will start with VBR1. The rest will start
+ * The 8 SW interrupters will start with VBR1. The rest will start
* with VBR0< 4) & 0xFF.
*/
@@ -389,7 +389,7 @@ vmeintr_establish(vec, ih)
VME2_IRQ_VME(ih->ih_ipl);
break;
#endif
-#if NSYSCON > 0
+#if NSYSCON > 0
case BUS_SYSCON:
syscon = (struct sysconreg *)sc->sc_vaddr;
break;
@@ -459,11 +459,11 @@ vme2chip_init(sc)
/*
* Map the Software VME irq levels to the cpu level 7.
*/
- vme2->vme2_irql3 = (7 << VME2_IRQL3_SW7SHIFT) | (7 << VME2_IRQL3_SW6SHIFT) |
+ vme2->vme2_irql3 = (7 << VME2_IRQL3_SW7SHIFT) | (7 << VME2_IRQL3_SW6SHIFT) |
(7 << VME2_IRQL3_SW5SHIFT) | (7 << VME2_IRQL3_SW4SHIFT) |
- (7 << VME2_IRQL3_SW3SHIFT) | (7 << VME2_IRQL3_SW2SHIFT) |
+ (7 << VME2_IRQL3_SW3SHIFT) | (7 << VME2_IRQL3_SW2SHIFT) |
(7 << VME2_IRQL3_SW1SHIFT) | (7 << VME2_IRQL3_SW0SHIFT);
- /*
+ /*
* pseudo driver, abort interrupt handler
*/
sc->sc_abih.ih_fn = vme2abort;
@@ -499,7 +499,7 @@ vmesyscon_init(sc)
vme2->vme2_master2 << 16, vme2->vme2_master2 & 0xffff0000,
vme2->vme2_master2 << 16, vme2->vme2_master2 & 0xffff0000);
- /*
+ /*
* pseudo driver, abort interrupt handler
*/
sc->sc_abih.ih_fn = sysconabort;
@@ -561,7 +561,7 @@ vme2abort(eframe)
printf("%s: abort irq not set\n", sc->sc_dev.dv_xname);
return (0);
}
-#endif
+#endif
vme2->vme2_irqclr = VME2_IRQ_AB;
nmihand(frame);
return (1);
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c
index 46ecc7401cc..d8823ba4f4e 100644
--- a/sys/arch/mvme88k/dev/vs.c
+++ b/sys/arch/mvme88k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.19 2003/06/02 23:27:52 millert Exp $ */
+/* $OpenBSD: vs.c,v 1.20 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -79,20 +79,20 @@ void vs_copy(void *, void *, unsigned short);
void vs_zero(void *, u_long);
int do_vspoll(struct vs_softc *, int);
void thaw_queue(struct vs_softc *, u_int8_t);
-void vs_link_sg_element(sg_list_element_t *, vm_offset_t, int);
-void vs_link_sg_list(sg_list_element_t *, vm_offset_t, int);
+void vs_link_sg_element(sg_list_element_t *, vaddr_t, int);
+void vs_link_sg_list(sg_list_element_t *, vaddr_t, int);
static __inline__ void vs_clear_return_info(struct vs_softc *);
-/*
+/*
* 16 bit 's' memory functions. MVME328 is a D16 board.
* We must program with that in mind or else...
- * bcopy/bzero (the 'b' meaning byte) is implemented in
- * 32 bit operations for speed, so thay are not really
- * 'byte' operations at all!! MVME1x7 can be set up to
- * handle D32 -> D16 read/writes via VMEChip2 Address
+ * bcopy/bzero (the 'b' meaning byte) is implemented in
+ * 32 bit operations for speed, so thay are not really
+ * 'byte' operations at all!! MVME1x7 can be set up to
+ * handle D32 -> D16 read/writes via VMEChip2 Address
* modifiers, however MVME188 can not. These next two
- * function insure 16 bit copy/zero operations. The
+ * function insure 16 bit copy/zero operations. The
* structures are all implemented with 16 bit or less
* types. smurph
*/
@@ -102,16 +102,16 @@ vs_copy(src, dst, cnt)
void *src;
void *dst;
unsigned short cnt;
-{
- register unsigned short *volatile x, *volatile y;
- register unsigned short volatile z;
+{
+ unsigned short *volatile x, *volatile y;
+ unsigned short volatile z;
- z = cnt >> 1;
- x = (unsigned short *)src;
- y = (unsigned short *)dst;
+ z = cnt >> 1;
+ x = (unsigned short *)src;
+ y = (unsigned short *)dst;
while (z--) {
- *y++ = *x++;
+ *y++ = *x++;
}
}
@@ -120,12 +120,12 @@ vs_zero(src, cnt)
void *src;
u_long cnt;
{
- register unsigned short *source;
- register unsigned short zero = 0;
- register unsigned short z;
+ unsigned short *source;
+ unsigned short zero = 0;
+ unsigned short z;
source = (unsigned short *) src;
- z = cnt >> 1;
+ z = cnt >> 1;
while (z--) {
*source++ = zero;
@@ -146,7 +146,7 @@ vs_minphys(bp)
minphys(bp);
}
-int
+int
do_vspoll(sc, to)
struct vs_softc *sc;
int to;
@@ -209,7 +209,7 @@ vs_poll(sc, xs)
return (COMPLETE);
}
-void
+void
thaw_queue(sc, target)
struct vs_softc *sc;
u_int8_t target;
@@ -222,13 +222,13 @@ thaw_queue(sc, target)
while (THAW_REG & 0x01);
}
-void
+void
vs_scsidone (sc, xs, stat)
struct vs_softc *sc;
struct scsi_xfer *xs;
- int stat;
+ int stat;
{
- int tgt;
+ int tgt;
xs->status = stat;
while (xs->status == SCSI_CHECK) {
@@ -240,7 +240,7 @@ vs_scsidone (sc, xs, stat)
tgt = xs->sc_link->target + 1;
xs->flags |= ITSDONE;
/*sc->sc_tinfo[slp->target].cmds++;*/
-
+
/* thaw all work queues */
thaw_queue(sc, tgt);
scsi_done(xs);
@@ -298,7 +298,7 @@ vs_scsicmd(xs)
} else if (xs->cmd->opcode == 0x08) {
printf("READ_COMMAND ");
}
-#endif
+#endif
if (flags & SCSI_POLL) {
cqep = mc;
iopb = miopb;
@@ -328,15 +328,15 @@ vs_scsicmd(xs)
*/
if (xs->flags & SCSI_DATA_IN) { /* read */
#if defined(mvme88k)
- dma_cachectl((vm_offset_t)xs->data, xs->datalen,
+ dma_cachectl((vaddr_t)xs->data, xs->datalen,
DMA_CACHE_SYNC_INVAL);
-#endif
+#endif
iopb->iopb_OPTION |= OPT_READ;
} else { /* write */
#if defined(mvme88k)
- dma_cachectl((vm_offset_t)xs->data, xs->datalen,
+ dma_cachectl((vaddr_t)xs->data, xs->datalen,
DMA_CACHE_SYNC);
-#endif
+#endif
iopb->iopb_OPTION |= OPT_WRITE;
}
@@ -351,7 +351,7 @@ vs_scsicmd(xs)
/*
* Wait until we can use the command queue entry.
- * Should only have to wait if the master command
+ * Should only have to wait if the master command
* queue entry is busy and we are polling.
*/
while (cqep->cqe_QECR & M_QECR_GO);
@@ -381,10 +381,10 @@ vs_scsicmd(xs)
VL(buf, iopb->iopb_BUFF);
VL(len, iopb->iopb_LENGTH);
#ifdef SDEBUG
- printf("tgt %d lun %d buf %x len %d wqn %d ipl %d crsw 0x%x\n",
- slp->target, slp->lun, buf, len, cqep->cqe_WORK_QUEUE,
+ printf("tgt %d lun %d buf %x len %d wqn %d ipl %d crsw 0x%x\n",
+ slp->target, slp->lun, buf, len, cqep->cqe_WORK_QUEUE,
iopb->iopb_LEVEL, crb->crb_CRSW);
-#endif
+#endif
cqep->cqe_QECR |= M_QECR_GO;
if (flags & SCSI_POLL) {
@@ -426,12 +426,12 @@ vs_chksense(xs)
miopb->iopb_EVCT = (u_char)sc->sc_evec;
miopb->iopb_LEVEL = 0; /*sc->sc_ipl;*/
miopb->iopb_ADDR = ADDR_MOD;
- LV(miopb->iopb_BUFF, kvtop((vm_offset_t)&xs->sense));
+ LV(miopb->iopb_BUFF, kvtop((vaddr_t)&xs->sense));
LV(miopb->iopb_LENGTH, sizeof(struct scsi_sense_data));
vs_zero(mc, sizeof(M328_CQE));
mc->cqe_IOPB_ADDR = OFF(miopb);
- mc->cqe_IOPB_LENGTH = sizeof(M328_short_IOPB) +
+ mc->cqe_IOPB_LENGTH = sizeof(M328_short_IOPB) +
sizeof(struct scsi_sense);
mc->cqe_WORK_QUEUE = 0;
mc->cqe_QECR = M_QECR_GO;
@@ -446,7 +446,7 @@ vs_chksense(xs)
xs->status = riopb->iopb_STATUS >> 8;
#ifdef SDEBUG
scsi_print_sense(xs, 2);
-#endif
+#endif
splx(s);
}
@@ -603,7 +603,7 @@ vs_resync(sc)
{
M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE;
M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB;
- M328_DRCF *devreset = (M328_DRCF *)&sc->sc_vsreg->sh_MCE_IOPB;
+ M328_DRCF *devreset = (M328_DRCF *)&sc->sc_vsreg->sh_MCE_IOPB;
u_short i;
for (i=0; i<7; i++) {
vs_zero(devreset, sizeof(M328_DRCF));
@@ -624,7 +624,7 @@ vs_resync(sc)
if (riopb->iopb_STATUS) {
#ifdef SDEBUG
printf("status: %x\n", riopb->iopb_STATUS);
-#endif
+#endif
sc->sc_tinfo[i].avail = 0;
} else {
sc->sc_tinfo[i].avail = 1;
@@ -643,7 +643,7 @@ vs_reset(sc)
u_int s;
M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE;
M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB;
- M328_SRCF *reset = (M328_SRCF *)&sc->sc_vsreg->sh_MCE_IOPB;
+ M328_SRCF *reset = (M328_SRCF *)&sc->sc_vsreg->sh_MCE_IOPB;
vs_zero(reset, sizeof(M328_SRCF));
reset->srcf_CMD = IOPB_RESET;
@@ -761,7 +761,7 @@ vs_checkintr(sc, xs, status)
printf("[er]");
}
printf("\n");
-#endif
+#endif
if (len != xs->datalen) {
xs->resid = xs->datalen - len;
} else {
@@ -779,14 +779,14 @@ vs_checkintr(sc, xs, status)
/* normal interrupt routine */
int
vs_nintr(sc)
- register struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB;
M328_CMD *m328_cmd;
struct scsi_xfer *xs;
int status;
int s;
-
+
if ((CRSW & CONTROLLER_ERROR) == CONTROLLER_ERROR)
return(vs_eintr(sc));
@@ -798,10 +798,10 @@ vs_nintr(sc)
#ifdef SDEBUG
printf("Interrupt!!! ");
printf("m328_cmd == 0x%x\n", m328_cmd);
-#endif
+#endif
/*
* If this is a controller error, there won't be a m328_cmd
- * pointer in the CTAG feild. Bad things happen if you try
+ * pointer in the CTAG feild. Bad things happen if you try
* to point to address 0. Controller error should be handled
* in vsdma.c I'll change this soon - steve.
*/
@@ -828,7 +828,7 @@ vs_nintr(sc)
int
vs_eintr(sc)
- register struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_CEVSB *crb = (M328_CEVSB *)&sc->sc_vsreg->sh_CRB;
M328_CMD *m328_cmd;
@@ -841,17 +841,17 @@ vs_eintr(sc)
#endif
int ecode = crb->cevsb_ERROR;
int status, s;
-
+
s = splbio();
/* Got a valid interrupt on this device */
sc->sc_intrcnt_e.ev_count++;
-
+
VL((unsigned long)m328_cmd, crb->cevsb_CTAG);
#ifdef SDEBUG
printf("Error Interrupt!!! ");
printf("m328_cmd == 0x%x\n", m328_cmd);
-#endif
+#endif
xs = m328_cmd->xs;
if (crsw & M_CRSW_RST) {
@@ -895,9 +895,9 @@ vs_eintr(sc)
#endif
}
#ifdef SDEBUG
- printf("%s: crsw = 0x%x iopb_type = %d iopb_len = %d wq = %d error = 0x%x\n",
+ printf("%s: crsw = 0x%x iopb_type = %d iopb_len = %d wq = %d error = 0x%x\n",
vs_name(sc), crsw, type, length, wq, ecode);
-#endif
+#endif
if (CRSW & M_CRSW_ER)
CRB_CLR_ER(CRSW);
CRB_CLR_DONE(CRSW);
@@ -910,7 +910,7 @@ vs_eintr(sc)
static __inline__ void
vs_clear_return_info(sc)
- register struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB;
M328_CEVSB *crb = (M328_CEVSB *)&sc->sc_vsreg->sh_CRB;
@@ -937,7 +937,7 @@ void
vs_dealloc_scatter_gather(sg)
M328_SG sg;
{
- register int i;
+ int i;
if (sg->level > 0) {
for (i=0; sg->down[i] && i<MAX_SG_ELEMENTS; i++) {
@@ -950,8 +950,8 @@ vs_dealloc_scatter_gather(sg)
void
vs_link_sg_element(element, phys_add, len)
sg_list_element_t *element;
- register vm_offset_t phys_add;
- register int len;
+ vaddr_t phys_add;
+ int len;
{
element->count.bytes = len;
LV(element->address, phys_add);
@@ -964,8 +964,8 @@ vs_link_sg_element(element, phys_add, len)
void
vs_link_sg_list(list, phys_add, elements)
sg_list_element_t *list;
- register vm_offset_t phys_add;
- register int elements;
+ vaddr_t phys_add;
+ int elements;
{
list->count.scatter.gather = elements;
@@ -976,13 +976,13 @@ vs_link_sg_list(list, phys_add, elements)
list->address_modifier = 0xD;
}
-M328_SG
+M328_SG
vs_build_memory_structure(xs, iopb)
struct scsi_xfer *xs;
M328_IOPB *iopb; /* the iopb */
{
M328_SG sg;
- vm_offset_t starting_point_virt, starting_point_phys, point_virt,
+ vaddr_t starting_point_virt, starting_point_phys, point_virt,
point1_phys, point2_phys, virt;
unsigned len;
int level;
@@ -1001,8 +1001,8 @@ vs_build_memory_structure(xs, iopb)
*/
level = 0;
- virt = starting_point_virt = (vm_offset_t)xs->data;
- point1_phys = starting_point_phys = kvtop((vm_offset_t)xs->data);
+ virt = starting_point_virt = (vaddr_t)xs->data;
+ point1_phys = starting_point_phys = kvtop((vaddr_t)xs->data);
len = xs->datalen;
/*
* Check if we need scatter/gather
@@ -1011,7 +1011,7 @@ vs_build_memory_structure(xs, iopb)
if (len > PAGE_SIZE) {
for (level = 0, point_virt = round_page(starting_point_virt+1);
/* if we do already scatter/gather we have to stay in the loop and jump */
- point_virt < virt + (vm_offset_t)len || sg ;
+ point_virt < virt + (vaddr_t)len || sg ;
point_virt += PAGE_SIZE) { /* out later */
point2_phys = kvtop(point_virt);
@@ -1045,34 +1045,34 @@ vs_build_memory_structure(xs, iopb)
sg->up->elements = 1;
}
/* link this full list also in physical memory */
- vs_link_sg_list(&(sg->up->list[sg->up->elements-1]),
- kvtop((vm_offset_t)sg->list),
+ vs_link_sg_list(&(sg->up->list[sg->up->elements-1]),
+ kvtop((vaddr_t)sg->list),
sg->elements);
sg = sg->up; /* Climb up */
}
while (sg->level) { /* As long as we are not a the base level */
- register int i;
+ int i;
i = sg->elements;
/* We need a new element */
- sg->down[i] = vs_alloc_scatter_gather();
+ sg->down[i] = vs_alloc_scatter_gather();
sg->down[i]->level = sg->level - 1;
sg->down[i]->up = sg;
sg->elements++;
sg = sg->down[i]; /* Climb down */
}
#endif /* 1 */
- if (point_virt < virt+(vm_offset_t)len) {
+ if (point_virt < virt+(vaddr_t)len) {
/* linking element */
- vs_link_sg_element(&(sg->list[sg->elements]),
- starting_point_phys,
+ vs_link_sg_element(&(sg->list[sg->elements]),
+ starting_point_phys,
point_virt-starting_point_virt);
sg->elements++;
} else {
/* linking last element */
- vs_link_sg_element(&(sg->list[sg->elements]),
- starting_point_phys,
- (vm_offset_t)(virt+len)-starting_point_virt);
+ vs_link_sg_element(&(sg->list[sg->elements]),
+ starting_point_phys,
+ (vaddr_t)(virt+len)-starting_point_virt);
sg->elements++;
break; /* We have now collected all blocks */
}
@@ -1090,15 +1090,15 @@ vs_build_memory_structure(xs, iopb)
if (sg) {
while (sg->up) {
/* link this list also in physical memory */
- vs_link_sg_list(&(sg->up->list[sg->up->elements-1]),
- kvtop((vm_offset_t)sg->list),
+ vs_link_sg_list(&(sg->up->list[sg->up->elements-1]),
+ kvtop((vaddr_t)sg->list),
sg->elements);
sg = sg->up; /* Climb up */
}
iopb->iopb_OPTION |= M_OPT_SG;
iopb->iopb_ADDR |= M_ADR_SG_LINK;
- LV(iopb->iopb_BUFF, kvtop((vm_offset_t)sg->list));
+ LV(iopb->iopb_BUFF, kvtop((vaddr_t)sg->list));
LV(iopb->iopb_LENGTH, sg->elements);
LV(iopb->iopb_SGTTL, len);
} else {
diff --git a/sys/arch/mvme88k/dev/vsvar.h b/sys/arch/mvme88k/dev/vsvar.h
index b9092a65db9..aa2de282d66 100644
--- a/sys/arch/mvme88k/dev/vsvar.h
+++ b/sys/arch/mvme88k/dev/vsvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsvar.h,v 1.6 2003/06/02 23:27:52 millert Exp $ */
+/* $OpenBSD: vsvar.h,v 1.7 2003/10/05 20:27:48 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1990 The Regents of the University of California.
@@ -43,7 +43,7 @@
#define DMAMAXIO (MAXPHYS/NBPG+1)
#define LO(x) (u_short)((unsigned long)x & 0x0000FFFF)
#define HI(x) (u_short)((unsigned long)x >> 16)
-#define OFF(x) (u_short)((long)kvtop((vm_offset_t)x) - (long)kvtop((vm_offset_t)sc->sc_vsreg))
+#define OFF(x) (u_short)((long)kvtop((vaddr_t)x) - (long)kvtop((vaddr_t)sc->sc_vsreg))
#define vs_name(sc) (sc)->sc_dev.dv_xname
/**************** Scater/Gather Stuff *******************/
@@ -62,12 +62,12 @@ typedef struct {
unsigned short :3;
unsigned short transfer_type :2;
/* 0x0 is reserved */
- #define SHORT_TREANSFER 0x1
- #define LONG_TRANSFER 0x2
- #define SCATTER_GATTER_LIST_IN_SHORT_IO 0x3
+ #define SHORT_TREANSFER 0x1
+ #define LONG_TRANSFER 0x2
+ #define SCATTER_GATTER_LIST_IN_SHORT_IO 0x3
unsigned short memory_type :2;
- #define NORMAL_TYPE 0x0
- #define BLOCK_MODE 0x1
+ #define NORMAL_TYPE 0x0
+ #define BLOCK_MODE 0x1
/* 0x2 is reserved */
/* 0x3 is reserved */
unsigned short address_modifier :8;
@@ -180,11 +180,11 @@ int vs_scsicmd(struct scsi_xfer *);
M328_SG vs_alloc_scatter_gather(void);
void vs_dealloc_scatter_gather(M328_SG sg);
void vs_link_scatter_gather_element(sg_list_element_t *element,
- register vm_offset_t phys_add,
- register int len);
+ vaddr_t phys_add,
+ int len);
void vs_link_scatter_gather_list(sg_list_element_t *list,
- register vm_offset_t phys_add,
- register int elements);
+ vaddr_t phys_add,
+ int elements);
M328_SG vs_build_memory_structure(struct scsi_xfer *xs, M328_IOPB *iopb);
#endif /* _M328VAR_H */
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index 2362ddc4fc1..4924a266fe8 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: vx.c,v 1.22 2003/08/15 20:32:14 tedu Exp $ */
+/* $OpenBSD: vx.c,v 1.23 2003/10/05 20:27:48 miod Exp $ */
/*
- * Copyright (c) 1999 Steve Murphree, Jr.
+ * Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ */
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -150,14 +150,14 @@ int create_free_queue(struct vxsoftc *);
void print_dump(struct vxsoftc *);
struct envelope *get_cmd_tail(struct vxsoftc *);
-struct cfattach vx_ca = {
+struct cfattach vx_ca = {
sizeof(struct vxsoftc), vxmatch, vxattach
-};
+};
struct cfdriver vx_cd = {
NULL, "vx", DV_TTY, 0
-};
-
+};
+
#define VX_UNIT(x) (int)(minor(x) / 9)
#define VX_PORT(x) (int)(minor(x) % 9)
@@ -170,7 +170,7 @@ struct tty * vxtty(dev)
int unit, port;
struct vxsoftc *sc;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (NULL);
}
@@ -178,7 +178,7 @@ struct tty * vxtty(dev)
return sc->sc_info[port].tty;
}
-int
+int
vxmatch(parent, self, aux)
struct device *parent;
void *self;
@@ -186,7 +186,7 @@ vxmatch(parent, self, aux)
{
struct vxreg *vx_reg;
struct confargs *ca = aux;
-
+
#ifdef OLD_MAPPINGS
ca->ca_vaddr = ca->ca_paddr;
#endif
@@ -208,21 +208,21 @@ vxattach(parent, self, aux)
{
struct vxsoftc *sc = (struct vxsoftc *)self;
struct confargs *ca = aux;
-
+
/* set up dual port memory and registers and init*/
sc->vx_reg = (struct vxreg *)ca->ca_vaddr;
sc->channel = (struct channel *)(ca->ca_vaddr + 0x0100);
#if defined(MVME187) || defined(MVME197)
sc->sc_vme2 = ca->ca_master;
-#endif
- sc->sc_ipl = ca->ca_ipl;
- sc->sc_vec = ca->ca_vec;
+#endif
+ sc->sc_ipl = ca->ca_ipl;
+ sc->sc_vec = ca->ca_vec;
sc->board_addr = (unsigned int)ca->ca_vaddr;
printf("\n");
if (create_channels(sc)) {
- printf("%s: failed to create channel %d\n", sc->sc_dev.dv_xname,
+ printf("%s: failed to create channel %d\n", sc->sc_dev.dv_xname,
sc->channel->channel_number);
return;
}
@@ -408,7 +408,7 @@ int vxopen (dev, flag, mode, p)
unit = VX_UNIT(dev);
port = VX_PORT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -431,7 +431,7 @@ int vxopen (dev, flag, mode, p)
#ifdef DEBUG_VXT
printf("unit %d, port %d, ", unit, port);
printf("error = %d\n", opkt.error_l);
-#endif
+#endif
return (ENODEV);
}
@@ -442,7 +442,7 @@ int vxopen (dev, flag, mode, p)
if (vxt->tty) {
tp = vxt->tty;
} else {
- tp = vxt->tty = ttymalloc();
+ tp = vxt->tty = ttymalloc();
}
/* set line status */
@@ -506,7 +506,7 @@ int vxopen (dev, flag, mode, p)
return ((*linesw[tp->t_line].l_open)(dev, tp));
}
-int
+int
vx_param(tp, t)
struct tty *tp;
struct termios *t;
@@ -517,7 +517,7 @@ vx_param(tp, t)
dev = tp->t_dev;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -530,7 +530,7 @@ vx_param(tp, t)
return 0;
}
-int
+int
vxclose (dev, flag, mode, p)
dev_t dev;
int flag;
@@ -544,7 +544,7 @@ vxclose (dev, flag, mode, p)
int s;
struct close_packet cpkt;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -579,7 +579,7 @@ vxclose (dev, flag, mode, p)
return (0);
}
-void
+void
read_wakeup(sc, port)
struct vxsoftc *sc;
int port;
@@ -587,8 +587,8 @@ read_wakeup(sc, port)
struct read_wakeup_packet rwp;
struct vx_info *volatile vxt;
vxt = &sc->sc_info[port];
- /*
- * If we already have a read_wakeup paket
+ /*
+ * If we already have a read_wakeup paket
* for this port, do nothing.
*/
if (vxt->read_pending) {
@@ -609,13 +609,13 @@ read_wakeup(sc, port)
/*
* Do not wait. Characters will be transferred
- * to (*linesw[tp->t_line].l_rint)(c,tp); by
+ * to (*linesw[tp->t_line].l_rint)(c,tp); by
* vx_intr() (IPC will notify via interrupt)
*/
bpp_send(sc, &rwp, NOWAIT);
}
-int
+int
vxread (dev, uio, flag)
dev_t dev;
struct uio *uio;
@@ -627,7 +627,7 @@ vxread (dev, uio, flag)
struct vxsoftc *volatile sc;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -638,7 +638,7 @@ vxread (dev, uio, flag)
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
-int
+int
vxwrite (dev, uio, flag)
dev_t dev;
struct uio *uio;
@@ -653,7 +653,7 @@ vxwrite (dev, uio, flag)
u_short get, put;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -706,7 +706,7 @@ vxwrite (dev, uio, flag)
}
}
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
-}
+}
int
vxioctl (dev, cmd, data, flag, p)
@@ -722,7 +722,7 @@ vxioctl (dev, cmd, data, flag, p)
struct vx_info *vxt;
struct vxsoftc *sc;
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return (ENODEV);
}
@@ -778,7 +778,7 @@ vxioctl (dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
@@ -968,7 +968,7 @@ vx_ccparam(sc, par, port)
else lflag &= ~VICANON;
if (par->c_lflag & ISIG) lflag |= VISIG;
else lflag &= ~VISIG;
-#endif
+#endif
pkt.command = CMD_IOCTL;
pkt.ioctl_cmd_l = IOCTL_TCSETA;
pkt.command_pipe_number = sc->channel_number;
@@ -1008,7 +1008,7 @@ vxstart(tp)
dev = tp->t_dev;
port = VX_PORT(dev);
unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
+ if (unit >= vx_cd.cd_ndevs ||
(sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
return;
}
@@ -1038,16 +1038,16 @@ vxstart(tp)
return;
}
-void
+void
read_chars(sc, port)
struct vxsoftc *sc;
int port;
{
- /*
+ /*
* This routine is called by vx_intr() when there are
- * characters in the read ring. It will process one
+ * characters in the read ring. It will process one
* cooked line, put the chars in the line disipline ring,
- * and then return. The characters may then
+ * and then return. The characters may then
* be read by vxread.
*/
struct vx_info *vxt;
@@ -1066,7 +1066,7 @@ read_chars(sc, port)
#ifdef DEBUG_VXT
printf("read_chars() get=%d, put=%d ", get, put);
printf("open = %d ring at 0x%x\n", open, rp);
-#endif
+#endif
while (get != put) {
frame_count = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
rp->get &= (RRING_BUF_SIZE - 1);
@@ -1122,7 +1122,6 @@ vx_intr(arg)
if (vme2->vme2_vbr & VME2_SYSFAIL) {
/* do something... print_dump(sc); */
-
}
#endif /* defined(MVME187) || defined(MVME197) */
if (!cold) sc->sc_intrcnt.ev_count++;
@@ -1132,7 +1131,7 @@ vx_intr(arg)
valid = env_isvalid(get_status_head(sc));
cmd = pktp->command;
port = pktp->device_number;
- /* if we are waiting on this packet, strore the info so bpp_send
+ /* if we are waiting on this packet, strore the info so bpp_send
can process the packet */
if (sc->sc_bppwait_pktp == pktp)
memcpy2(&sc->sc_bppwait_pkt, pktp, sizeof(struct packet));
@@ -1149,34 +1148,34 @@ vx_intr(arg)
switch (cmd) {
case CMD_READW:
#ifdef DEBUG_VXT
- printf("READW Packet\n");
-#endif
- read_chars(sc, port);
+ printf("READW Packet\n");
+#endif
+ read_chars(sc, port);
return 1;
break;
case CMD_WRITEW:
#ifdef DEBUG_VXT
printf("WRITEW Packet\n"); /* Still don't know XXXsmurph */
-#endif
+#endif
return 1;
break;
case CMD_EVENT:
#ifdef DEBUG_VXT
- printf("EVENT Packet\n");
-#endif
+ printf("EVENT Packet\n");
+#endif
vx_event(sc, &pkt);
return 1;
break;
case CMD_PROCCESED:
#ifdef DEBUG_VXT
printf("CMD_PROCCESED Packet\n");
-#endif
+#endif
return 1;
break;
default:
#ifdef DEBUG_VXT
- printf("Other packet 0x%x\n", cmd);
-#endif
+ printf("Other packet 0x%x\n", cmd);
+#endif
return 1;
break;
}
@@ -1184,7 +1183,7 @@ vx_intr(arg)
return 1;
}
-int
+int
vx_event(sc, evntp)
struct vxsoftc *sc;
struct packet *evntp;
@@ -1225,19 +1224,15 @@ vx_event(sc, evntp)
}
if (code & E_PR_FAULT) {
/* do something... */
-
}
if (code & E_PR_POUT) {
/* do something... */
-
}
if (code & E_PR_SELECT) {
/* do something... */
-
}
if (code & E_SWITCH) {
/* do something... */
-
}
if (code & E_BREAK) {
vx_break (sc, evntp->device_number);
@@ -1300,27 +1295,25 @@ vx_break (sc, port)
void
memcpy2(void *dest, const void *src, size_t size)
{
- int i;
- short *d, *s;
- d = (short *) dest;
- s = (short *) src;
- for (i=0; i<(size/2); i++) {
- *d = *s;
- d++;
- s++;
- }
+ size_t i;
+ u_int16_t *d, *s;
+
+ d = (u_int16_t *)dest;
+ s = (u_int16_t *)src;
+ size /= 2;
+ for (i = 0; i < size; i++)
+ *d++ = *s++;
}
void
wzero(void *addr, size_t size)
{
- int i;
- short *d;
- d = (short *) addr;
- for (i=0; i<(size/2); i++) {
- *d = 0;
- d++;
- }
+ u_int16_t *d;
+
+ d = (u_int16_t *)addr;
+ size /= 2;
+ while (size-- != 0)
+ *d++ = 0;
}
int
@@ -1362,7 +1355,7 @@ create_free_queue(sc)
}
void *
-get_free_envelope(sc)
+get_free_envelope(sc)
struct vxsoftc *sc;
{
void *envp;
@@ -1373,7 +1366,7 @@ get_free_envelope(sc)
return envp;
}
-void
+void
put_free_envelope(sc, ep)
struct vxsoftc *sc;
void * ep;
@@ -1385,7 +1378,7 @@ put_free_envelope(sc, ep)
sc->elist_tail = envp;
}
-void *
+void *
get_free_packet(sc)
struct vxsoftc *sc;
{
@@ -1397,7 +1390,7 @@ get_free_packet(sc)
return pktp;
}
-void
+void
put_free_packet(sc, pp)
struct vxsoftc *sc;
void *pp;
@@ -1410,12 +1403,12 @@ put_free_packet(sc, pp)
sc->plist_tail = pktp;
}
-/*
+/*
* This is the nitty gritty. All the rest if this code
- * was hell to come by. Getting this right from the
- * Moto manual took *time*!
+ * was hell to come by. Getting this right from the
+ * Moto manual took *time*!
*/
-int
+int
create_channels(sc)
struct vxsoftc *sc;
{
@@ -1450,7 +1443,7 @@ create_channels(sc)
sc->channel->datasize = 0; /* 32 bit data mode */
/* loop until TAS bit is zero */
- while ((ipc_csr->ipc_tas & IPC_TAS_TAS));
+ while ((ipc_csr->ipc_tas & IPC_TAS_TAS));
ipc_csr->ipc_tas |= IPC_TAS_TAS;
/* load address of channel header */
ipc_csr->ipc_addrh = HI(sc->channel);
@@ -1477,29 +1470,29 @@ create_channels(sc)
/* check and see if the channel was created */
if (!status && sc->channel->valid) {
sc->channel_number = sc->channel->channel_number;
- printf("%s: created channel %d\n", sc->sc_dev.dv_xname,
+ printf("%s: created channel %d\n", sc->sc_dev.dv_xname,
sc->channel->channel_number);
return 0;
} else {
switch (status) {
case 0x0000:
- printf("%s: channel not valid\n",
+ printf("%s: channel not valid\n",
sc->sc_dev.dv_xname);
break;
case 0xFFFF:
- printf("%s: invalid CSR command\n",
+ printf("%s: invalid CSR command\n",
sc->sc_dev.dv_xname);
break;
case 0xC000:
- printf("%s: could not read channel structure\n",
+ printf("%s: could not read channel structure\n",
sc->sc_dev.dv_xname);
break;
case 0x8000:
- printf("%s: could not write channel structure\n",
+ printf("%s: could not write channel structure\n",
sc->sc_dev.dv_xname);
break;
default:
- printf("%s: unknown IPC CSR command error 0x%x\n",
+ printf("%s: unknown IPC CSR command error 0x%x\n",
sc->sc_dev.dv_xname, status);
break;
}
@@ -1528,7 +1521,7 @@ get_next_envelope(thisenv)
return ((void *)thisenv->link);
}
-int
+int
env_isvalid(thisenv)
struct envelope *thisenv;
{
@@ -1537,7 +1530,7 @@ env_isvalid(thisenv)
struct envelope *
get_cmd_tail(sc)
- struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
unsigned long retaddr;
retaddr = (unsigned long)sc->vx_reg;
@@ -1562,7 +1555,6 @@ set_status_head(sc, envp)
{
sc->channel->status_pipe_head_ptr_h = HI(envp);
sc->channel->status_pipe_head_ptr_l = LO(envp);
- return;
}
struct packet *
@@ -1570,15 +1562,15 @@ get_packet(sc, thisenv)
struct vxsoftc *sc;
struct envelope *thisenv;
{
- unsigned long baseaddr;
+ unsigned long baseaddr;
if (thisenv == NULL) return NULL;
baseaddr = (unsigned long)sc->vx_reg;
- /*
+ /*
* packet ptr returned on status pipe is only last two bytes
* so we must supply the full address based on the board address.
* This also works for all envelopes because every address is an
- * offset to the board address
+ * offset to the board address
*/
baseaddr |= thisenv->packet_ptr;
return ((void *)baseaddr);
@@ -1587,7 +1579,7 @@ get_packet(sc, thisenv)
/*
* Send a command via BPP
*/
-int
+int
bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag)
{
struct envelope *envp;
@@ -1612,7 +1604,7 @@ bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag)
while (pktp->command != CMD_PROCCESED) {
#ifdef DEBUG_VXT
printf("Polling for packet 0x%x in envelope 0x%x...\n", pktp, envp);
-#endif
+#endif
vx_intr(sc);
delay(5000);
}
@@ -1626,7 +1618,7 @@ bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag)
* BPP commands
*/
-int
+int
vx_init(sc)
struct vxsoftc *sc;
{
@@ -1656,7 +1648,7 @@ vx_init(sc)
sc->sc_info[i].rringp = rringp;
#ifdef DEBUG_VXT
printf("write at 0x%8x, read at 0x%8x\n", wringp, rringp);
-#endif
+#endif
infp->write_ring_size = WRING_DATA_SIZE;
infp->read_ring_size = RRING_DATA_SIZE;
infp->def_termio.c_iflag = VBRKINT;