io-writesw-armv3.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * linux/arch/arm/lib/io-writesw-armv3.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. .Loutsw_bad_alignment:
  13. adr r0, .Loutsw_bad_align_msg
  14. mov r2, lr
  15. b panic
  16. .Loutsw_bad_align_msg:
  17. .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
  18. .align
  19. .Loutsw_align: tst r1, #1
  20. bne .Loutsw_bad_alignment
  21. add r1, r1, #2
  22. ldr r3, [r1, #-4]
  23. mov r3, r3, lsr #16
  24. orr r3, r3, r3, lsl #16
  25. str r3, [r0]
  26. subs r2, r2, #1
  27. reteq lr
  28. ENTRY(__raw_writesw)
  29. teq r2, #0 @ do we have to check for the zero len?
  30. reteq lr
  31. tst r1, #3
  32. bne .Loutsw_align
  33. stmfd sp!, {r4, r5, r6, lr}
  34. subs r2, r2, #8
  35. bmi .Lno_outsw_8
  36. .Loutsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
  37. mov ip, r3, lsl #16
  38. orr ip, ip, ip, lsr #16
  39. str ip, [r0]
  40. mov ip, r3, lsr #16
  41. orr ip, ip, ip, lsl #16
  42. str ip, [r0]
  43. mov ip, r4, lsl #16
  44. orr ip, ip, ip, lsr #16
  45. str ip, [r0]
  46. mov ip, r4, lsr #16
  47. orr ip, ip, ip, lsl #16
  48. str ip, [r0]
  49. mov ip, r5, lsl #16
  50. orr ip, ip, ip, lsr #16
  51. str ip, [r0]
  52. mov ip, r5, lsr #16
  53. orr ip, ip, ip, lsl #16
  54. str ip, [r0]
  55. mov ip, r6, lsl #16
  56. orr ip, ip, ip, lsr #16
  57. str ip, [r0]
  58. mov ip, r6, lsr #16
  59. orr ip, ip, ip, lsl #16
  60. str ip, [r0]
  61. subs r2, r2, #8
  62. bpl .Loutsw_8_lp
  63. tst r2, #7
  64. ldmeqfd sp!, {r4, r5, r6, pc}
  65. .Lno_outsw_8: tst r2, #4
  66. beq .Lno_outsw_4
  67. ldmia r1!, {r3, r4}
  68. mov ip, r3, lsl #16
  69. orr ip, ip, ip, lsr #16
  70. str ip, [r0]
  71. mov ip, r3, lsr #16
  72. orr ip, ip, ip, lsl #16
  73. str ip, [r0]
  74. mov ip, r4, lsl #16
  75. orr ip, ip, ip, lsr #16
  76. str ip, [r0]
  77. mov ip, r4, lsr #16
  78. orr ip, ip, ip, lsl #16
  79. str ip, [r0]
  80. .Lno_outsw_4: tst r2, #2
  81. beq .Lno_outsw_2
  82. ldr r3, [r1], #4
  83. mov ip, r3, lsl #16
  84. orr ip, ip, ip, lsr #16
  85. str ip, [r0]
  86. mov ip, r3, lsr #16
  87. orr ip, ip, ip, lsl #16
  88. str ip, [r0]
  89. .Lno_outsw_2: tst r2, #1
  90. ldrne r3, [r1]
  91. movne ip, r3, lsl #16
  92. orrne ip, ip, ip, lsr #16
  93. strne ip, [r0]
  94. ldmfd sp!, {r4, r5, r6, pc}