2 * linux/arch/arm26/lib/io-writesw.S
4 * Copyright (C) 1995-2000 Russell King
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.
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/hardware.h>
15 adr r0, .outsw_bad_align_msg
19 .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
22 .outsw_align: tst r1, #1
23 bne .outsw_bad_alignment
29 orr r3, r3, r3, lsl #16
32 RETINSTR(moveq, pc, lr)
35 teq r2, #0 @ do we have to check for the zero len?
40 .outsw_aligned: stmfd sp!, {r4, r5, r6, lr}
45 .outsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
48 orr ip, ip, ip, lsr #16
52 orr ip, ip, ip, lsl #16
56 orr ip, ip, ip, lsr #16
60 orr ip, ip, ip, lsl #16
64 orr ip, ip, ip, lsr #16
68 orr ip, ip, ip, lsl #16
72 orr ip, ip, ip, lsr #16
76 orr ip, ip, ip, lsl #16
83 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
85 .no_outsw_8: tst r2, #4
91 orr ip, ip, ip, lsr #16
95 orr ip, ip, ip, lsl #16
99 orr ip, ip, ip, lsr #16
103 orr ip, ip, ip, lsl #16
106 .no_outsw_4: tst r2, #2
112 orr ip, ip, ip, lsr #16
116 orr ip, ip, ip, lsl #16
119 .no_outsw_2: tst r2, #1
123 movne ip, r3, lsl #16
124 orrne ip, ip, ip, lsr #16
127 LOADREGS(fd, sp!, {r4, r5, r6, pc})