9
0
Fork 0

MIPS: add dma_alloc_coherent()

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Antony Pavlov 2014-07-04 01:27:01 +04:00 committed by Sascha Hauer
parent e829b7c0c8
commit eb062ecbdf
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#ifndef _ASM_DMA_MAPPING_H
#define _ASM_DMA_MAPPING_H
#include <xfuncs.h>
#include <asm/addrspace.h>
#include <asm/types.h>
#include <malloc.h>
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 */