tlbflush_64.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _SPARC64_TLBFLUSH_H
  2. #define _SPARC64_TLBFLUSH_H
  3. #include <asm/mmu_context.h>
  4. /* TSB flush operations. */
  5. #define TLB_BATCH_NR 192
  6. struct tlb_batch {
  7. bool huge;
  8. struct mm_struct *mm;
  9. unsigned long tlb_nr;
  10. unsigned long active;
  11. unsigned long vaddrs[TLB_BATCH_NR];
  12. };
  13. void flush_tsb_kernel_range(unsigned long start, unsigned long end);
  14. void flush_tsb_user(struct tlb_batch *tb);
  15. void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr, bool huge);
  16. /* TLB flush operations. */
  17. static inline void flush_tlb_mm(struct mm_struct *mm)
  18. {
  19. }
  20. static inline void flush_tlb_page(struct vm_area_struct *vma,
  21. unsigned long vmaddr)
  22. {
  23. }
  24. static inline void flush_tlb_range(struct vm_area_struct *vma,
  25. unsigned long start, unsigned long end)
  26. {
  27. }
  28. void flush_tlb_kernel_range(unsigned long start, unsigned long end);
  29. #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
  30. void flush_tlb_pending(void);
  31. void arch_enter_lazy_mmu_mode(void);
  32. void arch_leave_lazy_mmu_mode(void);
  33. #define arch_flush_lazy_mmu_mode() do {} while (0)
  34. /* Local cpu only. */
  35. void __flush_tlb_all(void);
  36. void __flush_tlb_page(unsigned long context, unsigned long vaddr);
  37. void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
  38. #ifndef CONFIG_SMP
  39. static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
  40. {
  41. __flush_tlb_page(CTX_HWBITS(mm->context), vaddr);
  42. }
  43. #else /* CONFIG_SMP */
  44. void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
  45. void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
  46. #define global_flush_tlb_page(mm, vaddr) \
  47. smp_flush_tlb_page(mm, vaddr)
  48. #endif /* ! CONFIG_SMP */
  49. #endif /* _SPARC64_TLBFLUSH_H */