cache.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 L1_CACHE_SHIFT 5
  13. #define MAX_COPY_PREFETCH 4
  14. #else /* CONFIG_PPC64 */
  15. #define L1_CACHE_SHIFT 7
  16. #endif
  17. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  18. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  19. #if defined(__powerpc64__) && !defined(__ASSEMBLY__)
  20. struct ppc64_caches {
  21. u32 dsize; /* L1 d-cache size */
  22. u32 dline_size; /* L1 d-cache line size */
  23. u32 log_dline_size;
  24. u32 dlines_per_page;
  25. u32 isize; /* L1 i-cache size */
  26. u32 iline_size; /* L1 i-cache line size */
  27. u32 log_iline_size;
  28. u32 ilines_per_page;
  29. };
  30. extern struct ppc64_caches ppc64_caches;
  31. #endif /* __powerpc64__ && ! __ASSEMBLY__ */
  32. #if !defined(__ASSEMBLY__)
  33. #define __read_mostly __attribute__((__section__(".data.read_mostly")))
  34. #endif
  35. #endif /* __KERNEL__ */
  36. #endif /* _ASM_POWERPC_CACHE_H */