1 From 74ff908650ed96eac907178fb5888f967cefb282 Mon Sep 17 00:00:00 2001
2 From: Dan Pasanen <dan.pasanen@gmail.com>
3 Date: Thu, 21 Sep 2017 09:55:42 -0500
4 Subject: [PATCH] arm: partially revert
5 702b94bff3c50542a6e4ab9a4f4cef093262fe65
7 * Re-expose some dmi APIs for use in VCSM
9 arch/arm/include/asm/cacheflush.h | 21 +++++++++++++++++++++
10 arch/arm/include/asm/glue-cache.h | 2 ++
11 arch/arm/mm/proc-macros.S | 2 ++
12 arch/arm/mm/proc-syms.c | 3 +++
13 4 files changed, 28 insertions(+)
15 --- a/arch/arm/include/asm/cacheflush.h
16 +++ b/arch/arm/include/asm/cacheflush.h
21 + * dma_inv_range(start, end)
23 + * Invalidate (discard) the specified virtual address range.
24 + * May not write back any entries. If 'start' or 'end'
25 + * are not cache line aligned, those lines must be written
27 + * - start - virtual start address
28 + * - end - virtual end address
30 + * dma_clean_range(start, end)
32 + * Clean (write back) the specified virtual address range.
33 + * - start - virtual start address
34 + * - end - virtual end address
36 * dma_flush_range(start, end)
38 * Clean and invalidate the specified virtual address range.
39 @@ -112,6 +127,8 @@ struct cpu_cache_fns {
40 void (*dma_map_area)(const void *, size_t, int);
41 void (*dma_unmap_area)(const void *, size_t, int);
43 + void (*dma_inv_range)(const void *, const void *);
44 + void (*dma_clean_range)(const void *, const void *);
45 void (*dma_flush_range)(const void *, const void *);
46 } __no_randomize_layout;
48 @@ -137,6 +154,8 @@ extern struct cpu_cache_fns cpu_cache;
49 * is visible to DMA, or data written by DMA to system memory is
52 +#define dmac_inv_range cpu_cache.dma_inv_range
53 +#define dmac_clean_range cpu_cache.dma_clean_range
54 #define dmac_flush_range cpu_cache.dma_flush_range
57 @@ -156,6 +175,8 @@ extern void __cpuc_flush_dcache_area(voi
58 * is visible to DMA, or data written by DMA to system memory is
61 +extern void dmac_inv_range(const void *, const void *);
62 +extern void dmac_clean_range(const void *, const void *);
63 extern void dmac_flush_range(const void *, const void *);
66 --- a/arch/arm/include/asm/glue-cache.h
67 +++ b/arch/arm/include/asm/glue-cache.h
68 @@ -155,6 +155,8 @@ static inline void nop_dma_unmap_area(co
69 #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
70 #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
72 +#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
73 +#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
74 #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
77 --- a/arch/arm/mm/proc-macros.S
78 +++ b/arch/arm/mm/proc-macros.S
79 @@ -336,6 +336,8 @@ ENTRY(\name\()_cache_fns)
80 .long \name\()_flush_kern_dcache_area
81 .long \name\()_dma_map_area
82 .long \name\()_dma_unmap_area
83 + .long \name\()_dma_inv_range
84 + .long \name\()_dma_clean_range
85 .long \name\()_dma_flush_range
86 .size \name\()_cache_fns, . - \name\()_cache_fns
88 --- a/arch/arm/mm/proc-syms.c
89 +++ b/arch/arm/mm/proc-syms.c
90 @@ -27,6 +27,9 @@ EXPORT_SYMBOL(__cpuc_flush_user_all);
91 EXPORT_SYMBOL(__cpuc_flush_user_range);
92 EXPORT_SYMBOL(__cpuc_coherent_kern_range);
93 EXPORT_SYMBOL(__cpuc_flush_dcache_area);
94 +EXPORT_SYMBOL(dmac_inv_range);
95 +EXPORT_SYMBOL(dmac_clean_range);
96 +EXPORT_SYMBOL(dmac_flush_range);
98 EXPORT_SYMBOL(cpu_cache);