tlbflush.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _SPARC_TLBFLUSH_H
  2. #define _SPARC_TLBFLUSH_H
  3. #include <linux/mm.h>
  4. // #include <asm/processor.h>
  5. /*
  6. * TLB flushing:
  7. *
  8. * - flush_tlb() flushes the current mm struct TLBs XXX Exists?
  9. * - flush_tlb_all() flushes all processes TLBs
  10. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  11. * - flush_tlb_page(vma, vmaddr) flushes one page
  12. * - flush_tlb_range(vma, start, end) flushes a range of pages
  13. * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
  14. * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
  15. */
  16. #ifdef CONFIG_SMP
  17. BTFIXUPDEF_CALL(void, local_flush_tlb_all, void)
  18. BTFIXUPDEF_CALL(void, local_flush_tlb_mm, struct mm_struct *)
  19. BTFIXUPDEF_CALL(void, local_flush_tlb_range, struct vm_area_struct *, unsigned long, unsigned long)
  20. BTFIXUPDEF_CALL(void, local_flush_tlb_page, struct vm_area_struct *, unsigned long)
  21. #define local_flush_tlb_all() BTFIXUP_CALL(local_flush_tlb_all)()
  22. #define local_flush_tlb_mm(mm) BTFIXUP_CALL(local_flush_tlb_mm)(mm)
  23. #define local_flush_tlb_range(vma,start,end) BTFIXUP_CALL(local_flush_tlb_range)(vma,start,end)
  24. #define local_flush_tlb_page(vma,addr) BTFIXUP_CALL(local_flush_tlb_page)(vma,addr)
  25. extern void smp_flush_tlb_all(void);
  26. extern void smp_flush_tlb_mm(struct mm_struct *mm);
  27. extern void smp_flush_tlb_range(struct vm_area_struct *vma,
  28. unsigned long start,
  29. unsigned long end);
  30. extern void smp_flush_tlb_page(struct vm_area_struct *mm, unsigned long page);
  31. #endif /* CONFIG_SMP */
  32. BTFIXUPDEF_CALL(void, flush_tlb_all, void)
  33. BTFIXUPDEF_CALL(void, flush_tlb_mm, struct mm_struct *)
  34. BTFIXUPDEF_CALL(void, flush_tlb_range, struct vm_area_struct *, unsigned long, unsigned long)
  35. BTFIXUPDEF_CALL(void, flush_tlb_page, struct vm_area_struct *, unsigned long)
  36. // Thanks to Anton Blanchard, our pagetables became uncached in 2.4. Wee!
  37. // extern void flush_tlb_pgtables(struct mm_struct *mm,
  38. // unsigned long start, unsigned long end);
  39. #define flush_tlb_pgtables(mm, start, end) do{ }while(0)
  40. #define flush_tlb_all() BTFIXUP_CALL(flush_tlb_all)()
  41. #define flush_tlb_mm(mm) BTFIXUP_CALL(flush_tlb_mm)(mm)
  42. #define flush_tlb_range(vma,start,end) BTFIXUP_CALL(flush_tlb_range)(vma,start,end)
  43. #define flush_tlb_page(vma,addr) BTFIXUP_CALL(flush_tlb_page)(vma,addr)
  44. // #define flush_tlb() flush_tlb_mm(current->active_mm) /* XXX Sure? */
  45. /*
  46. * This is a kludge, until I know better. --zaitcev XXX
  47. */
  48. static inline void flush_tlb_kernel_range(unsigned long start,
  49. unsigned long end)
  50. {
  51. flush_tlb_all();
  52. }
  53. #endif /* _SPARC_TLBFLUSH_H */