summaryrefslogtreecommitdiff
path: root/sys/arch/socppc/include/bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/socppc/include/bus.h')
-rw-r--r--sys/arch/socppc/include/bus.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/sys/arch/socppc/include/bus.h b/sys/arch/socppc/include/bus.h
index 839f18e6cd4..1150642c755 100644
--- a/sys/arch/socppc/include/bus.h
+++ b/sys/arch/socppc/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.9 2014/03/29 18:09:30 guenther Exp $ */
+/* $OpenBSD: bus.h,v 1.10 2015/01/20 17:08:35 mpi Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom. All rights reserved.
@@ -76,11 +76,20 @@ int bus_space_alloc(bus_space_tag_t tag, bus_addr_t rstart,
bus_space_handle_t *handlep);
void bus_space_free(bus_space_tag_t tag, bus_space_handle_t handle,
bus_size_t size);
+paddr_t bus_space_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int);
#define BUS_SPACE_MAP_CACHEABLE 0x01
#define BUS_SPACE_MAP_LINEAR 0x02
#define BUS_SPACE_MAP_PREFETCHABLE 0x04
+/*
+ * void *bus_space_vaddr(bus_space_tag_t, bus_space_handle_t);
+ *
+ * Get the kernel virtual address for the mapped bus space.
+ * Only allowed for regions mapped with BUS_SPACE_MAP_LINEAR.
+ */
+#define bus_space_vaddr(t, h) ((void *)(h))
+
#define bus_space_read(n,m) \
static __inline CAT3(u_int,m,_t) \
CAT(bus_space_read_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
@@ -439,18 +448,19 @@ bus_space_copy_4(void *v, bus_space_handle_t h1, bus_space_handle_t h2,
#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */
#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */
-#define BUS_DMA_WAITOK 0x000 /* safe to sleep (pseudo-flag) */
-#define BUS_DMA_NOWAIT 0x001 /* not safe to sleep */
-#define BUS_DMA_ALLOCNOW 0x002 /* perform resource allocation now */
-#define BUS_DMA_COHERENT 0x008 /* hint: map memory DMA coherent */
-#define BUS_DMA_BUS1 0x010 /* placeholders for bus functions... */
-#define BUS_DMA_BUS2 0x020
-#define BUS_DMA_BUS3 0x040
-#define BUS_DMA_BUS4 0x080
-#define BUS_DMA_READ 0x100 /* mapping is device -> memory only */
-#define BUS_DMA_WRITE 0x200 /* mapping is memory -> device only */
-#define BUS_DMA_STREAMING 0x400 /* hint: sequential, unidirectional */
-#define BUS_DMA_ZERO 0x800 /* zero memory in dmamem_alloc */
+#define BUS_DMA_WAITOK 0x0000 /* safe to sleep (pseudo-flag) */
+#define BUS_DMA_NOWAIT 0x0001 /* not safe to sleep */
+#define BUS_DMA_ALLOCNOW 0x0002 /* perform resource allocation now */
+#define BUS_DMA_COHERENT 0x0008 /* hint: map memory DMA coherent */
+#define BUS_DMA_BUS1 0x0010 /* placeholders for bus functions... */
+#define BUS_DMA_BUS2 0x0020
+#define BUS_DMA_BUS3 0x0040
+#define BUS_DMA_BUS4 0x0080
+#define BUS_DMA_READ 0x0100 /* mapping is device -> memory only */
+#define BUS_DMA_WRITE 0x0200 /* mapping is memory -> device only */
+#define BUS_DMA_STREAMING 0x0400 /* hint: sequential, unidirectional */
+#define BUS_DMA_ZERO 0x0800 /* zero memory in dmamem_alloc */
+#define BUS_DMA_NOCACHE 0x1000 /* map memory uncached */
/* Forwards needed by prototypes below. */