1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2007 4 * Stelian Pop <stelian@popies.net> 5 * Lead Tech Design <www.leadtechdesign.com> 6 */ 7 #ifndef __ASM_X86_DMA_MAPPING_H 8 #define __ASM_X86_DMA_MAPPING_H 9 10 #include <common.h> 11 #include <asm/cache.h> 12 #include <cpu_func.h> 13 #include <linux/dma-direction.h> 14 #include <linux/types.h> 15 #include <malloc.h> 16 dma_alloc_coherent(size_t len,unsigned long * handle)17static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) 18 { 19 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); 20 return (void *)*handle; 21 } 22 dma_free_coherent(void * addr)23static inline void dma_free_coherent(void *addr) 24 { 25 free(addr); 26 } 27 28 #endif /* __ASM_X86_DMA_MAPPING_H */ 29