summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-04-16 23:35:54 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-04-16 23:35:54 +0000
commit38731e257ee5ed14c232ec32a3867beafa1e44ca (patch)
treea3cce58182ba389548d6e38acded3f900d7aa32e /sys/arch/mvme88k/dev
parent2dd5d0c4fd0e611f893c3fcf748e4c35343ec8df (diff)
When a VMEBus device needs to use two interrupt vectors, be nice and let it
actually use two distinct vectors, rather than twice the same. Because of this, print vector last in vmeprint() so that dmesg remains pretty in the multi-vector case.
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r--sys/arch/mvme88k/dev/vme.c20
-rw-r--r--sys/arch/mvme88k/dev/vme.h4
-rw-r--r--sys/arch/mvme88k/dev/vs.c30
3 files changed, 30 insertions, 24 deletions
diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c
index ff991b56a36..5535cb0ddbc 100644
--- a/sys/arch/mvme88k/dev/vme.c
+++ b/sys/arch/mvme88k/dev/vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.c,v 1.32 2004/04/16 06:20:24 miod Exp $ */
+/* $OpenBSD: vme.c,v 1.33 2004/04/16 23:35:50 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -29,21 +29,15 @@
#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/tty.h>
#include <sys/uio.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/fcntl.h>
#include <sys/device.h>
-#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/locore.h>
-#include <machine/pmap.h>
#include "pcctwo.h"
#include "syscon.h"
@@ -234,10 +228,10 @@ vmeprint(args, bus)
struct confargs *ca = args;
printf(" addr 0x%x", ca->ca_offset);
- if (ca->ca_vec > 0)
- printf(" vec 0x%x", ca->ca_vec);
if (ca->ca_ipl > 0)
printf(" ipl %d", ca->ca_ipl);
+ if (ca->ca_vec > 0)
+ printf(" vec 0x%x", ca->ca_vec);
return (UNCONF);
}
@@ -259,7 +253,7 @@ vmescan(parent, child, args, bustype)
oca.ca_vec = cf->cf_loc[2];
oca.ca_ipl = cf->cf_loc[3];
if (oca.ca_ipl > 0 && oca.ca_vec == -1)
- oca.ca_vec = vme_findvec();
+ oca.ca_vec = vme_findvec(-1);
if (oca.ca_len == -1)
oca.ca_len = PAGE_SIZE;
len = oca.ca_len;
@@ -349,9 +343,9 @@ vmeattach(parent, self, args)
/* find a VME vector based on what is in NVRAM settings. */
int
-vme_findvec(void)
+vme_findvec(int skip)
{
- return(intr_findvec(vmevecbase, 0xFF));
+ return intr_findvec(vmevecbase, 0xff, skip);
}
/*
@@ -515,7 +509,7 @@ vmesyscon_init(sc)
* the VME2 chip.
* XXX VME address must be between 2G and 4G
* XXX We only support D32 at the moment..
- * XXX smurph - This is bogus, get rid of it! Should check vme/syson for offsets.
+ * XXX smurph - This is bogus, get rid of it! Should check vme/syscon for offsets.
*/
u_long
vme2chip_map(base, len, dwidth)
diff --git a/sys/arch/mvme88k/dev/vme.h b/sys/arch/mvme88k/dev/vme.h
index 2dc06011d28..531465cf583 100644
--- a/sys/arch/mvme88k/dev/vme.h
+++ b/sys/arch/mvme88k/dev/vme.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.h,v 1.13 2003/12/28 19:44:26 miod Exp $ */
+/* $OpenBSD: vme.h,v 1.14 2004/04/16 23:35:50 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -268,7 +268,7 @@ struct vme2reg {
void *vmepmap(struct device *sc, off_t vmeaddr, int len, int bustype);
int vmerw(struct device *sc, struct uio *uio, int flags, int bus);
int vmeintr_establish(int vec, struct intrhand *ih);
-int vme_findvec(void);
+int vme_findvec(int);
int vmescan(struct device *, void *, void *, int);
/* D16 access functions */
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c
index e96c00ae178..5f85255d125 100644
--- a/sys/arch/mvme88k/dev/vs.c
+++ b/sys/arch/mvme88k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.29 2004/01/29 21:39:05 deraadt Exp $ */
+/* $OpenBSD: vs.c,v 1.30 2004/04/16 23:35:50 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -55,8 +55,8 @@
#include <mvme88k/dev/vsreg.h>
#include <mvme88k/dev/vsvar.h>
-#include <mvme88k/dev/vme.h> /* vme_findvec() */
-#include <machine/cmmu.h> /* DMA_CACHE_SYNC, etc... */
+#include <mvme88k/dev/vme.h>
+#include <machine/cmmu.h>
int vsmatch(struct device *, void *, void *);
void vsattach(struct device *, struct device *, void *);
@@ -117,21 +117,33 @@ vsmatch(pdp, vcf, args)
}
void
-vsattach(parent, self, auxp)
+vsattach(parent, self, args)
struct device *parent, *self;
- void *auxp;
+ void *args;
{
struct vs_softc *sc = (struct vs_softc *)self;
- struct confargs *ca = auxp;
- struct vsreg * rp;
+ struct confargs *ca = args;
+ struct vsreg *rp;
+ int evec;
int tmp;
+ /* get the next available vector for the error interrupt */
+ evec = vme_findvec(ca->ca_vec);
+
+ if (ca->ca_vec < 0 || evec < 0) {
+ printf(": no more interrupts!\n");
+ return;
+ }
+ if (ca->ca_ipl < 0)
+ ca->ca_ipl = IPL_BIO;
+
+ printf(" vec 0x%x", evec);
+
sc->sc_vsreg = rp = ca->ca_vaddr;
sc->sc_ipl = ca->ca_ipl;
sc->sc_nvec = ca->ca_vec;
- /* get the next available vector for the error interrupt func. */
- sc->sc_evec = vme_findvec();
+ sc->sc_evec = evec;
sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter_target = 7;
sc->sc_link.adapter = &vs_scsiswitch;