cache.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * include/asm-parisc/cache.h
  4. */
  5. #ifndef __ARCH_PARISC_CACHE_H
  6. #define __ARCH_PARISC_CACHE_H
  7. /*
  8. * PA 2.0 processors have 64 and 128-byte L2 cachelines; PA 1.1 processors
  9. * have 32-byte cachelines. The L1 length appears to be 16 bytes but this
  10. * is not clearly documented.
  11. */
  12. #define L1_CACHE_BYTES 16
  13. #define L1_CACHE_SHIFT 4
  14. #ifndef __ASSEMBLY__
  15. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  16. #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
  17. #define __read_mostly __attribute__((__section__(".data..read_mostly")))
  18. /* Read-only memory is marked before mark_rodata_ro() is called. */
  19. #define __ro_after_init __read_mostly
  20. void parisc_cache_init(void); /* initializes cache-flushing */
  21. void disable_sr_hashing_asm(int); /* low level support for above */
  22. void disable_sr_hashing(void); /* turns off space register hashing */
  23. void free_sid(unsigned long);
  24. unsigned long alloc_sid(void);
  25. struct seq_file;
  26. extern void show_cache_info(struct seq_file *m);
  27. extern int split_tlb;
  28. extern int dcache_stride;
  29. extern int icache_stride;
  30. extern struct pdc_cache_info cache_info;
  31. void parisc_setup_cache_timing(void);
  32. #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
  33. #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
  34. #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
  35. #endif /* ! __ASSEMBLY__ */
  36. /* Classes of processor wrt: disabling space register hashing */
  37. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  38. #define SRHASH_PCXL 1 /* pcxl */
  39. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  40. #endif