tlbflush.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* tlbflush.h: TLB flushing functions
  2. *
  3. * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_TLBFLUSH_H
  12. #define _ASM_TLBFLUSH_H
  13. #include <linux/mm.h>
  14. #include <asm/processor.h>
  15. #ifdef CONFIG_MMU
  16. #ifndef __ASSEMBLY__
  17. extern void asmlinkage __flush_tlb_all(void);
  18. extern void asmlinkage __flush_tlb_mm(unsigned long contextid);
  19. extern void asmlinkage __flush_tlb_page(unsigned long contextid, unsigned long start);
  20. extern void asmlinkage __flush_tlb_range(unsigned long contextid,
  21. unsigned long start, unsigned long end);
  22. #endif /* !__ASSEMBLY__ */
  23. #define flush_tlb_all() \
  24. do { \
  25. preempt_disable(); \
  26. __flush_tlb_all(); \
  27. preempt_enable(); \
  28. } while(0)
  29. #define flush_tlb_mm(mm) \
  30. do { \
  31. preempt_disable(); \
  32. __flush_tlb_mm((mm)->context.id); \
  33. preempt_enable(); \
  34. } while(0)
  35. #define flush_tlb_range(vma,start,end) \
  36. do { \
  37. preempt_disable(); \
  38. __flush_tlb_range((vma)->vm_mm->context.id, start, end); \
  39. preempt_enable(); \
  40. } while(0)
  41. #define flush_tlb_page(vma,addr) \
  42. do { \
  43. preempt_disable(); \
  44. __flush_tlb_page((vma)->vm_mm->context.id, addr); \
  45. preempt_enable(); \
  46. } while(0)
  47. #define __flush_tlb_global() flush_tlb_all()
  48. #define flush_tlb() flush_tlb_all()
  49. #define flush_tlb_kernel_range(start, end) flush_tlb_all()
  50. #else
  51. #define flush_tlb() BUG()
  52. #define flush_tlb_all() BUG()
  53. #define flush_tlb_mm(mm) BUG()
  54. #define flush_tlb_page(vma,addr) BUG()
  55. #define flush_tlb_range(mm,start,end) BUG()
  56. #define flush_tlb_kernel_range(start, end) BUG()
  57. #endif
  58. #endif /* _ASM_TLBFLUSH_H */