cache.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* $Id: cache.h,v 1.6 2004/03/11 18:08:05 lethal Exp $
  2. *
  3. * include/asm-sh/cache.h
  4. *
  5. * Copyright 1999 (C) Niibe Yutaka
  6. * Copyright 2002, 2003 (C) Paul Mundt
  7. */
  8. #ifndef __ASM_SH_CACHE_H
  9. #define __ASM_SH_CACHE_H
  10. #ifdef __KERNEL__
  11. #include <asm/cpu/cache.h>
  12. #include <asm/cpu/cacheflush.h>
  13. #define SH_CACHE_VALID 1
  14. #define SH_CACHE_UPDATED 2
  15. #define SH_CACHE_COMBINED 4
  16. #define SH_CACHE_ASSOC 8
  17. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  18. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  19. #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
  20. struct cache_info {
  21. unsigned int ways;
  22. unsigned int sets;
  23. unsigned int linesz;
  24. unsigned int way_incr;
  25. unsigned int entry_shift;
  26. unsigned int entry_mask;
  27. unsigned long flags;
  28. };
  29. /* Flush (write-back only) a region (smaller than a page) */
  30. extern void __flush_wback_region(void *start, int size);
  31. /* Flush (write-back & invalidate) a region (smaller than a page) */
  32. extern void __flush_purge_region(void *start, int size);
  33. /* Flush (invalidate only) a region (smaller than a page) */
  34. extern void __flush_invalidate_region(void *start, int size);
  35. #endif /* __KERNEL__ */
  36. #endif /* __ASM_SH_CACHE_H */