/* Flush a range of addresses from all caches including L4. All addresses fully or partially contained within @flush_addr to @flush_addr + @bytes are flushed from all caches.  */
void sn_flush_all_caches(long flush_addr, long bytes)
/* Flush a range of addresses from all caches including L4. All addresses fully or partially contained within @flush_addr to @flush_addr + @bytes are flushed from all caches.  */
void sn_flush_all_caches(long flush_addr, long bytes)
{
	unsigned long addr = flush_addr;
	if (is_shub1() && (addr & RGN_BITS) == RGN_BASE(RGN_UNCACHED))
		addr = (addr - RGN_BASE(RGN_UNCACHED)) + RGN_BASE(RGN_KERNEL);
	flush_icache_range(addr, addr + bytes);
	flush_icache_range(addr, addr + bytes);
	mb();
}