summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-06-12 01:14:43 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-06-12 01:14:43 +0000
commitd81df54fee625da35b1d3ecbb02e8e7c3de4c722 (patch)
treee9ea08b9301a290100112adfed4a23c742b49d27 /sys/arch
parent8544a22a8941461526c191ac1167d005b1a2dafc (diff)
add mmap implementation and skeleton interrupt mapping
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/dev/schizo.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index dff91a3caaa..3e00b6e655e 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.2 2002/06/08 23:31:30 jason Exp $ */
+/* $OpenBSD: schizo.c,v 1.3 2002/06/12 01:14:42 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -81,8 +81,9 @@ void schizo_pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
paddr_t schizo_bus_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int);
int _schizo_bus_map(bus_space_tag_t, bus_type_t, bus_addr_t,
bus_size_t, int, vaddr_t, bus_space_handle_t *);
-void *schizo_intr_establish(bus_space_tag_t, int, int, int,
+void *_schizo_intr_establish(bus_space_tag_t, int, int, int,
int (*)(void *), void *);
+paddr_t _schizo_bus_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int);
int schizo_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *,
bus_size_t, struct proc *, int);
@@ -233,10 +234,8 @@ schizo_alloc_bus_tag(pbm, type)
bt->parent = sc->sc_bust;
bt->type = type;
bt->sparc_bus_map = _schizo_bus_map;
-#if XXX
- bt->sparc_bus_mmap = schizo_bus_mmap;
- bt->sparc_intr_establish = schizo_intr_establish;
-#endif
+ bt->sparc_bus_mmap = _schizo_bus_mmap;
+ bt->sparc_intr_establish = _schizo_intr_establish;
return (bt);
}
@@ -465,6 +464,36 @@ _schizo_bus_map(t, btype, offset, size, flags, vaddr, hp)
return (EINVAL);
}
+paddr_t
+_schizo_bus_mmap(t, paddr, off, prot, flags)
+ bus_space_tag_t t;
+ bus_addr_t paddr;
+ off_t off;
+ int prot;
+ int flags;
+{
+ bus_addr_t offset = paddr;
+ struct schizo_pbm *pbm = t->cookie;
+ struct schizo_softc *sc = pbm->sp_sc;
+ int i, ss;
+
+ ss = schizo_get_childspace(t->type);
+
+ for (i = 0; i < pbm->sp_nrange; i++) {
+ bus_addr_t paddr;
+
+ if (((pbm->sp_range[i].cspace >> 24) & 0x03) != ss)
+ continue;
+
+ paddr = pbm->sp_range[i].phys_lo + offset;
+ paddr |= ((bus_addr_t)pbm->sp_range[i].phys_hi<<32);
+ return (bus_space_mmap(sc->sc_bustag, paddr, off,
+ prot, flags));
+ }
+
+ return (-1);
+}
+
pcireg_t
schizo_pci_conf_read(pc, tag, reg)
pci_chipset_tag_t pc;
@@ -512,3 +541,15 @@ schizo_read(adr)
: "memory");
return (r);
}
+
+void *
+_schizo_intr_establish(t, ihandle, level, flags, handler, arg)
+ bus_space_tag_t t;
+ int ihandle;
+ int level;
+ int flags;
+ int (*handler)(void *);
+ void *arg;
+{
+ return (NULL);
+}