summaryrefslogtreecommitdiff
path: root/sys/arch/vax/vsa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/vax/vsa')
-rw-r--r--sys/arch/vax/vsa/asc_vsbus.c11
-rw-r--r--sys/arch/vax/vsa/dz_ibus.c93
-rw-r--r--sys/arch/vax/vsa/if_le_vsbus.c8
-rw-r--r--sys/arch/vax/vsa/ncr.c6
-rw-r--r--sys/arch/vax/vsa/smg.c4
-rw-r--r--sys/arch/vax/vsa/vsbus.c169
6 files changed, 88 insertions, 203 deletions
diff --git a/sys/arch/vax/vsa/asc_vsbus.c b/sys/arch/vax/vsa/asc_vsbus.c
index a9ad9c1b431..3e330022c7e 100644
--- a/sys/arch/vax/vsa/asc_vsbus.c
+++ b/sys/arch/vax/vsa/asc_vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asc_vsbus.c,v 1.2 2001/02/06 04:27:45 hugh Exp $ */
+/* $OpenBSD: asc_vsbus.c,v 1.3 2001/02/11 06:34:37 hugh Exp $ */
/* $NetBSD: asc_vsbus.c,v 1.20 2000/07/26 21:50:48 matt Exp $ */
/*-
@@ -169,11 +169,10 @@ asc_vsbus_match( struct device *parent, void *conf, void *aux)
if (vax_boardtype == VAX_BTYP_46 || vax_boardtype == VAX_BTYP_48) {
if (cf->cf_loc[0] != 0x200c0080)
return 0;
-#if 1
- } else if (vax_boardtype == VAX_BTYP_49) {
+ } else if (vax_boardtype == VAX_BTYP_49 ||
+ vax_boardtype == VAX_BTYP_1303) {
if (cf->cf_loc[0] != 0x26000080)
return 0;
-#endif
} else {
return 0;
}
@@ -208,7 +207,6 @@ asc_vsbus_attach(struct device *parent, struct device *self, void *aux)
{
struct vsbus_attach_args *va = aux;
struct asc_vsbus_softc *asc = (void *)self;
- struct vsbus_softc *vsc = (struct vsbus_softc *) parent;
struct ncr53c9x_softc *sc = &asc->sc_ncr53c9x;
int error;
@@ -257,6 +255,7 @@ asc_vsbus_attach(struct device *parent, struct device *self, void *aux)
* them from there and knowing the internals of the
* bus_space implementation, we cast to bus_space_handles.
*/
+ struct vsbus_softc *vsc = (struct vsbus_softc *) parent;
asc->sc_adrh = (bus_space_handle_t) (vsc->sc_vsregs + ASC_REG_KA49_ADR);
asc->sc_dirh = (bus_space_handle_t) (vsc->sc_vsregs + ASC_REG_KA49_DIR);
#if 0
@@ -321,7 +320,6 @@ asc_vsbus_attach(struct device *parent, struct device *self, void *aux)
printf("\n%s", self->dv_xname); /* Pretty print */
- vsc->sc_mask |= 1 << (va->va_maskno-1);
/* Do the common parts of attachment. */
ncr53c9x_attach(sc, &asc_vsbus_ops, &asc_vsbus_dev);
}
@@ -504,4 +502,3 @@ asc_vsbus_dma_isactive(struct ncr53c9x_softc *sc)
return (asc->sc_flags & ASC_DMAACTIVE) != 0;
}
-
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c
index 967b86f6119..242d8921311 100644
--- a/sys/arch/vax/vsa/dz_ibus.c
+++ b/sys/arch/vax/vsa/dz_ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz_ibus.c,v 1.3 2001/01/30 17:05:02 hugh Exp $ */
+/* $OpenBSD: dz_ibus.c,v 1.4 2001/02/11 06:34:38 hugh Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -49,7 +49,6 @@
#include <machine/sid.h>
#include <machine/uvax.h>
#include <machine/vsbus.h>
-#include <machine/ibus.h>
#include <machine/cpu.h>
#include <machine/scb.h>
@@ -62,8 +61,6 @@
static int dz_vsbus_match __P((struct device *, struct cfdata *, void *));
static void dz_vsbus_attach __P((struct device *, struct device *, void *));
-static int dz_ibus_match __P((struct device *, struct cfdata *, void *));
-static void dz_ibus_attach __P((struct device *, struct device *, void *));
static int dz_print __P((void *, const char *));
static vaddr_t dz_regs; /* Used for console */
@@ -72,10 +69,6 @@ struct cfattach dz_vsbus_ca = {
sizeof(struct dz_softc), (cfmatch_t)dz_vsbus_match, dz_vsbus_attach
};
-struct cfattach dz_ibus_ca = {
- sizeof(struct dz_softc), (cfmatch_t)dz_ibus_match, dz_ibus_attach
-};
-
#define REG(name) short name; short X##name##X;
static volatile struct ss_dz {/* base address of DZ-controller: 0x200A0000 */
REG(csr); /* 00 Csr: control/status register */
@@ -110,7 +103,12 @@ dz_vsbus_match(parent, cf, aux)
struct vsbus_attach_args *va = aux;
struct ss_dz *dzP;
short i;
- unsigned int n;
+
+#if VAX53
+ if (vax_boardtype == VAX_BTYP_1303)
+ if (cf->cf_loc[0] != 0x25000000)
+ return 0; /* Ugly */
+#endif
dzP = (struct ss_dz *)va->va_addr;
i = dzP->tcr;
@@ -119,11 +117,7 @@ dz_vsbus_match(parent, cf, aux)
DELAY(1000);
dzP->tcr = 1;
DELAY(100000);
- dzP->csr = DZ_CSR_MSE;
- DELAY(1000);
- dzP->tcr = 0;
-
- va->va_ivec = dzxint;
+ dzP->tcr = i;
/* If the device doesn't exist, no interrupt has been generated */
@@ -136,7 +130,6 @@ dz_vsbus_attach(parent, self, aux)
void *aux;
{
struct dz_softc *sc = (void *)self;
- struct vsbus_softc *vsc = (struct vsbus_softc *)parent;
struct vsbus_attach_args *va = aux;
/*
@@ -144,6 +137,10 @@ dz_vsbus_attach(parent, self, aux)
* due to the nature of how bus_space_* works on VAX, this will
* be perfectly good until everything is converted.
*/
+
+ if (dz_regs == 0) /* This isn't console */
+ dz_regs = vax_map_physmem(va->va_paddr, 1);
+
sc->sc_ioh = dz_regs;
sc->sc_dr.dr_csr = 0;
sc->sc_dr.dr_rbuf = 4;
@@ -156,9 +153,6 @@ dz_vsbus_attach(parent, self, aux)
sc->sc_type = DZ_DZV;
- vsc->sc_mask |= 1 << (va->va_maskno);
- vsc->sc_mask |= (1 << (va->va_maskno-1));
-
sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK);
scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK);
@@ -172,52 +166,6 @@ dz_vsbus_attach(parent, self, aux)
config_found(self, 0, dz_print);
}
-static void
-dz_ibus_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct dz_softc *sc = (struct dz_softc *)self;
-
- sc->sc_ioh = (vaddr_t)dz_regs;
- sc->sc_dr.dr_csr = 0; /* correct */
- sc->sc_dr.dr_rbuf = 4; /* correct */
- sc->sc_dr.dr_dtr = 9; /* unknown */
- sc->sc_dr.dr_break = 13; /* untested */
- sc->sc_dr.dr_tbuf = 12; /* correct */
- sc->sc_dr.dr_tcr = 8; /* correct */
- sc->sc_dr.dr_dcd = 13; /* works */
- sc->sc_dr.dr_ring = 13; /* untested */
-
- sc->sc_type = DZ_DC;
-
- sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
-
- scb_vecalloc(0x154, dzxint, sc, SCB_ISTACK);
- scb_vecalloc(0x150, dzrint, sc, SCB_ISTACK);
-
- dzattach(sc);
-
- ibus_ormask(0x8);
- DELAY(1000);
-
- config_found(self, 0, dz_print);
-}
-
-static int
-dz_ibus_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- /* This function assumes all btype 1303 machines have a dz. */
-
- if (vax_boardtype == VAX_BTYP_1303)
- return (1);
-
- return (0);
-}
-
int
dzcngetc(dev)
dev_t dev;
@@ -334,19 +282,10 @@ dzcnpollc(dev, pollflag)
{
static u_char mask;
- switch(vax_boardtype) {
- case VAX_BTYP_1303:
- if(pollflag)
- mask = ibus_setmask(0);
- else
- ibus_setmask(mask);
- break;
- default:
- if (pollflag)
- mask = vsbus_setmask(0);
- else
- vsbus_setmask(mask);
- }
+ if (pollflag)
+ mask = vsbus_setmask(0);
+ else
+ vsbus_setmask(mask);
}
#if NLKC
diff --git a/sys/arch/vax/vsa/if_le_vsbus.c b/sys/arch/vax/vsa/if_le_vsbus.c
index 735a2dfff2a..8a3d1224a95 100644
--- a/sys/arch/vax/vsa/if_le_vsbus.c
+++ b/sys/arch/vax/vsa/if_le_vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_vsbus.c,v 1.2 2000/10/11 06:19:19 bjc Exp $ */
+/* $OpenBSD: if_le_vsbus.c,v 1.3 2001/02/11 06:34:38 hugh Exp $ */
/* $NetBSD: if_le_vsbus.c,v 1.10 2000/06/29 07:14:18 mrg Exp $ */
/*-
@@ -96,9 +96,9 @@
#include <machine/cpu.h>
#include <machine/sid.h>
-#include <machine/bus.h>
#include <machine/scb.h>
#include <machine/rpb.h>
+#include <machine/bus.h>
#include <machine/vsbus.h>
#include <dev/ic/am7990reg.h>
@@ -157,7 +157,7 @@ le_vsbus_match(parent, cf, aux)
int rv = 0;
int error;
- if (vax_boardtype == VAX_BTYP_49)
+ if (vax_boardtype == VAX_BTYP_49 || vax_boardtype == VAX_BTYP_1303)
return 0;
error = bus_dmamap_create(va->va_dmat, sizeof(initblock), 1,
@@ -210,7 +210,6 @@ le_vsbus_attach(parent, self, aux)
void *aux;
{
struct vsbus_attach_args *va = aux;
- struct vsbus_softc *vsc = (struct vsbus_softc *)parent;
struct le_softc *sc = (void *)self;
bus_dma_segment_t seg;
int *lance_addr;
@@ -289,6 +288,5 @@ le_vsbus_attach(parent, self, aux)
/* Prettier printout */
printf("\n%s", self->dv_xname);
- vsc->sc_mask |= 1 << (va->va_maskno-1);
am7990_config(&sc->sc_am7990);
}
diff --git a/sys/arch/vax/vsa/ncr.c b/sys/arch/vax/vsa/ncr.c
index e24baf5237b..11ad8a458f0 100644
--- a/sys/arch/vax/vsa/ncr.c
+++ b/sys/arch/vax/vsa/ncr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr.c,v 1.7 2000/10/11 06:19:19 bjc Exp $ */
+/* $OpenBSD: ncr.c,v 1.8 2001/02/11 06:34:38 hugh Exp $ */
/* $NetBSD: ncr.c,v 1.32 2000/06/25 16:00:43 ragge Exp $ */
/*-
@@ -160,7 +160,7 @@ si_match(parent, cf, aux)
volatile char *si_csr = (char *) va->va_addr;
if (vax_boardtype == VAX_BTYP_49 || vax_boardtype == VAX_BTYP_46
- || vax_boardtype == VAX_BTYP_48)
+ || vax_boardtype == VAX_BTYP_48 || vax_boardtype == VAX_BTYP_1303)
return 0;
/* This is the way Linux autoprobes the interrupt MK-990321 */
si_csr[12] = 0;
@@ -177,14 +177,12 @@ si_attach(parent, self, aux)
void *aux;
{
struct vsbus_attach_args *va = aux;
- struct vsbus_softc *vsc = (struct vsbus_softc *)parent;
struct si_softc *sc = (struct si_softc *) self;
struct ncr5380_softc *ncr_sc = &sc->ncr_sc;
int tweak, target;
/* enable interrupts on vsbus too */
scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr5380_intr, sc, SCB_ISTACK);
- vsc->sc_mask |= 1 << (va->va_maskno-1);
/*
* DMA area mapin.
diff --git a/sys/arch/vax/vsa/smg.c b/sys/arch/vax/vsa/smg.c
index 9c25ca4c312..00bf8b3378c 100644
--- a/sys/arch/vax/vsa/smg.c
+++ b/sys/arch/vax/vsa/smg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smg.c,v 1.1 2000/04/27 02:34:50 bjc Exp $ */
+/* $OpenBSD: smg.c,v 1.2 2001/02/11 06:34:38 hugh Exp $ */
/* $NetBSD: smg.c,v 1.21 2000/03/23 06:46:44 thorpej Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -155,7 +155,7 @@ smg_match(parent, match, aux)
volatile short *cfgtst;
short tmp, tmp2;
- if (vax_boardtype == VAX_BTYP_49)
+ if (vax_boardtype == VAX_BTYP_49 || vax_boardtype == VAX_BTYP_1303)
return 0;
curcmd = (short *)va->va_addr;
diff --git a/sys/arch/vax/vsa/vsbus.c b/sys/arch/vax/vsa/vsbus.c
index 6e2df6f4a8b..43e18bf8584 100644
--- a/sys/arch/vax/vsa/vsbus.c
+++ b/sys/arch/vax/vsa/vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsbus.c,v 1.5 2000/10/11 06:19:19 bjc Exp $ */
+/* $OpenBSD: vsbus.c,v 1.6 2001/02/11 06:34:38 hugh Exp $ */
/* $NetBSD: vsbus.c,v 1.29 2000/06/29 07:14:37 mrg Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
@@ -51,7 +51,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#define _VAX_BUS_DMA_PRIVATE
+#define _VAX_BUS_DMA_PRIVATE
#include <machine/bus.h>
#include <machine/pte.h>
#include <machine/sid.h>
@@ -67,15 +67,15 @@
#include <machine/vsbus.h>
-int vsbus_match __P((struct device *, struct cfdata *, void *));
+int vsbus_match __P((struct device *, struct cfdata *, void *));
void vsbus_attach __P((struct device *, struct device *, void *));
-int vsbus_print __P((void *, const char *));
-int vsbus_search __P((struct device *, void *, void *));
+int vsbus_print __P((void *, const char *));
+int vsbus_search __P((struct device *, void *, void *));
void ka410_attach __P((struct device *, struct device *, void *));
void ka43_attach __P((struct device *, struct device *, void *));
-struct vax_bus_dma_tag vsbus_bus_dma_tag = {
+static struct vax_bus_dma_tag vsbus_bus_dma_tag = {
0,
0,
0,
@@ -131,9 +131,14 @@ vsbus_print(aux, name)
int
vsbus_match(parent, cf, aux)
struct device *parent;
- struct cfdata *cf;
+ struct cfdata *cf;
void *aux;
{
+#if VAX53
+ /* Kludge: VAX53 is... special */
+ if (vax_boardtype == VAX_BTYP_1303 && (int)aux == 1)
+ return 1; /* Hack */
+#endif
if (vax_bustype == VAX_VSBUS)
return 1;
return 0;
@@ -146,14 +151,14 @@ vsbus_attach(parent, self, aux)
{
struct vsbus_softc *sc = (void *)self;
int dbase, dsize;
- int discard;
printf("\n");
sc->sc_dmatag = vsbus_bus_dma_tag;
switch (vax_boardtype) {
-#if VAX49
+#if VAX49 || VAX53
+ case VAX_BTYP_1303:
case VAX_BTYP_49:
sc->sc_vsregs = vax_map_physmem(0x25c00000, 1);
sc->sc_intreq = (char *)sc->sc_vsregs + 12;
@@ -164,16 +169,15 @@ vsbus_attach(parent, self, aux)
#endif
#if VAX46 || VAX48
- case VAX_BTYP_48:
- case VAX_BTYP_46:
- sc->sc_vsregs = vax_map_physmem(VS_REGS, 1);
- sc->sc_intreq = (char *)sc->sc_vsregs + 15;
- sc->sc_intclr = (char *)sc->sc_vsregs + 15;
- sc->sc_intmsk = (char *)sc->sc_vsregs + 12;
- vsbus_dma_init(sc, 32768);
+ case VAX_BTYP_48:
+ case VAX_BTYP_46:
+ sc->sc_vsregs = vax_map_physmem(VS_REGS, 1);
+ sc->sc_intreq = (char *)sc->sc_vsregs + 15;
+ sc->sc_intclr = (char *)sc->sc_vsregs + 15;
+ sc->sc_intmsk = (char *)sc->sc_vsregs + 12;
+ vsbus_dma_init(sc, 32768);
#endif
-
default:
sc->sc_vsregs = vax_map_physmem(VS_REGS, 1);
sc->sc_intreq = (char *)sc->sc_vsregs + 15;
@@ -203,28 +207,28 @@ vsbus_attach(parent, self, aux)
*sc->sc_intmsk = 0;
*sc->sc_intclr = 0xff;
DELAY(1000000); /* Wait a second */
- sc->sc_mask = discard = *sc->sc_intreq;
- printf("%s: interrupt mask %x\n", self->dv_xname, discard);
-
+ sc->sc_mask = *sc->sc_intreq;
+ printf("%s: interrupt mask %x\n", self->dv_xname, sc->sc_mask);
/*
* now check for all possible devices on this "bus"
*/
config_search(vsbus_search, self, NULL);
- *sc->sc_intmsk = sc->sc_mask ^ discard;
+ /* Autoconfig finished, enable interrupts */
+ *sc->sc_intmsk = ~sc->sc_mask;
}
int
vsbus_search(parent, cfd, aux)
- struct device *parent;
- void *cfd;
- void *aux;
+ struct device *parent;
+ void *cfd;
+ void *aux;
{
- struct vsbus_softc *sc = (void *)parent;
- struct vsbus_attach_args va;
- struct cfdata *cf = cfd;
- int i, vec, br;
- u_char c;
+ struct vsbus_softc *sc = (void *)parent;
+ struct vsbus_attach_args va;
+ struct cfdata *cf = cfd;
+ int i, vec, br;
+ u_char c;
va.va_paddr = cf->cf_loc[0];
va.va_addr = vax_map_physmem(va.va_paddr, 1);
@@ -235,10 +239,10 @@ vsbus_search(parent, cfd, aux)
*sc->sc_intclr = 0xff;
scb_vecref(0, 0); /* Clear vector ref */
- va.va_ivec = vsbus_intr;
i = (*cf->cf_attach->ca_match) (parent, cf, &va);
vax_unmap_physmem(va.va_addr, 1);
c = *sc->sc_intreq & ~sc->sc_mask;
+
if (i == 0)
goto forgetit;
if (i > 10)
@@ -246,87 +250,33 @@ vsbus_search(parent, cfd, aux)
else if (c == 0)
goto forgetit;
- va.va_maskno = ffs((u_int)c);
-
*sc->sc_intmsk = c;
DELAY(1000);
*sc->sc_intmsk = 0;
-
+ va.va_maskno = ffs((u_int)c);
i = scb_vecref(&vec, &br);
if (i == 0)
goto fail;
if (vec == 0)
goto fail;
-
- scb_vecalloc(vec, va.va_ivec, va.va_vecarg, SCB_ISTACK);
+
va.va_br = br;
va.va_cvec = vec;
- va.confargs = aux;
va.va_dmaaddr = sc->sc_dmaaddr;
va.va_dmasize = sc->sc_dmasize;
-
+ *sc->sc_intmsk = c; /* Allow interrupts during attach */
config_attach(parent, cf, &va, vsbus_print);
- return 1;
+ *sc->sc_intmsk = 0;
+ return 0;
fail:
- printf("%s%d at %s csr %x %s\n",
+ printf("%s%d at %s csr 0x%x %s\n",
cf->cf_driver->cd_name, cf->cf_unit, parent->dv_xname,
cf->cf_loc[0], (i ? "zero vector" : "didn't interrupt"));
forgetit:
return 0;
}
-#if 0
-static volatile struct dma_lock {
- int dl_locked;
- int dl_wanted;
- void *dl_owner;
- int dl_count;
-} dmalock = { 0, 0, NULL, 0 };
-
-int
-vsbus_lockDMA(ca)
- struct confargs *ca;
-{
- while (dmalock.dl_locked) {
- dmalock.dl_wanted++;
- sleep((caddr_t)&dmalock, PRIBIO); /* PLOCK or PRIBIO ? */
- dmalock.dl_wanted--;
- }
- dmalock.dl_locked++;
- dmalock.dl_owner = ca;
-
- /*
- * no checks yet, no timeouts, nothing...
- */
-
-#ifdef DEBUG
- if ((++dmalock.dl_count % 1000) == 0)
- printf("%d locks, owner: %s\n", dmalock.dl_count, ca->ca_name);
-#endif
- return (0);
-}
-
-int
-vsbus_unlockDMA(ca)
- struct confargs *ca;
-{
- if (dmalock.dl_locked != 1 || dmalock.dl_owner != ca) {
- printf("locking-problem: %d, %s\n", dmalock.dl_locked,
- (dmalock.dl_owner ? dmalock.dl_owner : "null"));
- dmalock.dl_locked = 0;
- return (-1);
- }
- dmalock.dl_owner = NULL;
- dmalock.dl_locked = 0;
- if (dmalock.dl_wanted) {
- wakeup((caddr_t)&dmalock);
- }
- return (0);
-}
-#endif
-
-
/*
* Sets a new interrupt mask. Returns the old one.
* Works like spl functions.
@@ -335,9 +285,13 @@ unsigned char
vsbus_setmask(mask)
unsigned char mask;
{
- struct vsbus_softc *sc = vsbus_cd.cd_devs[0];
+ struct vsbus_softc *sc;
unsigned char ch;
+ if (vsbus_cd.cd_ndevs == 0)
+ return 0;
+ sc = vsbus_cd.cd_devs[0];
+
ch = *sc->sc_intmsk;
*sc->sc_intmsk = mask;
return ch;
@@ -350,7 +304,11 @@ void
vsbus_clrintr(mask)
unsigned char mask;
{
- struct vsbus_softc *sc = vsbus_cd.cd_devs[0];
+ struct vsbus_softc *sc;
+
+ if (vsbus_cd.cd_ndevs == 0)
+ return;
+ sc = vsbus_cd.cd_devs[0];
*sc->sc_intclr = mask;
}
@@ -360,18 +318,15 @@ vsbus_clrintr(mask)
* Use the physical memory directly.
*/
void
-vsbus_copytoproc(p, from, to, len)
- struct proc *p;
- caddr_t from, to;
- int len;
+vsbus_copytoproc(struct proc *p, caddr_t from, caddr_t to, int len)
{
struct pte *pte;
paddr_t pa;
- if ((long)to & KERNBASE) { /* In kernel space */
- bcopy(from, to, len);
- return;
- }
+ if ((vaddr_t)to & KERNBASE) { /* In kernel space */
+ bcopy(from, to, len);
+ return;
+ }
pte = uvtopte(TRUNC_PAGE(to), (&p->p_addr->u_pcb));
if ((vaddr_t)to & PGOFSET) {
int cz = ROUND_PAGE(to) - (vaddr_t)to;
@@ -394,18 +349,15 @@ vsbus_copytoproc(p, from, to, len)
}
void
-vsbus_copyfromproc(p, from, to, len)
- struct proc *p;
- caddr_t from, to;
- int len;
+vsbus_copyfromproc(struct proc *p, caddr_t from, caddr_t to, int len)
{
struct pte *pte;
paddr_t pa;
- if ((long)from & KERNBASE) { /* In kernel space */
- bcopy(from, to, len);
- return;
- }
+ if ((vaddr_t)from & KERNBASE) { /* In kernel space */
+ bcopy(from, to, len);
+ return;
+ }
pte = uvtopte(TRUNC_PAGE(from), (&p->p_addr->u_pcb));
if ((vaddr_t)from & PGOFSET) {
int cz = ROUND_PAGE(from) - (vaddr_t)from;
@@ -436,6 +388,7 @@ static int vsbus_active = 0;
void
vsbus_dma_start(struct vsbus_dma *vd)
{
+
SIMPLEQ_INSERT_TAIL(&vsbus_dma, vd, vd_q);
if (vsbus_active == 0)