tlbflush.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _CRIS_TLBFLUSH_H
  2. #define _CRIS_TLBFLUSH_H
  3. #include <linux/config.h>
  4. #include <linux/mm.h>
  5. #include <asm/processor.h>
  6. #include <asm/pgtable.h>
  7. #include <asm/pgalloc.h>
  8. /*
  9. * TLB flushing (implemented in arch/cris/mm/tlb.c):
  10. *
  11. * - flush_tlb() flushes the current mm struct TLBs
  12. * - flush_tlb_all() flushes all processes TLBs
  13. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  14. * - flush_tlb_page(vma, vmaddr) flushes one page
  15. * - flush_tlb_range(mm, start, end) flushes a range of pages
  16. *
  17. */
  18. extern void __flush_tlb_all(void);
  19. extern void __flush_tlb_mm(struct mm_struct *mm);
  20. extern void __flush_tlb_page(struct vm_area_struct *vma,
  21. unsigned long addr);
  22. #ifdef CONFIG_SMP
  23. extern void flush_tlb_all(void);
  24. extern void flush_tlb_mm(struct mm_struct *mm);
  25. extern void flush_tlb_page(struct vm_area_struct *vma,
  26. unsigned long addr);
  27. #else
  28. #define flush_tlb_all __flush_tlb_all
  29. #define flush_tlb_mm __flush_tlb_mm
  30. #define flush_tlb_page __flush_tlb_page
  31. #endif
  32. static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
  33. {
  34. flush_tlb_mm(vma->vm_mm);
  35. }
  36. static inline void flush_tlb_pgtables(struct mm_struct *mm,
  37. unsigned long start, unsigned long end)
  38. {
  39. /* CRIS does not keep any page table caches in TLB */
  40. }
  41. static inline void flush_tlb(void)
  42. {
  43. flush_tlb_mm(current->mm);
  44. }
  45. #define flush_tlb_kernel_range(start, end) flush_tlb_all()
  46. #endif /* _CRIS_TLBFLUSH_H */