20 #define DMAAPI_PREFIX_op 22 #define DMAAPI_PREFIX_op __op_ 26 #define DMAAPI_PREFIX_flat 28 #define DMAAPI_PREFIX_flat __flat_ 91 size_t len,
size_t align );
113 size_t len,
size_t align );
140 #define DMA_BI ( DMA_TX | DMA_RX ) 149 #define DMAAPI_INLINE( _subsys, _api_func ) \ 150 SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) 159 #define PROVIDE_DMAAPI( _subsys, _api_func, _func ) \ 160 PROVIDE_SINGLE_API ( DMAAPI_PREFIX_ ## _subsys, _api_func, _func ) 168 #define PROVIDE_DMAAPI_INLINE( _subsys, _api_func ) \ 169 PROVIDE_SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func ) 225 size_t len,
size_t align ) {
335 return virt_to_phys (
addr );
386 size_t len,
size_t align );
407 size_t len,
size_t align );
static __always_inline void ufree(void *ptr)
Free external memory.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void(* ufree)(struct dma_device *dma, struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer from external (user) memory.
struct dma_device * dma
DMA device (if unmapping is required)
void dma_unmap(struct dma_mapping *map, size_t len)
Unmap buffer.
static __always_inline int struct dma_mapping void *addr __unused
struct dma_operations * op
DMA operations.
static __always_inline void dma_set_mask_64bit(struct dma_device *dma)
Set 64-bit addressable space mask.
void dma_set_mask(struct dma_device *dma, physaddr_t mask)
Set addressable space mask.
Dynamic memory allocation.
Dummy architecture-specific DMA API implementations.
physaddr_t mask
Addressable space mask.
void dma_free(struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.
#define DMAAPI_INLINE(_subsys, _api_func)
Calculate static inline DMA I/O API function name.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static __always_inline int dma_mapped(struct dma_mapping *map)
Check if DMA unmapping is required.
void(* unmap)(struct dma_device *dma, struct dma_mapping *map, size_t len)
Unmap buffer.
physaddr_t offset
Address offset.
void * dma_umalloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer from external (user) memory.
void(* set_mask)(struct dma_device *dma, physaddr_t mask)
Set addressable space mask.
#define __always_inline
Declare a function to be always inline.
uint32_t addr
Buffer address.
void dma_ufree(struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer from external (user) memory.
void * dma_alloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer.
unsigned int mapped
Total number of mappings (for debugging)
static uint16_t struct vmbus_xfer_pages_operations * op
unsigned int allocated
Total number of allocations (for debugging)
static __always_inline void dma_init(struct dma_device *dma, struct dma_operations *op)
Initialise DMA device.
static __always_inline int struct dma_mapping * map
int(* map)(struct dma_device *dma, struct dma_mapping *map, void *addr, size_t len, int flags)
Map buffer for DMA.
static __always_inline void * umalloc(size_t size)
Allocate external memory.
void * token
Platform mapping token.
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
void(* free)(struct dma_device *dma, struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.
#define NULL
NULL pointer (VOID *)
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.