io-writesw-armv3.S 2.2 KB

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