diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/bus_space.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/include/bus.h | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/bus_space.c b/sys/arch/amd64/amd64/bus_space.c index 8420864af57..1ac53b0b6bc 100644 --- a/sys/arch/amd64/amd64/bus_space.c +++ b/sys/arch/amd64/amd64/bus_space.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_space.c,v 1.6 2007/05/27 08:59:25 art Exp $ */ +/* $OpenBSD: bus_space.c,v 1.7 2007/08/31 20:11:09 marco Exp $ */ /* $NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp $ */ /*- @@ -113,6 +113,8 @@ x86_memio_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, */ if (t == X86_BUS_SPACE_IO) { ex = ioport_ex; + if (flags & BUS_SPACE_MAP_LINEAR) + return (EINVAL); } else if (t == X86_BUS_SPACE_MEM) ex = iomem_ex; else diff --git a/sys/arch/amd64/include/bus.h b/sys/arch/amd64/include/bus.h index 8a8e79b6447..9970e0f3191 100644 --- a/sys/arch/amd64/include/bus.h +++ b/sys/arch/amd64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.5 2006/04/27 15:17:12 mickey Exp $ */ +/* $OpenBSD: bus.h,v 1.6 2007/08/31 20:11:09 marco Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -953,6 +953,19 @@ bus_space_barrier(bus_space_tag_t tag, bus_space_handle_t bsh, __asm __volatile("lfence"); } +#define BUS_SPACE_MAP_CACHEABLE 0x0001 +#define BUS_SPACE_MAP_LINEAR 0x0002 +#define BUS_SPACE_MAP_PREFETCHABLE 0x0008 + +/* + * 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. + * (XXX not enforced) + */ +#define bus_space_vaddr(t, h) \ + ((t) == X86_BUS_SPACE_IO ? (void *)(NULL) : (void *)(h)) /* * Flags used in various bus DMA methods. */ |