1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/io-readsw-armv3.S
5 * Copyright (C) 1995-2000 Russell King
7 #include <linux/linkage.h>
8 #include <asm/assembler.h>
11 adr r0, .Linsw_bad_align_msg
15 .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
18 .Linsw_align: tst r1, #1
19 bne .Linsw_bad_alignment
30 teq r2, #0 @ do we have to check for the zero len?
35 .Linsw_aligned: mov ip, #0xff
36 orr ip, ip, ip, lsl #8
37 stmfd sp!, {r4, r5, r6, lr}
42 .Linsw_8_lp: ldr r3, [r0]
45 orr r3, r3, r4, lsl #16
50 orr r4, r4, r5, lsl #16
55 orr r5, r5, r6, lsl #16
60 orr r6, r6, lr, lsl #16
68 ldmfdeq sp!, {r4, r5, r6, pc}
70 .Lno_insw_8: tst r2, #4
76 orr r3, r3, r4, lsl #16
81 orr r4, r4, r5, lsl #16
85 .Lno_insw_4: tst r2, #2
91 orr r3, r3, r4, lsl #16
95 .Lno_insw_2: tst r2, #1
101 ldmfd sp!, {r4, r5, r6, pc}