summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/tc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/alpha/tc')
-rw-r--r--sys/arch/alpha/tc/cfb.c4
-rw-r--r--sys/arch/alpha/tc/sfb.c4
-rw-r--r--sys/arch/alpha/tc/tc_bus_io.c321
-rw-r--r--sys/arch/alpha/tc/tc_bus_mem.c373
-rw-r--r--sys/arch/alpha/tc/tc_machdep.h7
-rw-r--r--sys/arch/alpha/tc/tcasic.c16
6 files changed, 303 insertions, 422 deletions
diff --git a/sys/arch/alpha/tc/cfb.c b/sys/arch/alpha/tc/cfb.c
index 1e97c303117..134259df4f6 100644
--- a/sys/arch/alpha/tc/cfb.c
+++ b/sys/arch/alpha/tc/cfb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfb.c,v 1.5 1996/11/23 21:44:57 kstailey Exp $ */
+/* $OpenBSD: cfb.c,v 1.6 1996/12/08 00:20:55 niklas Exp $ */
/* $NetBSD: cfb.c,v 1.5 1996/10/13 03:00:27 christos Exp $ */
/*
@@ -37,7 +37,7 @@
#include <sys/conf.h>
#include <sys/ioctl.h>
-#include <machine/bus.old.h>
+#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/tc/tcvar.h>
diff --git a/sys/arch/alpha/tc/sfb.c b/sys/arch/alpha/tc/sfb.c
index 7a20ad45513..0dd93e9a981 100644
--- a/sys/arch/alpha/tc/sfb.c
+++ b/sys/arch/alpha/tc/sfb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sfb.c,v 1.5 1996/11/23 21:45:01 kstailey Exp $ */
+/* $OpenBSD: sfb.c,v 1.6 1996/12/08 00:20:56 niklas Exp $ */
/* $NetBSD: sfb.c,v 1.5 1996/10/13 03:00:35 christos Exp $ */
/*
@@ -37,7 +37,7 @@
#include <sys/conf.h>
#include <sys/ioctl.h>
-#include <machine/bus.old.h>
+#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/tc/tcvar.h>
diff --git a/sys/arch/alpha/tc/tc_bus_io.c b/sys/arch/alpha/tc/tc_bus_io.c
deleted file mode 100644
index ad0ff6f5dc6..00000000000
--- a/sys/arch/alpha/tc/tc_bus_io.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* $OpenBSD: tc_bus_io.c,v 1.4 1996/11/12 20:29:44 niklas Exp $ */
-/* $NetBSD: tc_bus_io.c,v 1.3 1996/07/09 00:55:31 cgd Exp $ */
-
-/*
- * Copyright (c) 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-/*
- * TurboChannel "bus I/O" functions:
- * These functions make no sense for TC, and just panic.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <vm/vm.h>
-
-#include <machine/bus.old.h>
-#include <dev/tc/tcvar.h>
-
-int tc_io_map __P((void *, bus_io_addr_t, bus_io_size_t,
- bus_io_handle_t *));
-void tc_io_unmap __P((void *, bus_io_handle_t,
- bus_io_size_t));
-int tc_io_subregion __P((void *, bus_io_handle_t, bus_io_size_t,
- bus_io_size_t, bus_io_handle_t *));
-u_int8_t tc_io_read_1 __P((void *, bus_io_handle_t,
- bus_io_size_t));
-u_int16_t tc_io_read_2 __P((void *, bus_io_handle_t,
- bus_io_size_t));
-u_int32_t tc_io_read_4 __P((void *, bus_io_handle_t,
- bus_io_size_t));
-u_int64_t tc_io_read_8 __P((void *, bus_io_handle_t,
- bus_io_size_t));
-void tc_io_read_multi_1 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int8_t *, bus_io_size_t));
-void tc_io_read_multi_2 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int16_t *, bus_io_size_t));
-void tc_io_read_multi_4 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int32_t *, bus_io_size_t));
-void tc_io_read_multi_8 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int64_t *, bus_io_size_t));
-void tc_io_write_1 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int8_t));
-void tc_io_write_2 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int16_t));
-void tc_io_write_4 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int32_t));
-void tc_io_write_8 __P((void *, bus_io_handle_t,
- bus_io_size_t, u_int64_t));
-void tc_io_write_multi_1 __P((void *, bus_io_handle_t,
- bus_io_size_t, const u_int8_t *, bus_io_size_t));
-void tc_io_write_multi_2 __P((void *, bus_io_handle_t,
- bus_io_size_t, const u_int16_t *, bus_io_size_t));
-void tc_io_write_multi_4 __P((void *, bus_io_handle_t,
- bus_io_size_t, const u_int32_t *, bus_io_size_t));
-void tc_io_write_multi_8 __P((void *, bus_io_handle_t,
- bus_io_size_t, const u_int64_t *, bus_io_size_t));
-
-void
-tc_bus_io_init(bc, iov)
- bus_chipset_tag_t bc;
- void *iov;
-{
-
- bc->bc_i_v = iov;
-
- bc->bc_i_map = tc_io_map;
- bc->bc_i_unmap = tc_io_unmap;
- bc->bc_i_subregion = tc_io_subregion;
-
- bc->bc_ir1 = tc_io_read_1;
- bc->bc_ir2 = tc_io_read_2;
- bc->bc_ir4 = tc_io_read_4;
- bc->bc_ir8 = tc_io_read_8;
-
- bc->bc_irm1 = tc_io_read_multi_1;
- bc->bc_irm2 = tc_io_read_multi_2;
- bc->bc_irm4 = tc_io_read_multi_4;
- bc->bc_irm8 = tc_io_read_multi_8;
-
- bc->bc_iw1 = tc_io_write_1;
- bc->bc_iw2 = tc_io_write_2;
- bc->bc_iw4 = tc_io_write_4;
- bc->bc_iw8 = tc_io_write_8;
-
- bc->bc_iwm1 = tc_io_write_multi_1;
- bc->bc_iwm2 = tc_io_write_multi_2;
- bc->bc_iwm4 = tc_io_write_multi_4;
- bc->bc_iwm8 = tc_io_write_multi_8;
-}
-
-static const char *tc_bus_io_panicstr = "tc_io_%s nonsensical; unimplemented";
-
-int
-tc_io_map(v, ioaddr, iosize, iohp)
- void *v;
- bus_io_addr_t ioaddr;
- bus_io_size_t iosize;
- bus_io_handle_t *iohp;
-{
-
- panic(tc_bus_io_panicstr, "map");
-}
-
-void
-tc_io_unmap(v, ioh, iosize)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t iosize;
-{
-
- panic(tc_bus_io_panicstr, "unmap");
-}
-
-int
-tc_io_subregion(v, ioh, offset, size, nioh)
- void *v;
- bus_io_handle_t ioh, *nioh;
- bus_io_size_t offset, size;
-{
-
- panic(tc_bus_io_panicstr, "subregion");
-}
-
-u_int8_t
-tc_io_read_1(v, ioh, off)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
-{
-
- panic(tc_bus_io_panicstr, "read_1");
-}
-
-u_int16_t
-tc_io_read_2(v, ioh, off)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
-{
-
- panic(tc_bus_io_panicstr, "read_2");
-}
-
-u_int32_t
-tc_io_read_4(v, ioh, off)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
-{
-
- panic(tc_bus_io_panicstr, "read_4");
-}
-
-u_int64_t
-tc_io_read_8(v, ioh, off)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
-{
-
- panic(tc_bus_io_panicstr, "read_8");
-}
-
-void
-tc_io_read_multi_1(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- u_int8_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "read_multi_1");
-}
-
-void
-tc_io_read_multi_2(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- u_int16_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "read_multi_2");
-}
-
-void
-tc_io_read_multi_4(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- u_int32_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "read_multi_4");
-}
-
-void
-tc_io_read_multi_8(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- u_int64_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "read_multi_8");
-}
-
-void
-tc_io_write_1(v, ioh, off, val)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
- u_int8_t val;
-{
-
- panic(tc_bus_io_panicstr, "write_1");
-}
-
-void
-tc_io_write_2(v, ioh, off, val)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
- u_int16_t val;
-{
-
- panic(tc_bus_io_panicstr, "write_2");
-}
-
-void
-tc_io_write_4(v, ioh, off, val)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
- u_int32_t val;
-{
-
- panic(tc_bus_io_panicstr, "write_4");
-}
-
-void
-tc_io_write_8(v, ioh, off, val)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off;
- u_int64_t val;
-{
-
- panic(tc_bus_io_panicstr, "write_8");
-}
-
-void
-tc_io_write_multi_1(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- const u_int8_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "write_multi_1");
-}
-
-void
-tc_io_write_multi_2(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- const u_int16_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "write_multi_2");
-}
-
-void
-tc_io_write_multi_4(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- const u_int32_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "write_multi_4");
-}
-
-void
-tc_io_write_multi_8(v, ioh, off, addr, count)
- void *v;
- bus_io_handle_t ioh;
- bus_io_size_t off, count;
- const u_int64_t *addr;
-{
-
- panic(tc_bus_io_panicstr, "write_multi_8");
-}
diff --git a/sys/arch/alpha/tc/tc_bus_mem.c b/sys/arch/alpha/tc/tc_bus_mem.c
index 90087369d6c..5c44ec56efd 100644
--- a/sys/arch/alpha/tc/tc_bus_mem.c
+++ b/sys/arch/alpha/tc/tc_bus_mem.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: tc_bus_mem.c,v 1.4 1996/11/12 20:29:45 niklas Exp $ */
-/* $NetBSD: tc_bus_mem.c,v 1.7 1996/07/09 00:55:33 cgd Exp $ */
+/* $OpenBSD: tc_bus_mem.c,v 1.5 1996/12/08 00:20:58 niklas Exp $ */
+/* $NetBSD: tc_bus_mem.c,v 1.9 1996/10/23 04:12:37 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -39,68 +39,162 @@
#include <sys/device.h>
#include <vm/vm.h>
-#include <machine/bus.old.h>
+#include <machine/bus.h>
#include <dev/tc/tcvar.h>
-int tc_mem_map __P((void *, bus_mem_addr_t, bus_mem_size_t,
- int, bus_mem_handle_t *));
-void tc_mem_unmap __P((void *, bus_mem_handle_t,
- bus_mem_size_t));
-int tc_mem_subregion __P((void *, bus_mem_handle_t, bus_mem_size_t,
- bus_mem_size_t, bus_mem_handle_t *));
-u_int8_t tc_mem_read_1 __P((void *, bus_mem_handle_t,
- bus_mem_size_t));
-u_int16_t tc_mem_read_2 __P((void *, bus_mem_handle_t,
- bus_mem_size_t));
-u_int32_t tc_mem_read_4 __P((void *, bus_mem_handle_t,
- bus_mem_size_t));
-u_int64_t tc_mem_read_8 __P((void *, bus_mem_handle_t,
- bus_mem_size_t));
-void tc_mem_write_1 __P((void *, bus_mem_handle_t,
- bus_mem_size_t, u_int8_t));
-void tc_mem_write_2 __P((void *, bus_mem_handle_t,
- bus_mem_size_t, u_int16_t));
-void tc_mem_write_4 __P((void *, bus_mem_handle_t,
- bus_mem_size_t, u_int32_t));
-void tc_mem_write_8 __P((void *, bus_mem_handle_t,
- bus_mem_size_t, u_int64_t));
-
-/* XXX DOES NOT BELONG */
-vm_offset_t tc_XXX_dmamap __P((void *));
-
-void
-tc_bus_mem_init(bc, memv)
- bus_chipset_tag_t bc;
+/* mapping/unmapping */
+int tc_mem_map __P((void *, bus_addr_t, bus_size_t, int,
+ bus_space_handle_t *));
+void tc_mem_unmap __P((void *, bus_space_handle_t, bus_size_t));
+int tc_mem_subregion __P((void *, bus_space_handle_t, bus_size_t,
+ bus_size_t, bus_space_handle_t *));
+
+/* allocation/deallocation */
+int tc_mem_alloc __P((void *, bus_addr_t, bus_addr_t, bus_size_t,
+ bus_size_t, bus_addr_t, int, bus_addr_t *,
+ bus_space_handle_t *));
+void tc_mem_free __P((void *, bus_space_handle_t, bus_size_t));
+
+/* read (single) */
+u_int8_t tc_mem_read_1 __P((void *, bus_space_handle_t, bus_size_t));
+u_int16_t tc_mem_read_2 __P((void *, bus_space_handle_t, bus_size_t));
+u_int32_t tc_mem_read_4 __P((void *, bus_space_handle_t, bus_size_t));
+u_int64_t tc_mem_read_8 __P((void *, bus_space_handle_t, bus_size_t));
+
+/* read multiple */
+void tc_mem_read_multi_1 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int8_t *, bus_size_t));
+void tc_mem_read_multi_2 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int16_t *, bus_size_t));
+void tc_mem_read_multi_4 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int32_t *, bus_size_t));
+void tc_mem_read_multi_8 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int64_t *, bus_size_t));
+
+/* read region */
+void tc_mem_read_region_1 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int8_t *, bus_size_t));
+void tc_mem_read_region_2 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int16_t *, bus_size_t));
+void tc_mem_read_region_4 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int32_t *, bus_size_t));
+void tc_mem_read_region_8 __P((void *, bus_space_handle_t,
+ bus_size_t, u_int64_t *, bus_size_t));
+
+/* write (single) */
+void tc_mem_write_1 __P((void *, bus_space_handle_t, bus_size_t,
+ u_int8_t));
+void tc_mem_write_2 __P((void *, bus_space_handle_t, bus_size_t,
+ u_int16_t));
+void tc_mem_write_4 __P((void *, bus_space_handle_t, bus_size_t,
+ u_int32_t));
+void tc_mem_write_8 __P((void *, bus_space_handle_t, bus_size_t,
+ u_int64_t));
+
+/* write multiple */
+void tc_mem_write_multi_1 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int8_t *, bus_size_t));
+void tc_mem_write_multi_2 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int16_t *, bus_size_t));
+void tc_mem_write_multi_4 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int32_t *, bus_size_t));
+void tc_mem_write_multi_8 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int64_t *, bus_size_t));
+
+/* write region */
+void tc_mem_write_region_1 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int8_t *, bus_size_t));
+void tc_mem_write_region_2 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int16_t *, bus_size_t));
+void tc_mem_write_region_4 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int32_t *, bus_size_t));
+void tc_mem_write_region_8 __P((void *, bus_space_handle_t,
+ bus_size_t, const u_int64_t *, bus_size_t));
+
+/* barrier */
+void tc_mem_barrier __P((void *, bus_space_handle_t,
+ bus_size_t, bus_size_t, int));
+
+
+static struct alpha_bus_space tc_mem_space = {
+ /* cookie */
+ NULL,
+
+ /* mapping/unmapping */
+ tc_mem_map,
+ tc_mem_unmap,
+ tc_mem_subregion,
+
+ /* allocation/deallocation */
+ tc_mem_alloc,
+ tc_mem_free,
+
+ /* read (single) */
+ tc_mem_read_1,
+ tc_mem_read_2,
+ tc_mem_read_4,
+ tc_mem_read_8,
+
+ /* read multi */
+ tc_mem_read_multi_1,
+ tc_mem_read_multi_2,
+ tc_mem_read_multi_4,
+ tc_mem_read_multi_8,
+
+ /* read region */
+ tc_mem_read_region_1,
+ tc_mem_read_region_2,
+ tc_mem_read_region_4,
+ tc_mem_read_region_8,
+
+ /* write (single) */
+ tc_mem_write_1,
+ tc_mem_write_2,
+ tc_mem_write_4,
+ tc_mem_write_8,
+
+ /* write multi */
+ tc_mem_write_multi_1,
+ tc_mem_write_multi_2,
+ tc_mem_write_multi_4,
+ tc_mem_write_multi_8,
+
+ /* write region */
+ tc_mem_write_region_1,
+ tc_mem_write_region_2,
+ tc_mem_write_region_4,
+ tc_mem_write_region_8,
+
+ /* set multi */
+ /* XXX IMPLEMENT */
+
+ /* set region */
+ /* XXX IMPLEMENT */
+
+ /* copy */
+ /* XXX IMPLEMENT */
+
+ /* barrier */
+ tc_mem_barrier,
+};
+
+bus_space_tag_t
+tc_bus_mem_init(memv)
void *memv;
{
+ bus_space_tag_t h = &tc_mem_space;
- bc->bc_m_v = memv;
-
- bc->bc_m_map = tc_mem_map;
- bc->bc_m_unmap = tc_mem_unmap;
- bc->bc_m_subregion = tc_mem_subregion;
-
- bc->bc_mr1 = tc_mem_read_1;
- bc->bc_mr2 = tc_mem_read_2;
- bc->bc_mr4 = tc_mem_read_4;
- bc->bc_mr8 = tc_mem_read_8;
-
- bc->bc_mw1 = tc_mem_write_1;
- bc->bc_mw2 = tc_mem_write_2;
- bc->bc_mw4 = tc_mem_write_4;
- bc->bc_mw8 = tc_mem_write_8;
-
- /* XXX DOES NOT BELONG */
- bc->bc_XXX_dmamap = tc_XXX_dmamap;
+ h->abs_cookie = memv;
+ return (h);
}
int
tc_mem_map(v, memaddr, memsize, cacheable, memhp)
void *v;
- bus_mem_addr_t memaddr;
- bus_mem_size_t memsize;
+ bus_addr_t memaddr;
+ bus_size_t memsize;
int cacheable;
- bus_mem_handle_t *memhp;
+ bus_space_handle_t *memhp;
{
if (memaddr & 0x7)
@@ -115,18 +209,18 @@ tc_mem_map(v, memaddr, memsize, cacheable, memhp)
void
tc_mem_unmap(v, memh, memsize)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t memsize;
+ bus_space_handle_t memh;
+ bus_size_t memsize;
{
- /* XXX nothing to do. */
+ /* XXX XX XXX nothing to do. */
}
int
tc_mem_subregion(v, memh, offset, size, nmemh)
void *v;
- bus_mem_handle_t memh, *nmemh;
- bus_mem_size_t offset, size;
+ bus_space_handle_t memh, *nmemh;
+ bus_size_t offset, size;
{
/* Disallow subregioning that would make the handle unaligned. */
@@ -141,15 +235,39 @@ tc_mem_subregion(v, memh, offset, size, nmemh)
return (0);
}
+int
+tc_mem_alloc(v, rstart, rend, size, align, boundary, cacheable, addrp, bshp)
+ void *v;
+ bus_addr_t rstart, rend, *addrp;
+ bus_size_t size, align, boundary;
+ int cacheable;
+ bus_space_handle_t *bshp;
+{
+
+ /* XXX XXX XXX XXX XXX XXX */
+ panic("tc_mem_alloc unimplemented");
+}
+
+void
+tc_mem_free(v, bsh, size)
+ void *v;
+ bus_space_handle_t bsh;
+ bus_size_t size;
+{
+
+ /* XXX XXX XXX XXX XXX XXX */
+ panic("tc_mem_free unimplemented");
+}
+
u_int8_t
tc_mem_read_1(v, memh, off)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
{
volatile u_int8_t *p;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
if ((memh & TC_SPACE_SPARSE) != 0)
panic("tc_mem_read_1 not implemented for sparse space");
@@ -161,12 +279,12 @@ tc_mem_read_1(v, memh, off)
u_int16_t
tc_mem_read_2(v, memh, off)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
{
volatile u_int16_t *p;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
if ((memh & TC_SPACE_SPARSE) != 0)
panic("tc_mem_read_2 not implemented for sparse space");
@@ -178,12 +296,12 @@ tc_mem_read_2(v, memh, off)
u_int32_t
tc_mem_read_4(v, memh, off)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
{
volatile u_int32_t *p;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
if ((memh & TC_SPACE_SPARSE) != 0)
/* Nothing special to do for 4-byte sparse space accesses */
@@ -196,12 +314,12 @@ tc_mem_read_4(v, memh, off)
u_int64_t
tc_mem_read_8(v, memh, off)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
{
volatile u_int64_t *p;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
if ((memh & TC_SPACE_SPARSE) != 0)
panic("tc_mem_read_8 not implemented for sparse space");
@@ -210,11 +328,50 @@ tc_mem_read_8(v, memh, off)
return (*p);
}
+
+#define tc_mem_read_multi_N(BYTES,TYPE) \
+void \
+__abs_c(tc_mem_read_multi_,BYTES)(v, h, o, a, c) \
+ void *v; \
+ bus_space_handle_t h; \
+ bus_size_t o, c; \
+ TYPE *a; \
+{ \
+ \
+ while (c-- > 0) { \
+ tc_mem_barrier(v, h, o, sizeof *a, BUS_BARRIER_READ); \
+ *a++ = __abs_c(tc_mem_read_,BYTES)(v, h, o); \
+ } \
+}
+tc_mem_read_multi_N(1,u_int8_t)
+tc_mem_read_multi_N(2,u_int16_t)
+tc_mem_read_multi_N(4,u_int32_t)
+tc_mem_read_multi_N(8,u_int64_t)
+
+#define tc_mem_read_region_N(BYTES,TYPE) \
+void \
+__abs_c(tc_mem_read_region_,BYTES)(v, h, o, a, c) \
+ void *v; \
+ bus_space_handle_t h; \
+ bus_size_t o, c; \
+ TYPE *a; \
+{ \
+ \
+ while (c-- > 0) { \
+ *a++ = __abs_c(tc_mem_read_,BYTES)(v, h, o); \
+ o += sizeof *a; \
+ } \
+}
+tc_mem_read_region_N(1,u_int8_t)
+tc_mem_read_region_N(2,u_int16_t)
+tc_mem_read_region_N(4,u_int32_t)
+tc_mem_read_region_N(8,u_int64_t)
+
void
tc_mem_write_1(v, memh, off, val)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
u_int8_t val;
{
@@ -237,14 +394,14 @@ tc_mem_write_1(v, memh, off, val)
p = (u_int8_t *)(memh + off);
*p = val;
}
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
}
void
tc_mem_write_2(v, memh, off, val)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
u_int16_t val;
{
@@ -267,14 +424,14 @@ tc_mem_write_2(v, memh, off, val)
p = (u_int16_t *)(memh + off);
*p = val;
}
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
}
void
tc_mem_write_4(v, memh, off, val)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
u_int32_t val;
{
volatile u_int32_t *p;
@@ -285,14 +442,14 @@ tc_mem_write_4(v, memh, off, val)
else
p = (u_int32_t *)(memh + off);
*p = val;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
}
void
tc_mem_write_8(v, memh, off, val)
void *v;
- bus_mem_handle_t memh;
- bus_mem_size_t off;
+ bus_space_handle_t memh;
+ bus_size_t off;
u_int64_t val;
{
volatile u_int64_t *p;
@@ -302,14 +459,56 @@ tc_mem_write_8(v, memh, off, val)
p = (u_int64_t *)(memh + off);
*p = val;
- alpha_mb();
+ alpha_mb(); /* XXX XXX XXX */
+}
+#define tc_mem_write_multi_N(BYTES,TYPE) \
+void \
+__abs_c(tc_mem_write_multi_,BYTES)(v, h, o, a, c) \
+ void *v; \
+ bus_space_handle_t h; \
+ bus_size_t o, c; \
+ const TYPE *a; \
+{ \
+ \
+ while (c-- > 0) { \
+ __abs_c(tc_mem_write_,BYTES)(v, h, o, *a++); \
+ tc_mem_barrier(v, h, o, sizeof *a, BUS_BARRIER_WRITE); \
+ } \
}
+tc_mem_write_multi_N(1,u_int8_t)
+tc_mem_write_multi_N(2,u_int16_t)
+tc_mem_write_multi_N(4,u_int32_t)
+tc_mem_write_multi_N(8,u_int64_t)
+
+#define tc_mem_write_region_N(BYTES,TYPE) \
+void \
+__abs_c(tc_mem_write_region_,BYTES)(v, h, o, a, c) \
+ void *v; \
+ bus_space_handle_t h; \
+ bus_size_t o, c; \
+ const TYPE *a; \
+{ \
+ \
+ while (c-- > 0) { \
+ __abs_c(tc_mem_write_,BYTES)(v, h, o, *a++); \
+ o += sizeof *a; \
+ } \
+}
+tc_mem_write_region_N(1,u_int8_t)
+tc_mem_write_region_N(2,u_int16_t)
+tc_mem_write_region_N(4,u_int32_t)
+tc_mem_write_region_N(8,u_int64_t)
-/* XXX DOES NOT BELONG */
-vm_offset_t
-tc_XXX_dmamap(addr)
- void *addr;
+void
+tc_mem_barrier(v, h, o, l, f)
+ void *v;
+ bus_space_handle_t h;
+ bus_size_t o, l;
+ int f;
{
- return (vtophys((vm_offset_t)addr));
+ if ((f & BUS_BARRIER_READ) != 0)
+ alpha_mb();
+ else if ((f & BUS_BARRIER_WRITE) != 0)
+ alpha_wmb();
}
diff --git a/sys/arch/alpha/tc/tc_machdep.h b/sys/arch/alpha/tc/tc_machdep.h
index 842c8bc023a..529d5ec2567 100644
--- a/sys/arch/alpha/tc/tc_machdep.h
+++ b/sys/arch/alpha/tc/tc_machdep.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: tc_machdep.h,v 1.3 1996/10/30 22:41:23 niklas Exp $ */
-/* $NetBSD: tc_machdep.h,v 1.2 1996/07/09 00:55:35 cgd Exp $ */
+/* $OpenBSD: tc_machdep.h,v 1.4 1996/12/08 00:20:59 niklas Exp $ */
+/* $NetBSD: tc_machdep.h,v 1.3 1996/10/22 21:34:22 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -92,5 +92,4 @@ typedef int32_t tc_offset_t;
#define TC_PHYS_TO_UNCACHED(addr) \
(addr)
-void tc_bus_io_init __P((bus_chipset_tag_t bc, void *iov));;
-void tc_bus_mem_init __P((bus_chipset_tag_t bc, void *memv));;
+bus_space_tag_t tc_bus_mem_init __P((void *memv));;
diff --git a/sys/arch/alpha/tc/tcasic.c b/sys/arch/alpha/tc/tcasic.c
index 208e6a78fd5..a8b31851edf 100644
--- a/sys/arch/alpha/tc/tcasic.c
+++ b/sys/arch/alpha/tc/tcasic.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: tcasic.c,v 1.5 1996/11/23 21:45:01 kstailey Exp $ */
-/* $NetBSD: tcasic.c,v 1.10 1996/10/13 03:00:39 christos Exp $ */
+/* $OpenBSD: tcasic.c,v 1.6 1996/12/08 00:21:00 niklas Exp $ */
+/* $NetBSD: tcasic.c,v 1.12 1996/10/23 04:12:38 cgd Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -88,7 +88,6 @@ tcasicattach(parent, self, aux)
struct tcbus_attach_args tba;
void (*intr_setup) __P((void));
void (*iointr) __P((void *, unsigned long));
- struct alpha_bus_chipset bc;
printf("\n");
tcasicfound = 1;
@@ -132,9 +131,14 @@ tcasicattach(parent, self, aux)
panic("tcasicattach: bad cputype");
}
- tc_bus_io_init(&bc, NULL);
- tc_bus_mem_init(&bc, NULL);
- tba.tba_bc = &bc;
+ tba.tba_memt = tc_bus_mem_init(NULL);
+
+ /* XXX XXX BEGIN XXX XXX */
+ { /* XXX */
+ extern vm_offset_t alpha_XXX_dmamap_or; /* XXX */
+ alpha_XXX_dmamap_or = 0; /* XXX */
+ } /* XXX */
+ /* XXX XXX END XXX XXX */
(*intr_setup)();
set_iointr(iointr);