/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 2001-2003, 2006 Silicon Graphics, Inc. All rights reserved.6*7*/8#include <linux/module.h>9#include <asm/pgalloc.h>10#include <asm/sn/arch.h>1112/**13* sn_flush_all_caches - flush a range of address from all caches (incl. L4)14* @flush_addr: identity mapped region 7 address to start flushing15* @bytes: number of bytes to flush16*17* Flush a range of addresses from all caches including L4.18* All addresses fully or partially contained within19* @flush_addr to @flush_addr + @bytes are flushed20* from all caches.21*/22void23sn_flush_all_caches(long flush_addr, long bytes)24{25unsigned long addr = flush_addr;2627/* SHub1 requires a cached address */28if (is_shub1() && (addr & RGN_BITS) == RGN_BASE(RGN_UNCACHED))29addr = (addr - RGN_BASE(RGN_UNCACHED)) + RGN_BASE(RGN_KERNEL);3031flush_icache_range(addr, addr + bytes);32/*33* The last call may have returned before the caches34* were actually flushed, so we call it again to make35* sure.36*/37flush_icache_range(addr, addr + bytes);38mb();39}40EXPORT_SYMBOL(sn_flush_all_caches);414243