tlb.h 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __ASM_TLB_H
  2. #define __ASM_TLB_H
  3. #include <asm/cpu-features.h>
  4. #include <asm/mipsregs.h>
  5. /*
  6. * MIPS doesn't need any special per-pte or per-vma handling, except
  7. * we need to flush cache for area to be unmapped.
  8. */
  9. #define tlb_start_vma(tlb, vma) \
  10. do { \
  11. if (!tlb->fullmm) \
  12. flush_cache_range(vma, vma->vm_start, vma->vm_end); \
  13. } while (0)
  14. #define tlb_end_vma(tlb, vma) do { } while (0)
  15. #define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
  16. /*
  17. * .. because we flush the whole mm when it fills up.
  18. */
  19. #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
  20. #define UNIQUE_ENTRYHI(idx) \
  21. ((CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) | \
  22. (cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))
  23. static inline unsigned int num_wired_entries(void)
  24. {
  25. unsigned int wired = read_c0_wired();
  26. if (cpu_has_mips_r6)
  27. wired &= MIPSR6_WIRED_WIRED;
  28. return wired;
  29. }
  30. #include <asm-generic/tlb.h>
  31. #endif /* __ASM_TLB_H */