summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-08-20 19:38:08 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-08-20 19:38:08 +0000
commitbe9f78ec33b526fd9260b23e81c1e4fe27339409 (patch)
tree0e4b2a7abbcc549d9d457cc78b1b1b2b6b6e8745 /sys/arch/arm64
parent80ebb4798d9dad5e8e07404abd054f4746d9ef05 (diff)
Implement bus_space_mmap(9).
ok patrick@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r--sys/arch/arm64/dev/arm64_bus_space.c12
-rw-r--r--sys/arch/arm64/include/bus.h7
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/arm64_bus_space.c b/sys/arch/arm64/dev/arm64_bus_space.c
index c09ee5f4405..34c57e64c74 100644
--- a/sys/arch/arm64/dev/arm64_bus_space.c
+++ b/sys/arch/arm64/dev/arm64_bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arm64_bus_space.c,v 1.6 2018/05/15 11:12:35 kettenis Exp $ */
+/* $OpenBSD: arm64_bus_space.c,v 1.7 2018/08/20 19:38:07 kettenis Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -56,7 +56,8 @@ bus_space_t arm64_bs_tag = {
._space_map = generic_space_map,
._space_unmap = generic_space_unmap,
._space_subregion = generic_space_region,
- ._space_vaddr = generic_space_vaddr
+ ._space_vaddr = generic_space_vaddr,
+ ._space_mmap = generic_space_mmap
};
bus_space_t *fdt_cons_bs_tag = &arm64_bs_tag;
@@ -236,3 +237,10 @@ generic_space_vaddr(bus_space_tag_t t, bus_space_handle_t h)
{
return (void *)h;
}
+
+paddr_t
+generic_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off,
+ int prot, int flags)
+{
+ return (addr + off);
+}
diff --git a/sys/arch/arm64/include/bus.h b/sys/arch/arm64/include/bus.h
index d479faaaa76..0e2b68b4084 100644
--- a/sys/arch/arm64/include/bus.h
+++ b/sys/arch/arm64/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.4 2018/05/15 11:12:35 kettenis Exp $ */
+/* $OpenBSD: bus.h,v 1.5 2018/08/20 19:38:07 kettenis Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
*
@@ -82,6 +82,8 @@ struct bus_space {
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);
+ paddr_t (*_space_mmap)(bus_space_tag_t, bus_addr_t, off_t,
+ int, int);
};
#define bus_space_read_1(t, h, o) (*(t)->_space_read_1)((t), (h), (o))
@@ -119,6 +121,8 @@ struct bus_space {
#define BUS_SPACE_MAP_PREFETCHABLE 0x08
#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h))
+#define bus_space_mmap(t, a, o, p, f) \
+ (*(t)->_space_mmap)((t), (a), (o), (p), (f))
/*----------------------------------------------------------------------------*/
#define bus_space_read_multi(n,m) \
@@ -479,6 +483,7 @@ void generic_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
int generic_space_region(bus_space_tag_t, bus_space_handle_t, bus_size_t,
bus_size_t, bus_space_handle_t *);
void *generic_space_vaddr(bus_space_tag_t, bus_space_handle_t);
+paddr_t generic_space_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int);
uint8_t generic_space_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t);
uint16_t generic_space_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t);
uint32_t generic_space_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t);