From 6a518ee6ff587aecc1d4e18d8bfda0535165bb1a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 17 Jun 2009 08:31:12 -0700 Subject: [PATCH] BUSDMA - Add bus_space_kva() * Add bus_space_kva(), a function which returns a real pointer to access things like mapped shared memory (used by SILI). -Matt --- sys/cpu/amd64/include/bus_dma.h | 8 ++++++++ sys/cpu/i386/include/bus_at386.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/sys/cpu/amd64/include/bus_dma.h b/sys/cpu/amd64/include/bus_dma.h index cd03113ce7..cbd64a1096 100644 --- a/sys/cpu/amd64/include/bus_dma.h +++ b/sys/cpu/amd64/include/bus_dma.h @@ -106,6 +106,14 @@ bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t bsh, return (0); } +static __inline void * +bus_space_kva(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) +{ + if (tag == I386_BUS_SPACE_IO) + return (NULL); + return ((void *)(handle + offset)); +} + /* * Allocate a region of memory that is accessible to devices in bus space. */ diff --git a/sys/cpu/i386/include/bus_at386.h b/sys/cpu/i386/include/bus_at386.h index 3b36bb6abb..f58cede892 100644 --- a/sys/cpu/i386/include/bus_at386.h +++ b/sys/cpu/i386/include/bus_at386.h @@ -144,6 +144,14 @@ bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t bsh, return (0); } +static __inline void * +bus_space_kva(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) +{ + if (tag == I386_BUS_SPACE_IO) + return (NULL); + return ((void *)(handle + offset)); +} + /* * Allocate a region of memory that is accessible to devices in bus space. */ -- 2.41.0