cache.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 ARCH_DMA_MINALIGN L1_CACHE_BYTES
  25. #define __read_mostly __attribute__((__section__(".data..read_mostly")))
  26. void parisc_cache_init(void); /* initializes cache-flushing */
  27. void disable_sr_hashing_asm(int); /* low level support for above */
  28. void disable_sr_hashing(void); /* turns off space register hashing */
  29. void free_sid(unsigned long);
  30. unsigned long alloc_sid(void);
  31. struct seq_file;
  32. extern void show_cache_info(struct seq_file *m);
  33. extern int split_tlb;
  34. extern int dcache_stride;
  35. extern int icache_stride;
  36. extern struct pdc_cache_info cache_info;
  37. void parisc_setup_cache_timing(void);
  38. #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
  39. #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
  40. #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
  41. #endif /* ! __ASSEMBLY__ */
  42. /* Classes of processor wrt: disabling space register hashing */
  43. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  44. #define SRHASH_PCXL 1 /* pcxl */
  45. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  46. #endif