summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-03-30 20:14:41 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-03-30 20:14:41 +0000
commit4da26b55cbe8cf129b37638e6b39d6a74aa763c2 (patch)
treef2cfbf86ebadab2d5bbd4080d521ca208e3fee0b /sys/arch/sgi/include
parent48df6ce4c0798cc1d04adf27a5fb3236f0a07bd0 (diff)
Implement bus_space_*8 and bus_space_vaddr.
Diffstat (limited to 'sys/arch/sgi/include')
-rw-r--r--sys/arch/sgi/include/bus.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/sys/arch/sgi/include/bus.h b/sys/arch/sgi/include/bus.h
index 1a47d7e57f5..cc6b1abe01b 100644
--- a/sys/arch/sgi/include/bus.h
+++ b/sys/arch/sgi/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.8 2008/02/20 19:13:38 miod Exp $ */
+/* $OpenBSD: bus.h,v 1.9 2008/03/30 20:14:38 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
@@ -72,6 +72,7 @@ struct mips_bus_space {
bus_size_t);
int (*_space_subregion)(bus_space_tag_t, bus_space_handle_t,
bus_size_t, bus_size_t, bus_space_handle_t *);
+ void * (*_space_vaddr)(bus_space_tag_t, bus_space_handle_t);
};
#define bus_space_read_1(t, h, o) (*(t)->_space_read_1)((t), (h), (o))
@@ -89,6 +90,8 @@ struct mips_bus_space {
#define bus_space_subregion(t, h, o, s, p) \
(*(t)->_space_subregion)((t), (h), (o), (s), (p))
+#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h))
+
/* Helper function in pmap.c */
int bus_mem_add_mapping(bus_addr_t, bus_size_t, int, bus_space_handle_t *);
@@ -106,8 +109,7 @@ CAT(bus_space_read_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_read_multi(1,8)
bus_space_read_multi(2,16)
bus_space_read_multi(4,32)
-
-#define bus_space_read_multi_8 !!! bus_space_read_multi_8 not implemented !!!
+bus_space_read_multi(8,64)
/*----------------------------------------------------------------------------*/
#define bus_space_read_region(n,m) \
@@ -122,8 +124,7 @@ CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_read_region(1,8)
bus_space_read_region(2,16)
bus_space_read_region(4,32)
-
-#define bus_space_read_region_8 !!! bus_space_read_region_8 not implemented !!!
+bus_space_read_region(8,64)
/*----------------------------------------------------------------------------*/
#define bus_space_write_multi(n,m) \
@@ -139,8 +140,7 @@ CAT(bus_space_write_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_write_multi(1,8)
bus_space_write_multi(2,16)
bus_space_write_multi(4,32)
-
-#define bus_space_write_multi_8 !!! bus_space_write_multi_8 not implemented !!!
+bus_space_write_multi(8,64)
/*----------------------------------------------------------------------------*/
#define bus_space_write_region(n,m) \
@@ -157,9 +157,7 @@ CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_write_region(1,8)
bus_space_write_region(2,16)
bus_space_write_region(4,32)
-
-#define bus_space_write_region_8 \
- !!! bus_space_write_region_8 not implemented !!!
+bus_space_write_region(8,64)
/*----------------------------------------------------------------------------*/
#define bus_space_set_region(n,m) \
@@ -176,6 +174,7 @@ CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_set_region(1,8)
bus_space_set_region(2,16)
bus_space_set_region(4,32)
+bus_space_set_region(8,64)
/*----------------------------------------------------------------------------*/
#define bus_space_read_raw_multi(n,m,l) \
@@ -189,9 +188,7 @@ CAT(bus_space_read_raw_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_space_read_raw_multi(2,16,1)
bus_space_read_raw_multi(4,32,2)
-
-#define bus_space_read_raw_multi_8 \
- !!! bus_space_read_raw_multi_8 not implemented !!!
+bus_space_read_raw_multi(8,64,3)
/*----------------------------------------------------------------------------*/
#define bus_space_write_raw_multi(n,m,l) \
@@ -205,9 +202,7 @@ CAT(bus_space_write_raw_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh,\
bus_space_write_raw_multi(2,16,1)
bus_space_write_raw_multi(4,32,2)
-
-#define bus_space_write_raw_multi_8 \
- !!! bus_space_write_raw_multi_8 not implemented !!!
+bus_space_write_raw_multi(8,64,3)
/*----------------------------------------------------------------------------*/
static __inline void
@@ -244,8 +239,16 @@ bus_space_copy_4(void *v, bus_space_handle_t h1, bus_size_t o1,
*d++ = *s++;
}
-#define bus_space_copy_8 \
- !!! bus_space_write_raw_multi_8 not implemented !!!
+static __inline void
+bus_space_copy_8(void *v, bus_space_handle_t h1, bus_size_t o1,
+ bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
+{
+ int64_t *s = (int64_t *)(h1 + o1);
+ int64_t *d = (int64_t *)(h2 + o2);
+
+ while (c--)
+ *d++ = *s++;
+}
/*----------------------------------------------------------------------------*/
/*