diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-11-08 14:39:43 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-11-08 14:39:43 +0000 |
commit | 2da88799653f15d9e98bbc13cf4c70a38feee300 (patch) | |
tree | d7a662728866f4a95adf2012542f4accbdcc3ea0 | |
parent | 923da87bd920f3fef22e69af6adace5d474ea295 (diff) |
allocate le_iomem in le_ioasic_attach instead of MD code,
only for UVM.
-rw-r--r-- | sys/dev/tc/if_le_ioasic.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/tc/if_le_ioasic.c b/sys/dev/tc/if_le_ioasic.c index b24f4ded59b..6940925fe52 100644 --- a/sys/dev/tc/if_le_ioasic.c +++ b/sys/dev/tc/if_le_ioasic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_ioasic.c,v 1.4 1998/09/16 22:41:22 jason Exp $ */ +/* $OpenBSD: if_le_ioasic.c,v 1.5 2000/11/08 14:39:42 art Exp $ */ /* $NetBSD: if_le_ioasic.c,v 1.2 1996/05/07 02:24:56 thorpej Exp $ */ /* @@ -42,6 +42,11 @@ #include <net/if.h> #include <net/if_media.h> +#include <vm/vm.h> +#ifdef UVM +#include <uvm/uvm_extern.h> +#endif + #ifdef INET #include <netinet/in.h> #include <netinet/if_ether.h> @@ -54,8 +59,6 @@ #include <dev/tc/tcvar.h> #include <dev/tc/ioasicvar.h> -extern caddr_t le_iomem; - int le_ioasic_match __P((struct device *, void *, void *)); void le_ioasic_attach __P((struct device *, struct device *, void *)); @@ -89,6 +92,8 @@ le_ioasic_match(parent, match, aux) return (1); } +#define LE_IOASIC_MEMSIZE (128*1024) +#define LE_IOASIC_MEMALIGN (128*1024) void le_ioasic_attach(parent, self, aux) struct device *parent, *self; @@ -97,6 +102,15 @@ le_ioasic_attach(parent, self, aux) struct ioasicdev_attach_args *d = aux; register struct le_softc *lesc = (void *)self; register struct am7990_softc *sc = &lesc->sc_am7990; +#ifdef UVM + caddr_t le_iomem; +#else + extern caddr_t le_iomem; +#endif + +#ifdef UVM + le_iomem = (caddr_t)uvm_pagealloc_contig(LE_IOASIC_MEMSIZE, 0, 0, LE_IOASIC_MEMALIGN); +#endif lesc->sc_r1 = (struct lereg1 *) TC_DENSE_TO_SPARSE(TC_PHYS_TO_UNCACHED(d->iada_addr)); |