tlb-ucv2.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * linux/arch/unicore32/mm/tlb-ucv2.S
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/linkage.h>
  14. #include <asm/assembler.h>
  15. #include <asm/page.h>
  16. #include <asm/tlbflush.h>
  17. #include "proc-macros.S"
  18. /*
  19. * __cpu_flush_user_tlb_range(start, end, vma)
  20. *
  21. * Invalidate a range of TLB entries in the specified address space.
  22. *
  23. * - start - start address (may not be aligned)
  24. * - end - end address (exclusive, may not be aligned)
  25. * - vma - vma_struct describing address range
  26. */
  27. ENTRY(__cpu_flush_user_tlb_range)
  28. #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
  29. mov r0, r0 >> #PAGE_SHIFT @ align address
  30. mov r0, r0 << #PAGE_SHIFT
  31. vma_vm_flags r2, r2 @ get vma->vm_flags
  32. 1:
  33. movc p0.c6, r0, #3
  34. nop8
  35. cand.a r2, #VM_EXEC @ Executable area ?
  36. beq 2f
  37. movc p0.c6, r0, #5
  38. nop8
  39. 2:
  40. add r0, r0, #PAGE_SZ
  41. csub.a r0, r1
  42. beb 1b
  43. #else
  44. movc p0.c6, r0, #2
  45. nop8
  46. cand.a r2, #VM_EXEC @ Executable area ?
  47. beq 2f
  48. movc p0.c6, r0, #4
  49. nop8
  50. 2:
  51. #endif
  52. mov pc, lr
  53. /*
  54. * __cpu_flush_kern_tlb_range(start,end)
  55. *
  56. * Invalidate a range of kernel TLB entries
  57. *
  58. * - start - start address (may not be aligned)
  59. * - end - end address (exclusive, may not be aligned)
  60. */
  61. ENTRY(__cpu_flush_kern_tlb_range)
  62. #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
  63. mov r0, r0 >> #PAGE_SHIFT @ align address
  64. mov r0, r0 << #PAGE_SHIFT
  65. 1:
  66. movc p0.c6, r0, #3
  67. nop8
  68. movc p0.c6, r0, #5
  69. nop8
  70. add r0, r0, #PAGE_SZ
  71. csub.a r0, r1
  72. beb 1b
  73. #else
  74. movc p0.c6, r0, #2
  75. nop8
  76. movc p0.c6, r0, #4
  77. nop8
  78. #endif
  79. mov pc, lr