tlbflush.h 2.5 KB

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