cache.h 1021 B

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