tlbflush.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // SPDX-License-Identifier: GPL-2.0
  2. // Copyright (C) 2005-2017 Andes Technology Corporation
  3. #ifndef _ASMNDS32_TLBFLUSH_H
  4. #define _ASMNDS32_TLBFLUSH_H
  5. #include <linux/spinlock.h>
  6. #include <linux/mm.h>
  7. #include <nds32_intrinsic.h>
  8. static inline void local_flush_tlb_all(void)
  9. {
  10. __nds32__tlbop_flua();
  11. __nds32__isb();
  12. }
  13. static inline void local_flush_tlb_mm(struct mm_struct *mm)
  14. {
  15. __nds32__tlbop_flua();
  16. __nds32__isb();
  17. }
  18. static inline void local_flush_tlb_kernel_range(unsigned long start,
  19. unsigned long end)
  20. {
  21. while (start < end) {
  22. __nds32__tlbop_inv(start);
  23. __nds32__isb();
  24. start += PAGE_SIZE;
  25. }
  26. }
  27. void local_flush_tlb_range(struct vm_area_struct *vma,
  28. unsigned long start, unsigned long end);
  29. void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
  30. #define flush_tlb_all local_flush_tlb_all
  31. #define flush_tlb_mm local_flush_tlb_mm
  32. #define flush_tlb_range local_flush_tlb_range
  33. #define flush_tlb_page local_flush_tlb_page
  34. #define flush_tlb_kernel_range local_flush_tlb_kernel_range
  35. void update_mmu_cache(struct vm_area_struct *vma,
  36. unsigned long address, pte_t * pte);
  37. void tlb_migrate_finish(struct mm_struct *mm);
  38. #endif