diff options
Diffstat (limited to 'arch/nios2/include/asm/dma-mapping.h')
-rw-r--r-- | arch/nios2/include/asm/dma-mapping.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h index 5b70f4cead..9819a973e7 100644 --- a/arch/nios2/include/asm/dma-mapping.h +++ b/arch/nios2/include/asm/dma-mapping.h @@ -1,8 +1,12 @@ #ifndef __ASM_NIOS2_DMA_MAPPING_H #define __ASM_NIOS2_DMA_MAPPING_H +#include <common.h> +#include <xfuncs.h> + #include <asm/cache.h> + /* dma_alloc_coherent() return cache-line aligned allocation which is mapped * to uncached io region. * @@ -22,4 +26,10 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) return (void *)(*handle | IO_REGION_BASE); } +#define dma_alloc dma_alloc +static inline void *dma_alloc(size_t size) +{ + return xmemalign(DCACHE_LINE_SIZE, ALIGN(size, DCACHE_LINE_SIZE)); +} + #endif /* __ASM_NIOS2_DMA_MAPPING_H */ |