cache.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * include/asm-parisc/cache.h
  3. */
  4. #ifndef __ARCH_PARISC_CACHE_H
  5. #define __ARCH_PARISC_CACHE_H
  6. /*
  7. * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
  8. * 32-byte cachelines. The default configuration is not for SMP anyway,
  9. * so if you're building for SMP, you should select the appropriate
  10. * processor type. There is a potential livelock danger when running
  11. * a machine with this value set too small, but it's more probable you'll
  12. * just ruin performance.
  13. */
  14. #ifdef CONFIG_PA20
  15. #define L1_CACHE_BYTES 64
  16. #define L1_CACHE_SHIFT 6
  17. #else
  18. #define L1_CACHE_BYTES 32
  19. #define L1_CACHE_SHIFT 5
  20. #endif
  21. #ifndef __ASSEMBLY__
  22. #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
  23. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  24. #define __read_mostly __attribute__((__section__(".data.read_mostly")))
  25. void parisc_cache_init(void); /* initializes cache-flushing */
  26. void disable_sr_hashing_asm(int); /* low level support for above */
  27. void disable_sr_hashing(void); /* turns off space register hashing */
  28. void free_sid(unsigned long);
  29. unsigned long alloc_sid(void);
  30. struct seq_file;
  31. extern void show_cache_info(struct seq_file *m);
  32. extern int split_tlb;
  33. extern int dcache_stride;
  34. extern int icache_stride;
  35. extern struct pdc_cache_info cache_info;
  36. void parisc_setup_cache_timing(void);
  37. #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
  38. #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
  39. #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
  40. #endif /* ! __ASSEMBLY__ */
  41. /* Classes of processor wrt: disabling space register hashing */
  42. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  43. #define SRHASH_PCXL 1 /* pcxl */
  44. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  45. #endif