From eb062ecbdf77e3fa10e8ea64414c4e1a12fecf5e Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Fri, 4 Jul 2014 01:27:01 +0400 Subject: [PATCH] MIPS: add dma_alloc_coherent() Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/include/asm/dma-mapping.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 arch/mips/include/asm/dma-mapping.h diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h new file mode 100644 index 000000000..555efa577 --- /dev/null +++ b/arch/mips/include/asm/dma-mapping.h @@ -0,0 +1,25 @@ +#ifndef _ASM_DMA_MAPPING_H +#define _ASM_DMA_MAPPING_H + +#include +#include +#include +#include + +static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle) +{ + void *ret; + + ret = xmemalign(PAGE_SIZE, size); + + *dma_handle = CPHYSADDR(ret); + + return (void *)CKSEG1ADDR(ret); +} + +static inline void dma_free_coherent(void *vaddr) +{ + free(vaddr); +} + +#endif /* _ASM_DMA_MAPPING_H */