io-writesl.S 1.1 KB

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