cache.c 1022 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2001-2003 Silicon Graphics, Inc. All rights reserved.
  7. *
  8. */
  9. #include <linux/module.h>
  10. #include <asm/pgalloc.h>
  11. /**
  12. * sn_flush_all_caches - flush a range of address from all caches (incl. L4)
  13. * @flush_addr: identity mapped region 7 address to start flushing
  14. * @bytes: number of bytes to flush
  15. *
  16. * Flush a range of addresses from all caches including L4.
  17. * All addresses fully or partially contained within
  18. * @flush_addr to @flush_addr + @bytes are flushed
  19. * from the all caches.
  20. */
  21. void
  22. sn_flush_all_caches(long flush_addr, long bytes)
  23. {
  24. flush_icache_range(flush_addr, flush_addr+bytes);
  25. /*
  26. * The last call may have returned before the caches
  27. * were actually flushed, so we call it again to make
  28. * sure.
  29. */
  30. flush_icache_range(flush_addr, flush_addr+bytes);
  31. mb();
  32. }
  33. EXPORT_SYMBOL(sn_flush_all_caches);