2 * @ingroup adf_os_public
4 * This file abstracts DMA operations.
10 #include <adf_os_types.h>
11 #include <adf_os_dma_pvt.h>
14 * @brief a dma address representation of a platform
18 * @brief Allocate a DMA buffer and map it to local bus address space
20 * @param[in] osdev platform device instance
21 * @param[in] size DMA buffer size
22 * @param[in] coherent 0 => cached.
23 * @param[out] dmap opaque coherent memory handle
25 * @return returns the virtual address of the memory
28 adf_os_dmamem_alloc(adf_os_device_t osdev,
31 adf_os_dma_map_t *dmap)
33 return __adf_os_dmamem_alloc(osdev, size, coherent, dmap);
37 * @brief Free a previously mapped DMA buffer
39 * @param[in] osdev platform device instance
40 * @param[in] size DMA buffer size
41 * @param[in] coherent 0 => cached.
42 * @param[in] vaddr virtual address of DMA buffer
43 * @param[in] dmap memory handle
46 adf_os_dmamem_free(adf_os_device_t osdev,
50 adf_os_dma_map_t dmap)
52 __adf_os_dmamem_free(osdev, size, coherent, vaddr, dmap);
56 * @brief given a dmamem map, returns the (bus) address
58 * @param[in] dmap memory handle
60 * @return the (bus) address
62 static inline adf_os_dma_addr_t
63 adf_os_dmamem_map2addr(adf_os_dma_map_t dmap)
65 return(__adf_os_dmamem_map2addr(dmap));
69 * @brief Flush and invalidate cache for a given dmamem map
71 * @param[in] osdev platform device instance
72 * @param[in] dmap mem handle
73 * @param[in] op op code for sync type, (see @ref adf_os_types.h)
76 adf_os_dmamem_cache_sync(adf_os_device_t osdev,
77 adf_os_dma_map_t dmap,
78 adf_os_cache_sync_t op)
80 __adf_os_dmamem_cache_sync(osdev, dmap, op);
84 * @brief Get the cpu cache line size
86 * @return The CPU cache line size in bytes.
88 static inline adf_os_size_t
89 adf_os_cache_line_size(void)
91 return __adf_os_cache_line_size();