copypage-v4wt.S 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * linux/arch/arm/lib/copypage-v4.S
  3. *
  4. * Copyright (C) 1995-1999 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * ASM optimised string functions
  11. *
  12. * This is for CPUs with a writethrough cache and 'flush ID cache' is
  13. * the only supported cache operation.
  14. */
  15. #include <linux/linkage.h>
  16. #include <linux/init.h>
  17. #include <asm/asm-offsets.h>
  18. .text
  19. .align 5
  20. /*
  21. * ARMv4 optimised copy_user_page
  22. *
  23. * Since we have writethrough caches, we don't have to worry about
  24. * dirty data in the cache. However, we do have to ensure that
  25. * subsequent reads are up to date.
  26. */
  27. ENTRY(v4wt_copy_user_page)
  28. stmfd sp!, {r4, lr} @ 2
  29. mov r2, #PAGE_SZ/64 @ 1
  30. ldmia r1!, {r3, r4, ip, lr} @ 4
  31. 1: stmia r0!, {r3, r4, ip, lr} @ 4
  32. ldmia r1!, {r3, r4, ip, lr} @ 4+1
  33. stmia r0!, {r3, r4, ip, lr} @ 4
  34. ldmia r1!, {r3, r4, ip, lr} @ 4
  35. stmia r0!, {r3, r4, ip, lr} @ 4
  36. ldmia r1!, {r3, r4, ip, lr} @ 4
  37. subs r2, r2, #1 @ 1
  38. stmia r0!, {r3, r4, ip, lr} @ 4
  39. ldmneia r1!, {r3, r4, ip, lr} @ 4
  40. bne 1b @ 1
  41. mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
  42. ldmfd sp!, {r4, pc} @ 3
  43. .align 5
  44. /*
  45. * ARMv4 optimised clear_user_page
  46. *
  47. * Same story as above.
  48. */
  49. ENTRY(v4wt_clear_user_page)
  50. str lr, [sp, #-4]!
  51. mov r1, #PAGE_SZ/64 @ 1
  52. mov r2, #0 @ 1
  53. mov r3, #0 @ 1
  54. mov ip, #0 @ 1
  55. mov lr, #0 @ 1
  56. 1: stmia r0!, {r2, r3, ip, lr} @ 4
  57. stmia r0!, {r2, r3, ip, lr} @ 4
  58. stmia r0!, {r2, r3, ip, lr} @ 4
  59. stmia r0!, {r2, r3, ip, lr} @ 4
  60. subs r1, r1, #1 @ 1
  61. bne 1b @ 1
  62. mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
  63. ldr pc, [sp], #4
  64. __INITDATA
  65. .type v4wt_user_fns, #object
  66. ENTRY(v4wt_user_fns)
  67. .long v4wt_clear_user_page
  68. .long v4wt_copy_user_page
  69. .size v4wt_user_fns, . - v4wt_user_fns