summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/dma-mapping.h
blob: 639511226d16974c01c4273f7c7d6603d48a4a39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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);

	if (dma_handle)
		*dma_handle = CPHYSADDR(ret);

	return (void *)CKSEG1ADDR(ret);
}

static inline void dma_free_coherent(void *vaddr, dma_addr_t dma_handle,
				     size_t size)
{
	free(vaddr);
}

#endif /* _ASM_DMA_MAPPING_H */