Some drivers call dma_inv_range() on buffers, on arm these buffers must be cache line aligned. This patch introduces a generic dma_alloc, dma_free. Archs can implement in their own functions in "asm/dma.h" and add a: #define dma_alloc dma_alloc #define dma_free dma_free On all other archs the generic versions, which translate into xmalloc and free are used. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
31 lines
412 B
C
31 lines
412 B
C
/*
|
|
* Copyright (C) 2012 by Marc Kleine-Budde <mkl@pengutronix.de>
|
|
*
|
|
* This file is released under the GPLv2
|
|
*
|
|
*/
|
|
|
|
#ifndef __DMA_H
|
|
#define __DMA_H
|
|
|
|
#include <malloc.h>
|
|
#include <xfuncs.h>
|
|
|
|
#include <asm/dma.h>
|
|
|
|
#ifndef dma_alloc
|
|
static inline void *dma_alloc(size_t size)
|
|
{
|
|
return xmalloc(size);
|
|
}
|
|
#endif
|
|
|
|
#ifndef dma_free
|
|
static inline void dma_free(void *mem)
|
|
{
|
|
free(mem);
|
|
}
|
|
#endif
|
|
|
|
#endif /* __DMA_H */
|