io-writesl.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * linux/arch/arm/lib/io-writesl.S
  3. *
  4. * Copyright (C) 1995-2000 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. #include <linux/linkage.h>
  11. #include <asm/assembler.h>
  12. #include <asm/export.h>
  13. ENTRY(__raw_writesl)
  14. teq r2, #0 @ do we have to check for the zero len?
  15. reteq lr
  16. ands ip, r1, #3
  17. bne 3f
  18. subs r2, r2, #4
  19. bmi 2f
  20. stmfd sp!, {r4, lr}
  21. 1: ldmia r1!, {r3, r4, ip, lr}
  22. subs r2, r2, #4
  23. str r3, [r0, #0]
  24. str r4, [r0, #0]
  25. str ip, [r0, #0]
  26. str lr, [r0, #0]
  27. bpl 1b
  28. ldmfd sp!, {r4, lr}
  29. 2: movs r2, r2, lsl #31
  30. ldmcsia r1!, {r3, ip}
  31. strcs r3, [r0, #0]
  32. ldrne r3, [r1, #0]
  33. strcs ip, [r0, #0]
  34. strne r3, [r0, #0]
  35. ret lr
  36. 3: bic r1, r1, #3
  37. ldr r3, [r1], #4
  38. cmp ip, #2
  39. blt 5f
  40. bgt 6f
  41. 4: mov ip, r3, lspull #16
  42. ldr r3, [r1], #4
  43. subs r2, r2, #1
  44. orr ip, ip, r3, lspush #16
  45. str ip, [r0]
  46. bne 4b
  47. ret lr
  48. 5: mov ip, r3, lspull #8
  49. ldr r3, [r1], #4
  50. subs r2, r2, #1
  51. orr ip, ip, r3, lspush #24
  52. str ip, [r0]
  53. bne 5b
  54. ret lr
  55. 6: mov ip, r3, lspull #24
  56. ldr r3, [r1], #4
  57. subs r2, r2, #1
  58. orr ip, ip, r3, lspush #8
  59. str ip, [r0]
  60. bne 6b
  61. ret lr
  62. ENDPROC(__raw_writesl)
  63. EXPORT_SYMBOL(__raw_writesl)