1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/io-readsb.S
5 * Copyright (C) 1995-2000 Russell King
7 #include <linux/linkage.h>
8 #include <asm/assembler.h>
10 .Linsb_align: rsb ip, ip, #4
24 teq r2, #0 @ do we have to check for the zero len?
29 .Linsb_aligned: stmfd sp!, {r4 - r6, lr}
34 .Linsb_16_lp: ldrb r3, [r0]
37 mov r3, r3, put_byte_0
39 orr r3, r3, r4, put_byte_1
41 orr r3, r3, r5, put_byte_2
43 orr r3, r3, r6, put_byte_3
45 mov r4, r4, put_byte_0
47 orr r4, r4, r5, put_byte_1
49 orr r4, r4, r6, put_byte_2
51 orr r4, r4, ip, put_byte_3
53 mov r5, r5, put_byte_0
55 orr r5, r5, r6, put_byte_1
57 orr r5, r5, ip, put_byte_2
59 orr r5, r5, lr, put_byte_3
61 mov r6, r6, put_byte_0
62 orr r6, r6, ip, put_byte_1
64 orr r6, r6, lr, put_byte_2
65 orr r6, r6, ip, put_byte_3
72 ldmfdeq sp!, {r4 - r6, pc}
74 .Linsb_no_16: tst r2, #8
80 mov r3, r3, put_byte_0
82 orr r3, r3, r4, put_byte_1
84 orr r3, r3, r5, put_byte_2
86 orr r3, r3, r6, put_byte_3
88 mov r4, r4, put_byte_0
90 orr r4, r4, r5, put_byte_1
91 orr r4, r4, r6, put_byte_2
92 orr r4, r4, ip, put_byte_3
95 .Linsb_no_8: tst r2, #4
102 mov r3, r3, put_byte_0
103 orr r3, r3, r4, put_byte_1
104 orr r3, r3, r5, put_byte_2
105 orr r3, r3, r6, put_byte_3
108 .Linsb_no_4: ands r2, r2, #3
109 ldmfdeq sp!, {r4 - r6, pc}
119 ldmfd sp!, {r4 - r6, pc}
120 ENDPROC(__raw_readsb)