xref: /openbmc/linux/arch/ia64/include/asm/cacheflush.h (revision 0c6dfa75)
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 static inline void flush_dcache_folio(struct folio *folio)
17 {
18 	clear_bit(PG_arch_1, &folio->flags);
19 }
20 #define flush_dcache_folio flush_dcache_folio
21 
22 static inline void flush_dcache_page(struct page *page)
23 {
24 	flush_dcache_folio(page_folio(page));
25 }
26 
27 extern void flush_icache_range(unsigned long start, unsigned long end);
28 #define flush_icache_range flush_icache_range
29 extern void clflush_cache_range(void *addr, int size);
30 
31 #define flush_icache_user_page(vma, page, user_addr, len)					\
32 do {												\
33 	unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK);	\
34 	flush_icache_range(_addr, _addr + (len));						\
35 } while (0)
36 
37 #include <asm-generic/cacheflush.h>
38 
39 #endif /* _ASM_IA64_CACHEFLUSH_H */
40