tlbflush_64.h 1.7 KB

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