cache.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _ASM_POWERPC_CACHE_H
  2. #define _ASM_POWERPC_CACHE_H
  3. #ifdef __KERNEL__
  4. /* bytes per L1 cache line */
  5. #if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
  6. #define L1_CACHE_SHIFT 4
  7. #define MAX_COPY_PREFETCH 1
  8. #elif defined(CONFIG_PPC_E500MC)
  9. #define L1_CACHE_SHIFT 6
  10. #define MAX_COPY_PREFETCH 4
  11. #elif defined(CONFIG_PPC32)
  12. #define MAX_COPY_PREFETCH 4
  13. #if defined(CONFIG_PPC_47x)
  14. #define L1_CACHE_SHIFT 7
  15. #else
  16. #define L1_CACHE_SHIFT 5
  17. #endif
  18. #else /* CONFIG_PPC64 */
  19. #define L1_CACHE_SHIFT 7
  20. #endif
  21. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  22. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  23. #if defined(__powerpc64__) && !defined(__ASSEMBLY__)
  24. struct ppc64_caches {
  25. u32 dsize; /* L1 d-cache size */
  26. u32 dline_size; /* L1 d-cache line size */
  27. u32 log_dline_size;
  28. u32 dlines_per_page;
  29. u32 isize; /* L1 i-cache size */
  30. u32 iline_size; /* L1 i-cache line size */
  31. u32 log_iline_size;
  32. u32 ilines_per_page;
  33. };
  34. extern struct ppc64_caches ppc64_caches;
  35. #endif /* __powerpc64__ && ! __ASSEMBLY__ */
  36. #if !defined(__ASSEMBLY__)
  37. #define __read_mostly __attribute__((__section__(".data..read_mostly")))
  38. #endif
  39. #endif /* __KERNEL__ */
  40. #endif /* _ASM_POWERPC_CACHE_H */