summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-03-07 23:47:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-03-07 23:47:21 +0000
commit384981bf96fb733f99a8350577cfd75862b56aba (patch)
tree96724d181f6b1353054b742b4bad55cbe9588801 /sys/arch
parent913ce7549ef6db4471bd3b649865ee38e6ededee (diff)
Remove 68k-isms, fix interrupt handler prototypes, warning hunting.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/dev/ssh.c56
-rw-r--r--sys/arch/mvme88k/dev/sshdma.c71
2 files changed, 48 insertions, 79 deletions
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index f029e67f2a2..6be20e2d605 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.1 2001/03/07 01:57:56 miod Exp $ */
+/* $OpenBSD: ssh.c,v 1.2 2001/03/07 23:47:20 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -50,21 +50,18 @@
#include <sys/dkstat.h>
#include <sys/buf.h>
#include <sys/malloc.h>
+
+#include <vm/pmap.h>
+
+#include <machine/autoconf.h>
+#include <machine/mmu.h>
+#include <machine/pmap.h>
+
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-#include <machine/autoconf.h>
-#if defined(MVME187)
+
#include <mvme88k/dev/sshreg.h>
#include <mvme88k/dev/sshvar.h>
-#else
-#include <mvme68k/dev/sshreg.h>
-#include <mvme68k/dev/sshvar.h>
-#endif /* MVME187 */
-
-#if defined(MVME187)
-#include "machine/mmu.h"
-#endif /* defined(MVME187) */
-
extern u_int kvtop();
@@ -90,14 +87,11 @@ int sshintr __P((struct ssh_softc *));
void scsi_period_to_ssh __P((struct ssh_softc *, int));
void ssh_start __P((struct ssh_softc *, int, int, u_char *, int, u_char *, int));
void ssh_dump_acb __P((struct ssh_acb *));
+void sshinitialize __P((struct ssh_softc *sc));
/* 53C710 script */
const
-#if defined(MVME187)
#include <mvme88k/dev/ssh_script.out>
-#else
-#include <mvme68k/dev/ssh_script.out>
-#endif /* MVME187 */
u_long scsi_nosync = 0;
int shift_nosync;
@@ -189,6 +183,8 @@ int kludge_city = 1;
/*
* dummy routine to debug while loops
*/
+void wdummy __P((void));
+
void
wdummy(void)
{
@@ -224,7 +220,7 @@ ssh_scsicmd(xs)
struct ssh_acb *acb;
struct ssh_softc *sc;
struct scsi_link *slp;
- int flags, s, i;
+ int flags, s;
slp = xs->sc_link;
sc = slp->adapter_softc;
@@ -259,7 +255,6 @@ ssh_scsicmd(xs)
acb->daddr = xs->data;
acb->dleft = xs->datalen;
-#if defined(MVME187)
/*
* Since the 187 doesn't support cache snooping, we have
* to flush the cache for a write and flush with inval for
@@ -273,7 +268,7 @@ ssh_scsicmd(xs)
dma_cachectl((vm_offset_t)xs->data, xs->datalen,
DMA_CACHE_SYNC);
}
-#endif
+
s = splbio();
TAILQ_INSERT_TAIL(&sc->ready_list, acb, chain);
@@ -360,7 +355,7 @@ ssh_sched(sc)
{
struct scsi_link *slp;
struct ssh_acb *acb;
- int stat, i;
+ int i;
#ifdef DEBUG
if (sc->sc_nexus) {
@@ -413,7 +408,7 @@ ssh_scsidone(acb, stat)
struct scsi_xfer *xs = acb->xs;
struct scsi_link *slp = xs->sc_link;
struct ssh_softc *sc = slp->adapter_softc;
- int s, dosched = 0;
+ int dosched = 0;
if (acb == NULL || (xs = acb->xs) == NULL) {
#ifdef DIAGNOSTIC
@@ -527,7 +522,9 @@ sshabort(sc, rp, where)
ssh_regmap_p rp;
char *where;
{
+#ifdef fix_this
int i;
+#endif
printf ("%s: abort %s: dstat %02x, sstat0 %02x sbcl %02x\n",
sc->sc_dev.dv_xname,
@@ -698,7 +695,7 @@ sshreset(sc)
sc->sc_nexus->xs->error = XS_DRIVER_STUFFUP;
ssh_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]);
}
- while (acb = sc->nexus_list.tqh_first) {
+ while ((acb = sc->nexus_list.tqh_first) != NULL) {
acb->xs->error = XS_DRIVER_STUFFUP;
ssh_scsidone(acb, acb->stat[0]);
}
@@ -731,7 +728,6 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
int len;
{
ssh_regmap_p rp = sc->sc_sshp;
- int i;
int nchain;
int count, tcount;
char *addr, *dmaend;
@@ -842,6 +838,8 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
}
#ifdef DEBUG
if (nchain != 1 && len != 0 && ssh_debug & 3) {
+ int i;
+
printf ("DMA chaining set: %d\n", nchain);
for (i = 0; i < nchain; ++i) {
printf (" [%d] %8x %4x\n", i, acb->ds.chain[i].databuf,
@@ -857,7 +855,6 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
#endif
dma_cachectl((vm_offset_t)cbuf, clen, DMA_CACHE_SYNC);
-#if defined(MVME187)
/*
* Flushing the buf from data cache is very important for MVME187
* since the board does not snoop the local bus.
@@ -872,7 +869,6 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
dma_cachectl((vm_offset_t)buf, len, DMA_CACHE_SYNC);
}
}
-#endif
#ifdef DEBUG
if (ssh_debug & 0x100 && rp->ssh_sbcl & SSH_BSY) {
@@ -928,7 +924,9 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
struct ssh_acb *acb = sc->sc_nexus;
int target = 0;
int dfifo, dbc, sstat1;
+#ifdef DEBUG
int dummy;
+#endif
dfifo = rp->ssh_dfifo;
dbc = rp->ssh_dbc0;
@@ -1356,7 +1354,9 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
return (0);
}
if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff04) {
+#ifdef DEBUG
u_short ctest2 = rp->ssh_ctest2;
+#endif
/* reselect was interrupted (by Sig_P or select) */
#ifdef DEBUG
@@ -1627,7 +1627,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
rp->ssh_dsp, *((long *)&rp->ssh_dcmd),
rp->ssh_dsps);
- if (*((long *)&rp->ssh_dcmd) & 0xf8000000 == 0x48000000) { /* wait disconnect */
+ if ((*((long *)&rp->ssh_dcmd) & 0xf8000000) == 0x48000000) { /* wait disconnect */
printf("SSH was executing wait disconnect\n");
}
}
@@ -1721,7 +1721,7 @@ sshintr (sc)
if ((istat & (SSH_ISTAT_SIP | SSH_ISTAT_DIP)) == 0) {
/* is this possible? we won't come here if there is not int!!! XXX */
splx(s);
- return;
+ return (0);
}
/* Got a valid interrupt on this device */
@@ -1785,6 +1785,8 @@ sshintr (sc)
}
}
splx(s);
+
+ return (1);
}
/*
diff --git a/sys/arch/mvme88k/dev/sshdma.c b/sys/arch/mvme88k/dev/sshdma.c
index 14b892a5fa4..57ee1ad2785 100644
--- a/sys/arch/mvme88k/dev/sshdma.c
+++ b/sys/arch/mvme88k/dev/sshdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshdma.c,v 1.1 2001/03/07 01:57:56 miod Exp $ */
+/* $OpenBSD: sshdma.c,v 1.2 2001/03/07 23:47:20 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
@@ -42,41 +42,26 @@
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
-#include <scsi/scsi_all.h>
-#include <scsi/scsiconf.h>
+
+#include <vm/pmap.h>
+
#include <machine/autoconf.h>
-#if defined(MVME187)
#include <machine/board.h>
-#endif /* MVME187 */
+#include <machine/mmu.h>
+#include <machine/pmap.h>
+
+#include <scsi/scsi_all.h>
+#include <scsi/scsiconf.h>
-#if defined(MVME187)
#include <mvme88k/dev/sshreg.h>
#include <mvme88k/dev/sshvar.h>
-#else
-#include <mvme68k/dev/sshreg.h>
-#include <mvme68k/dev/sshvar.h>
-#endif /* defined(MVME187) */
-
-#if !defined(MVME187)
-#include "mc.h"
-#endif /* MVME187 */
-#include "pcctwo.h"
-#if NMC > 0
-#include <mvme68k/dev/mcreg.h>
-#endif
+#include "pcctwo.h"
#if NPCCTWO > 0
-#if defined(MVME187)
+#include <mvme88k/dev/pcctwofunc.h>
#include <mvme88k/dev/pcctworeg.h>
-#else
-#include <mvme68k/dev/pcctworeg.h>
-#endif /* defined(MVME187) */
#endif
-#if defined(MVME187)
-#include "machine/mmu.h"
-#endif /* defined(MVME187) */
-
extern struct pmap kernel_pmap_store;
#define pmap_kernel() (&kernel_pmap_store)
@@ -85,7 +70,7 @@ void afscattach __P((struct device *, struct device *, void *));
int afscprint __P((void *auxp, char *));
int sshintr __P((struct ssh_softc *));
-int afsc_dmaintr __P((struct ssh_softc *));
+int afsc_dmaintr __P((void *));
struct scsi_adapter afsc_scsiswitch = {
ssh_scsicmd,
@@ -114,11 +99,10 @@ afscmatch(pdp, vcf, args)
struct device *pdp;
void *vcf, *args;
{
- struct cfdata *cf = vcf;
struct confargs *ca = args;
int ret;
- if ((ret = badvaddr(IIOV(ca->ca_vaddr), 4)) <=0){
+ if ((ret = badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) <=0){
printf("==> ssh: failed address check returning %ld.\n", ret);
return(0);
}
@@ -145,11 +129,6 @@ afscattach(parent, self, auxp)
* XXX does the clock frequency change for the 33MHz processors?
*/
sc->sc_clock_freq = cpuspeed * 2;
-#ifdef MVME177
- /* XXX this is a guess! */
- if (cputyp == CPU_177)
- sc->sc_clock_freq = cpuspeed;
-#endif
sc->sc_dcntl = SSH_DCNTL_EA;
/*X*/ if (sc->sc_clock_freq <= 25)
/*X*/ sc->sc_dcntl |= (2 << 6);
@@ -162,14 +141,10 @@ afscattach(parent, self, auxp)
sc->sc_ctest0 = SSH_CTEST0_BTD | SSH_CTEST0_EAN;
-#ifdef MVME187
/*
* MVME187 doesn't implement snooping...
*/
sc->sc_ctest7 = SSH_CTEST7_TT1;
-#else
- sc->sc_ctest7 = SSH_CTEST7_SNOOP | SSH_CTEST7_TT1 | SSH_CTEST7_STD;
-#endif /* MVME187 */
sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter_target = 7; /* XXXX should ask ROM */
@@ -179,25 +154,15 @@ afscattach(parent, self, auxp)
sc->sc_ih.ih_fn = afsc_dmaintr;
sc->sc_ih.ih_arg = sc;
+ sc->sc_ih.ih_wantframe = 0;
sc->sc_ih.ih_ipl = ca->ca_ipl;
sshinitialize(sc);
switch (ca->ca_bustype) {
-#if NMC > 0
- case BUS_MC:
- {
- struct mcreg *mc = (struct mcreg *)ca->ca_master;
-
- mcintr_establish(MCV_NCR, &sc->sc_ih);
- mc->mc_ncrirq = ca->ca_ipl | MC_IRQ_IEN;
- break;
- }
-#endif
#if NPCCTWO > 0
case BUS_PCCTWO:
{
-#if defined(MVME187)
/*
* Disable caching for the softc. Actually, I want
* to disable cache for acb structures, but they are
@@ -210,7 +175,7 @@ afscattach(parent, self, auxp)
pmap_cache_ctrl(pmap_kernel(), M88K_TRUNC_PAGE((vm_offset_t)sc),
M88K_ROUND_PAGE((vm_offset_t)sc + sizeof(*sc)),
CACHE_INH);
-#endif
+
pcctwointr_establish(PCC2V_NCR, &sc->sc_ih);
/* intr_establish(PCC2_VECT + SCSIIRQ, &sc->sc_ih);*/
/* enable interrupts at ca_ipl */
@@ -247,9 +212,11 @@ afscprint(auxp, pnp)
}
int
-afsc_dmaintr(sc)
- struct ssh_softc *sc;
+afsc_dmaintr(arg)
+ void *arg;
{
+ struct ssh_softc *sc = arg;
+
ssh_regmap_p rp;
u_char istat;