dma-mapping.h 659 B

12345678910111213141516171819202122232425262728
  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_ARM_DMA_MAPPING_H
  8. #define __ASM_ARM_DMA_MAPPING_H
  9. #include <asm/cache.h>
  10. #include <cpu_func.h>
  11. #include <linux/dma-direction.h>
  12. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <malloc.h>
  15. static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
  16. {
  17. *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
  18. return (void *)*handle;
  19. }
  20. static inline void dma_free_coherent(void *addr)
  21. {
  22. free(addr);
  23. }
  24. #endif /* __ASM_ARM_DMA_MAPPING_H */