tlbflush.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * OpenRISC Linux
  4. *
  5. * Linux architectural port borrowing liberally from similar works of
  6. * others. All original copyrights apply as per the original source
  7. * declaration.
  8. *
  9. * OpenRISC implementation:
  10. * Copyright (C) 2003 Matjaz Breskvar <[email protected]>
  11. * Copyright (C) 2010-2011 Jonas Bonn <[email protected]>
  12. * et al.
  13. */
  14. #ifndef __ASM_OPENRISC_TLBFLUSH_H
  15. #define __ASM_OPENRISC_TLBFLUSH_H
  16. #include <linux/mm.h>
  17. #include <asm/processor.h>
  18. #include <asm/current.h>
  19. #include <linux/sched.h>
  20. /*
  21. * - flush_tlb() flushes the current mm struct TLBs
  22. * - flush_tlb_all() flushes all processes TLBs
  23. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  24. * - flush_tlb_page(vma, vmaddr) flushes one page
  25. * - flush_tlb_range(vma, start, end) flushes a range of pages
  26. */
  27. extern void local_flush_tlb_all(void);
  28. extern void local_flush_tlb_mm(struct mm_struct *mm);
  29. extern void local_flush_tlb_page(struct vm_area_struct *vma,
  30. unsigned long addr);
  31. extern void local_flush_tlb_range(struct vm_area_struct *vma,
  32. unsigned long start,
  33. unsigned long end);
  34. #ifndef CONFIG_SMP
  35. #define flush_tlb_all local_flush_tlb_all
  36. #define flush_tlb_mm local_flush_tlb_mm
  37. #define flush_tlb_page local_flush_tlb_page
  38. #define flush_tlb_range local_flush_tlb_range
  39. #else
  40. extern void flush_tlb_all(void);
  41. extern void flush_tlb_mm(struct mm_struct *mm);
  42. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
  43. extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
  44. unsigned long end);
  45. #endif
  46. static inline void flush_tlb(void)
  47. {
  48. flush_tlb_mm(current->mm);
  49. }
  50. static inline void flush_tlb_kernel_range(unsigned long start,
  51. unsigned long end)
  52. {
  53. flush_tlb_range(NULL, start, end);
  54. }
  55. #endif /* __ASM_OPENRISC_TLBFLUSH_H */