162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _ASM_IA64_CACHEFLUSH_H
362306a36Sopenharmony_ci#define _ASM_IA64_CACHEFLUSH_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * Copyright (C) 2002 Hewlett-Packard Co
762306a36Sopenharmony_ci *	David Mosberger-Tang <davidm@hpl.hp.com>
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/page-flags.h>
1162306a36Sopenharmony_ci#include <linux/bitops.h>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <asm/page.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
1662306a36Sopenharmony_cistatic inline void flush_dcache_folio(struct folio *folio)
1762306a36Sopenharmony_ci{
1862306a36Sopenharmony_ci	clear_bit(PG_arch_1, &folio->flags);
1962306a36Sopenharmony_ci}
2062306a36Sopenharmony_ci#define flush_dcache_folio flush_dcache_folio
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cistatic inline void flush_dcache_page(struct page *page)
2362306a36Sopenharmony_ci{
2462306a36Sopenharmony_ci	flush_dcache_folio(page_folio(page));
2562306a36Sopenharmony_ci}
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciextern void flush_icache_range(unsigned long start, unsigned long end);
2862306a36Sopenharmony_ci#define flush_icache_range flush_icache_range
2962306a36Sopenharmony_ciextern void clflush_cache_range(void *addr, int size);
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define flush_icache_user_page(vma, page, user_addr, len)					\
3262306a36Sopenharmony_cido {												\
3362306a36Sopenharmony_ci	unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK);	\
3462306a36Sopenharmony_ci	flush_icache_range(_addr, _addr + (len));						\
3562306a36Sopenharmony_ci} while (0)
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#include <asm-generic/cacheflush.h>
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#endif /* _ASM_IA64_CACHEFLUSH_H */
40