xref: /openbmc/linux/arch/ia64/include/asm/cacheflush.h (revision 4e174665)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_IA64_CACHEFLUSH_H
3 #define _ASM_IA64_CACHEFLUSH_H
4 
5 /*
6  * Copyright (C) 2002 Hewlett-Packard Co
7  *	David Mosberger-Tang <davidm@hpl.hp.com>
8  */
9 
10 #include <linux/page-flags.h>
11 #include <linux/bitops.h>
12 
13 #include <asm/page.h>
14 
15 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
16 #define flush_dcache_page(page)			\
17 do {						\
18 	clear_bit(PG_arch_1, &(page)->flags);	\
19 } while (0)
20 
21 extern void flush_icache_range(unsigned long start, unsigned long end);
22 #define flush_icache_range flush_icache_range
23 extern void clflush_cache_range(void *addr, int size);
24 
25 #define flush_icache_user_page(vma, page, user_addr, len)					\
26 do {												\
27 	unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK);	\
28 	flush_icache_range(_addr, _addr + (len));						\
29 } while (0)
30 
31 #include <asm-generic/cacheflush.h>
32 
33 #endif /* _ASM_IA64_CACHEFLUSH_H */
34