1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Port on Texas Instruments TMS320C6x architecture
5 * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
8 #ifndef _ASM_C6X_CACHEFLUSH_H
9 #define _ASM_C6X_CACHEFLUSH_H
11 #include <linux/spinlock.h>
13 #include <asm/setup.h>
14 #include <asm/cache.h>
17 #include <asm/string.h>
20 * physically-indexed cache management
22 #define flush_icache_range(s, e) \
24 L1D_cache_block_writeback((s), (e)); \
25 L1P_cache_block_invalidate((s), (e)); \
28 #define flush_icache_page(vma, page) \
30 if ((vma)->vm_flags & PROT_EXEC) \
31 L1D_cache_block_writeback_invalidate(page_address(page), \
32 (unsigned long) page_address(page) + PAGE_SIZE)); \
33 L1P_cache_block_invalidate(page_address(page), \
34 (unsigned long) page_address(page) + PAGE_SIZE)); \
37 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
39 memcpy(dst, src, len); \
40 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
43 #include <asm-generic/cacheflush.h>
45 #endif /* _ASM_C6X_CACHEFLUSH_H */