summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--sys/arch/mvme88k/include/locore.h4
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c13
5 files changed, 39 insertions, 32 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;
diff --git a/sys/arch/mvme88k/include/locore.h b/sys/arch/mvme88k/include/locore.h
index 55d5ff8235b..13797db9acb 100644
--- a/sys/arch/mvme88k/include/locore.h
+++ b/sys/arch/mvme88k/include/locore.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.h,v 1.21 2004/01/23 17:26:05 miod Exp $ */
+/* $OpenBSD: locore.h,v 1.22 2004/04/16 23:35:52 miod Exp $ */
#ifndef _MACHINE_LOCORE_H_
#define _MACHINE_LOCORE_H_
@@ -52,7 +52,7 @@ void _doboot(void);
vaddr_t get_slave_stack(void);
void slave_pre_main(void);
int slave_main(void);
-int intr_findvec(int start, int end);
+int intr_findvec(int, int, int);
void bugsyscall(void);
void myetheraddr(u_char *cp);
void dosoftint(void);
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 3f1301b7e35..1d75354a0dd 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.139 2004/04/15 21:35:07 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.140 2004/04/16 23:35:53 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -1371,23 +1371,24 @@ slave_main()
* This should really only be used by VME devices.
*/
int
-intr_findvec(start, end)
- int start, end;
+intr_findvec(int start, int end, int skip)
{
int vec;
#ifdef DEBUG
- /* Sanity check! */
if (start < 0 || end > 255 || start > end)
panic("intr_findvec(%d,%d): bad parameters", start, end);
#endif
- for (vec = start; vec < end; vec++){
+ for (vec = start; vec <= end; vec++) {
+ if (vec == skip)
+ continue;
if (intr_handlers[vec] == NULL)
return (vec);
}
#ifdef DIAGNOSTIC
- printf("intr_findvec(%d,%d): no vector available\n", start, end);
+ printf("intr_findvec(%d,%d,%d): no vector available\n",
+ start, end, skip);
#endif
return (-1);
}