@@ -44,60 +44,17 @@ void dma_cache_wback(phys_addr_t start, unsigned long sz);
4444
4545#define flush_cache_dup_mm (mm ) /* called on fork (VIVT only) */
4646
47- #ifndef CONFIG_ARC_CACHE_VIPT_ALIASING
48-
4947#define flush_cache_mm (mm ) /* called on munmap/exit */
5048#define flush_cache_range (mm , u_vstart , u_vend )
5149#define flush_cache_page (vma , u_vaddr , pfn ) /* PF handling/COW-break */
5250
53- #else /* VIPT aliasing dcache */
54-
55- /* To clear out stale userspace mappings */
56- void flush_cache_mm (struct mm_struct * mm );
57- void flush_cache_range (struct vm_area_struct * vma ,
58- unsigned long start ,unsigned long end );
59- void flush_cache_page (struct vm_area_struct * vma ,
60- unsigned long user_addr , unsigned long page );
61-
62- /*
63- * To make sure that userspace mapping is flushed to memory before
64- * get_user_pages() uses a kernel mapping to access the page
65- */
66- #define ARCH_HAS_FLUSH_ANON_PAGE
67- void flush_anon_page (struct vm_area_struct * vma ,
68- struct page * page , unsigned long u_vaddr );
69-
70- #endif /* CONFIG_ARC_CACHE_VIPT_ALIASING */
71-
7251/*
7352 * A new pagecache page has PG_arch_1 clear - thus dcache dirty by default
7453 * This works around some PIO based drivers which don't call flush_dcache_page
7554 * to record that they dirtied the dcache
7655 */
7756#define PG_dc_clean PG_arch_1
7857
79- #define CACHE_COLORS_NUM 4
80- #define CACHE_COLORS_MSK (CACHE_COLORS_NUM - 1)
81- #define CACHE_COLOR (addr ) (((unsigned long)(addr) >> (PAGE_SHIFT)) & CACHE_COLORS_MSK)
82-
83- /*
84- * Simple wrapper over config option
85- * Bootup code ensures that hardware matches kernel configuration
86- */
87- static inline int cache_is_vipt_aliasing (void )
88- {
89- return IS_ENABLED (CONFIG_ARC_CACHE_VIPT_ALIASING );
90- }
91-
92- /*
93- * checks if two addresses (after page aligning) index into same cache set
94- */
95- #define addr_not_cache_congruent (addr1 , addr2 ) \
96- ({ \
97- cache_is_vipt_aliasing() ? \
98- (CACHE_COLOR(addr1) != CACHE_COLOR(addr2)) : 0; \
99- })
100-
10158#define copy_to_user_page (vma , page , vaddr , dst , src , len ) \
10259do { \
10360 memcpy(dst, src, len); \
0 commit comments