From 181e506248fd24a0febbfbd794bba43a7b346115 Mon Sep 17 00:00:00 2001 From: Kathiravan T Date: Fri, 17 Jan 2014 10:33:08 -0800 Subject: [PATCH] arm64: provide dma cache routines with same API as 32 bit The APIs __dma_inv_range() and __dma_clean_range() were not exported by the third party patch. Since the functions starting with underscores are not to be directly used by drivers, related functions without the underscores are provided which have the same name and functionality as the 32 bit APIs. CRs-Fixed: 1053067 Change-Id: Ie0e681614307d9d9a19e58cacfb9b5dff4528977 arm64: add defines for dmac_*_range for compatibility with arm32 An earlier patch created defines for dma_*_range APIs to be compatible with arm 32 bit, however it appears these API names have not (at least yet) appeared there, so revise the names to dmac_*_range, which is defined for arm 32 bit so that there is one name defined for both architectures. CRs-Fixed: 1053067 Signed-off-by: Larry Bassel (cherry picked from commit 0930bab0db67cc0d91e52e385e3e061871c6be05) [psodagud: fixed up trivial merge conflicts and warnings] Signed-off-by: Prasad Sodagudi (cherry picked from commit a313e54567627a1fd96cd267e2c6c358d14e468c) [kathirav: fixed the trivial conflicts] Change-Id: I6456c02bad73fb54a874dc9925d3d43d9b8be2f2 Signed-off-by: Kathiravan T --- arch/arm64/include/asm/cacheflush.h | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -102,6 +102,15 @@ static inline void flush_icache_range(un extern void __dma_map_area(const void *, size_t, int); extern void __dma_unmap_area(const void *, size_t, int); extern void __dma_flush_area(const void *, size_t); +extern void __dma_inv_area(const void *start, size_t size); +extern void __dma_clean_area(const void *start, size_t size); + +#define dmac_flush_range(start, end) \ + __dma_flush_area(start, (void *)(end) - (void *)(start)) +#define dmac_inv_range(start, end) \ + __dma_inv_area(start, (void *)(end) - (void *)(start)) +#define dmac_clean_range(start, end) \ + __dma_clean_area(start, (void *)(end) - (void *)(start)) /* * Copy user data from/to a page which is mapped into a different