io-writesl.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. moveq pc, 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. mov pc, 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, pull #16
  41. ldr r3, [r1], #4
  42. subs r2, r2, #1
  43. orr ip, ip, r3, push #16
  44. str ip, [r0]
  45. bne 4b
  46. mov pc, lr
  47. 5: mov ip, r3, pull #8
  48. ldr r3, [r1], #4
  49. subs r2, r2, #1
  50. orr ip, ip, r3, push #24
  51. str ip, [r0]
  52. bne 5b
  53. mov pc, lr
  54. 6: mov ip, r3, pull #24
  55. ldr r3, [r1], #4
  56. subs r2, r2, #1
  57. orr ip, ip, r3, push #8
  58. str ip, [r0]
  59. bne 6b
  60. mov pc, lr