io-writesl.S
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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. #include <asm/hardware.h>
  13. ENTRY(__raw_writesl)
  14. teq r2, #0 @ do we have to check for the zero len?
  15. moveq pc, lr
  16. ands ip, r1, #3
  17. bne 2f
  18. 1: ldr r3, [r1], #4
  19. str r3, [r0]
  20. subs r2, r2, #1
  21. bne 1b
  22. mov pc, lr
  23. 2: bic r1, r1, #3
  24. cmp ip, #2
  25. ldr r3, [r1], #4
  26. bgt 4f
  27. blt 5f
  28. 3: mov ip, r3, lsr #16
  29. ldr r3, [r1], #4
  30. orr ip, ip, r3, lsl #16
  31. str ip, [r0]
  32. subs r2, r2, #1
  33. bne 3b
  34. mov pc, lr
  35. 4: mov ip, r3, lsr #24
  36. ldr r3, [r1], #4
  37. orr ip, ip, r3, lsl #8
  38. str ip, [r0]
  39. subs r2, r2, #1
  40. bne 4b
  41. mov pc, lr
  42. 5: mov ip, r3, lsr #8
  43. ldr r3, [r1], #4
  44. orr ip, ip, r3, lsl #24
  45. str ip, [r0]
  46. subs r2, r2, #1
  47. bne 5b
  48. mov pc, lr