21#define DMAAPI_PREFIX_op
23#define DMAAPI_PREFIX_op __op_
27#define DMAAPI_PREFIX_flat
29#define DMAAPI_PREFIX_flat __flat_
92 size_t len,
size_t align );
114 size_t len,
size_t align );
141#define DMA_BI ( DMA_TX | DMA_RX )
150#define DMAAPI_INLINE( _subsys, _api_func ) \
151 SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func )
160#define PROVIDE_DMAAPI( _subsys, _api_func, _func ) \
161 PROVIDE_SINGLE_API ( DMAAPI_PREFIX_ ## _subsys, _api_func, _func )
169#define PROVIDE_DMAAPI_INLINE( _subsys, _api_func ) \
170 PROVIDE_SINGLE_API_INLINE ( DMAAPI_PREFIX_ ## _subsys, _api_func )
226 size_t len,
size_t align ) {
336 return virt_to_phys (
addr );
350 return ( virt_to_phys (
addr ) +
map->offset );
387 size_t len,
size_t align );
408 size_t len,
size_t align );
#define NULL
NULL pointer (VOID *)
#define assert(condition)
Assert a condition at run-time.
Dummy architecture-specific DMA API implementations.
uint32_t addr
Buffer address.
#define __always_inline
Declare a function to be always inline.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
static __always_inline void * umalloc(size_t size)
Allocate external memory.
static __always_inline void ufree(void *ptr)
Free external memory.
static __always_inline void dma_set_mask_64bit(struct dma_device *dma)
Set 64-bit addressable space mask.
static __always_inline void dma_init(struct dma_device *dma, struct dma_operations *op)
Initialise DMA device.
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.
static __always_inline int struct dma_mapping * map
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.
static __always_inline int dma_mapped(struct dma_mapping *map)
Check if DMA unmapping is required.
void dma_unmap(struct dma_mapping *map, size_t len)
Unmap buffer.
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
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 dma_set_mask(struct dma_device *dma, physaddr_t mask)
Set addressable space mask.
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Dynamic memory allocation.
static uint16_t struct vmbus_xfer_pages_operations * op
physaddr_t mask
Addressable space mask.
struct dma_operations * op
DMA operations.
unsigned int mapped
Total number of mappings (for debugging)
unsigned int allocated
Total number of allocations (for debugging)
void * token
Platform mapping token.
struct dma_device * dma
DMA device (if unmapping is required)
physaddr_t offset
Address offset.
void(* unmap)(struct dma_device *dma, struct dma_mapping *map, size_t len)
Unmap buffer.
void(* set_mask)(struct dma_device *dma, physaddr_t mask)
Set addressable space mask.
int(* map)(struct dma_device *dma, struct dma_mapping *map, void *addr, size_t len, int flags)
Map buffer for DMA.
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.
void(* free)(struct dma_device *dma, struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.