2 * linux/arch/arm26/lib/io-readsw.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, .insw_bad_align_msg
19 .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
22 .insw_align: tst r1, #1
23 bne .insw_bad_alignment
31 RETINSTR(moveq, pc, lr)
34 teq r2, #0 @ do we have to check for the zero len?
39 .insw_aligned: mov ip, #0xff
40 orr ip, ip, ip, lsl #8
41 stmfd sp!, {r4, r5, r6, lr}
46 .insw_8_lp: ldr r3, [r0]
49 orr r3, r3, r4, lsl #16
54 orr r4, r4, r5, lsl #16
59 orr r5, r5, r6, lsl #16
64 orr r6, r6, lr, lsl #16
72 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
74 .no_insw_8: tst r2, #4
80 orr r3, r3, r4, lsl #16
85 orr r4, r4, r5, lsl #16
89 .no_insw_4: tst r2, #2
95 orr r3, r3, r4, lsl #16
99 .no_insw_2: tst r2, #1
105 LOADREGS(fd, sp!, {r4, r5, r6, pc})