tlbflush.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef _ASM_POWERPC_TLBFLUSH_H
  2. #define _ASM_POWERPC_TLBFLUSH_H
  3. /*
  4. * TLB flushing:
  5. *
  6. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  7. * - flush_tlb_page(vma, vmaddr) flushes one page
  8. * - local_flush_tlb_mm(mm, full) flushes the specified mm context on
  9. * the local processor
  10. * - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor
  11. * - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
  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. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * as published by the Free Software Foundation; either version
  18. * 2 of the License, or (at your option) any later version.
  19. */
  20. #ifdef __KERNEL__
  21. #ifdef CONFIG_PPC_MMU_NOHASH
  22. /*
  23. * TLB flushing for software loaded TLB chips
  24. *
  25. * TODO: (CONFIG_FSL_BOOKE) determine if flush_tlb_range &
  26. * flush_tlb_kernel_range are best implemented as tlbia vs
  27. * specific tlbie's
  28. */
  29. struct vm_area_struct;
  30. struct mm_struct;
  31. #define MMU_NO_CONTEXT ((unsigned int)-1)
  32. extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
  33. unsigned long end);
  34. extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
  35. extern void local_flush_tlb_mm(struct mm_struct *mm);
  36. extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
  37. extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
  38. int tsize, int ind);
  39. #ifdef CONFIG_SMP
  40. extern void flush_tlb_mm(struct mm_struct *mm);
  41. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
  42. extern void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
  43. int tsize, int ind);
  44. #else
  45. #define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
  46. #define flush_tlb_page(vma,addr) local_flush_tlb_page(vma,addr)
  47. #define __flush_tlb_page(mm,addr,p,i) __local_flush_tlb_page(mm,addr,p,i)
  48. #endif
  49. #elif defined(CONFIG_PPC_STD_MMU_32)
  50. #define MMU_NO_CONTEXT (0)
  51. /*
  52. * TLB flushing for "classic" hash-MMU 32-bit CPUs, 6xx, 7xx, 7xxx
  53. */
  54. extern void flush_tlb_mm(struct mm_struct *mm);
  55. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
  56. extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
  57. extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
  58. unsigned long end);
  59. extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
  60. static inline void local_flush_tlb_page(struct vm_area_struct *vma,
  61. unsigned long vmaddr)
  62. {
  63. flush_tlb_page(vma, vmaddr);
  64. }
  65. static inline void local_flush_tlb_mm(struct mm_struct *mm)
  66. {
  67. flush_tlb_mm(mm);
  68. }
  69. #elif defined(CONFIG_PPC_STD_MMU_64)
  70. #include <asm/book3s/64/tlbflush.h>
  71. #else
  72. #error Unsupported MMU type
  73. #endif
  74. #endif /*__KERNEL__ */
  75. #endif /* _ASM_POWERPC_TLBFLUSH_H */