1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Port on Texas Instruments TMS320C6x architecture 4 * 5 * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated 6 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) 7 */ 8 #ifndef _ASM_C6X_CACHEFLUSH_H 9 #define _ASM_C6X_CACHEFLUSH_H 10 11 #include <linux/spinlock.h> 12 13 #include <asm/setup.h> 14 #include <asm/cache.h> 15 #include <asm/mman.h> 16 #include <asm/page.h> 17 #include <asm/string.h> 18 19 /* 20 * physically-indexed cache management 21 */ 22 #define flush_icache_range(s, e) \ 23 do { \ 24 L1D_cache_block_writeback((s), (e)); \ 25 L1P_cache_block_invalidate((s), (e)); \ 26 } while (0) 27 28 #define flush_icache_page(vma, page) \ 29 do { \ 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)); \ 35 } while (0) 36 37 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 38 do { \ 39 memcpy(dst, src, len); \ 40 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ 41 } while (0) 42 43 #include <asm-generic/cacheflush.h> 44 45 #endif /* _ASM_C6X_CACHEFLUSH_H */ 46
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.