tlbflush.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * OpenRISC Linux
  3. *
  4. * Linux architectural port borrowing liberally from similar works of
  5. * others. All original copyrights apply as per the original source
  6. * declaration.
  7. *
  8. * OpenRISC implementation:
  9. * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
  10. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  11. * et al.
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. */
  18. #ifndef __ASM_OPENRISC_TLBFLUSH_H
  19. #define __ASM_OPENRISC_TLBFLUSH_H
  20. #include <linux/mm.h>
  21. #include <asm/processor.h>
  22. #include <asm/pgtable.h>
  23. #include <asm/pgalloc.h>
  24. #include <asm/current.h>
  25. #include <linux/sched.h>
  26. /*
  27. * - flush_tlb() flushes the current mm struct TLBs
  28. * - flush_tlb_all() flushes all processes TLBs
  29. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  30. * - flush_tlb_page(vma, vmaddr) flushes one page
  31. * - flush_tlb_range(mm, start, end) flushes a range of pages
  32. */
  33. extern void local_flush_tlb_all(void);
  34. extern void local_flush_tlb_mm(struct mm_struct *mm);
  35. extern void local_flush_tlb_page(struct vm_area_struct *vma,
  36. unsigned long addr);
  37. extern void local_flush_tlb_range(struct vm_area_struct *vma,
  38. unsigned long start,
  39. unsigned long end);
  40. #ifndef CONFIG_SMP
  41. #define flush_tlb_all local_flush_tlb_all
  42. #define flush_tlb_mm local_flush_tlb_mm
  43. #define flush_tlb_page local_flush_tlb_page
  44. #define flush_tlb_range local_flush_tlb_range
  45. #else
  46. extern void flush_tlb_all(void);
  47. extern void flush_tlb_mm(struct mm_struct *mm);
  48. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
  49. extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
  50. unsigned long end);
  51. #endif
  52. static inline void flush_tlb(void)
  53. {
  54. flush_tlb_mm(current->mm);
  55. }
  56. static inline void flush_tlb_kernel_range(unsigned long start,
  57. unsigned long end)
  58. {
  59. flush_tlb_range(NULL, start, end);
  60. }
  61. #endif /* __ASM_OPENRISC_TLBFLUSH_H */