cache.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * include/asm-parisc/cache.h
  3. */
  4. #ifndef __ARCH_PARISC_CACHE_H
  5. #define __ARCH_PARISC_CACHE_H
  6. #include <linux/config.h>
  7. /*
  8. * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
  9. * 32-byte cachelines. The default configuration is not for SMP anyway,
  10. * so if you're building for SMP, you should select the appropriate
  11. * processor type. There is a potential livelock danger when running
  12. * a machine with this value set too small, but it's more probable you'll
  13. * just ruin performance.
  14. */
  15. #ifdef CONFIG_PA20
  16. #define L1_CACHE_BYTES 64
  17. #define L1_CACHE_SHIFT 6
  18. #else
  19. #define L1_CACHE_BYTES 32
  20. #define L1_CACHE_SHIFT 5
  21. #endif
  22. #ifndef __ASSEMBLY__
  23. #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
  24. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  25. extern void flush_data_cache_local(void *); /* flushes local data-cache only */
  26. extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */
  27. #ifdef CONFIG_SMP
  28. extern void flush_data_cache(void); /* flushes data-cache only (all processors) */
  29. extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */
  30. #else
  31. #define flush_data_cache() flush_data_cache_local(NULL)
  32. #define flush_instruction_cache() flush_instruction_cache_local(NULL)
  33. #endif
  34. extern void parisc_cache_init(void); /* initializes cache-flushing */
  35. extern void flush_all_caches(void); /* flush everything (tlb & cache) */
  36. extern int get_cache_info(char *);
  37. extern void flush_user_icache_range_asm(unsigned long, unsigned long);
  38. extern void flush_kernel_icache_range_asm(unsigned long, unsigned long);
  39. extern void flush_user_dcache_range_asm(unsigned long, unsigned long);
  40. extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long);
  41. extern void flush_kernel_dcache_page(void *);
  42. extern void flush_kernel_icache_page(void *);
  43. extern void disable_sr_hashing(void); /* turns off space register hashing */
  44. extern void disable_sr_hashing_asm(int); /* low level support for above */
  45. extern void free_sid(unsigned long);
  46. unsigned long alloc_sid(void);
  47. extern void flush_user_dcache_page(unsigned long);
  48. extern void flush_user_icache_page(unsigned long);
  49. struct seq_file;
  50. extern void show_cache_info(struct seq_file *m);
  51. extern int split_tlb;
  52. extern int dcache_stride;
  53. extern int icache_stride;
  54. extern struct pdc_cache_info cache_info;
  55. #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
  56. #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
  57. #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
  58. #endif /* ! __ASSEMBLY__ */
  59. /* Classes of processor wrt: disabling space register hashing */
  60. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  61. #define SRHASH_PCXL 1 /* pcxl */
  62. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  63. #endif