tlbflush.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* MN10300 TLB flushing functions
  2. *
  3. * Copyright (C) 2007 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 Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_TLBFLUSH_H
  12. #define _ASM_TLBFLUSH_H
  13. #include <asm/processor.h>
  14. #define __flush_tlb() \
  15. do { \
  16. int w; \
  17. __asm__ __volatile__ \
  18. (" mov %1,%0 \n" \
  19. " or %2,%0 \n" \
  20. " mov %0,%1 \n" \
  21. : "=d"(w) \
  22. : "m"(MMUCTR), "i"(MMUCTR_IIV|MMUCTR_DIV) \
  23. : "memory" \
  24. ); \
  25. } while (0)
  26. #define __flush_tlb_all() __flush_tlb()
  27. #define __flush_tlb_one(addr) __flush_tlb()
  28. /*
  29. * TLB flushing:
  30. *
  31. * - flush_tlb() flushes the current mm struct TLBs
  32. * - flush_tlb_all() flushes all processes TLBs
  33. * - flush_tlb_mm(mm) flushes the specified mm context TLB's
  34. * - flush_tlb_page(vma, vmaddr) flushes one page
  35. * - flush_tlb_range(mm, start, end) flushes a range of pages
  36. * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
  37. */
  38. #define flush_tlb_all() \
  39. do { \
  40. preempt_disable(); \
  41. __flush_tlb_all(); \
  42. preempt_enable(); \
  43. } while (0)
  44. #define flush_tlb_mm(mm) \
  45. do { \
  46. preempt_disable(); \
  47. __flush_tlb_all(); \
  48. preempt_enable(); \
  49. } while (0)
  50. #define flush_tlb_range(vma, start, end) \
  51. do { \
  52. unsigned long __s __attribute__((unused)) = (start); \
  53. unsigned long __e __attribute__((unused)) = (end); \
  54. preempt_disable(); \
  55. __flush_tlb_all(); \
  56. preempt_enable(); \
  57. } while (0)
  58. #define __flush_tlb_global() flush_tlb_all()
  59. #define flush_tlb() flush_tlb_all()
  60. #define flush_tlb_kernel_range(start, end) \
  61. do { \
  62. unsigned long __s __attribute__((unused)) = (start); \
  63. unsigned long __e __attribute__((unused)) = (end); \
  64. flush_tlb_all(); \
  65. } while (0)
  66. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr);
  67. #define flush_tlb_pgtables(mm, start, end) do {} while (0)
  68. #endif /* _ASM_TLBFLUSH_H */