io-writesl.S 1.2 KB

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