2
* linux/arch/arm/lib/io-readsb.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>
13
.Linsb_align: rsb ip, ip, #4
27
teq r2, #0 @ do we have to check for the zero len?
32
.Linsb_aligned: stmfd sp!, {r4 - r6, lr}
37
.Linsb_16_lp: ldrb r3, [r0]
40
mov r3, r3, put_byte_0
42
orr r3, r3, r4, put_byte_1
44
orr r3, r3, r5, put_byte_2
46
orr r3, r3, r6, put_byte_3
48
mov r4, r4, put_byte_0
50
orr r4, r4, r5, put_byte_1
52
orr r4, r4, r6, put_byte_2
54
orr r4, r4, ip, put_byte_3
56
mov r5, r5, put_byte_0
58
orr r5, r5, r6, put_byte_1
60
orr r5, r5, ip, put_byte_2
62
orr r5, r5, lr, put_byte_3
64
mov r6, r6, put_byte_0
65
orr r6, r6, ip, put_byte_1
67
orr r6, r6, lr, put_byte_2
68
orr r6, r6, ip, put_byte_3
75
ldmeqfd sp!, {r4 - r6, pc}
77
.Linsb_no_16: tst r2, #8
83
mov r3, r3, put_byte_0
85
orr r3, r3, r4, put_byte_1
87
orr r3, r3, r5, put_byte_2
89
orr r3, r3, r6, put_byte_3
91
mov r4, r4, put_byte_0
93
orr r4, r4, r5, put_byte_1
94
orr r4, r4, r6, put_byte_2
95
orr r4, r4, ip, put_byte_3
98
.Linsb_no_8: tst r2, #4
105
mov r3, r3, put_byte_0
106
orr r3, r3, r4, put_byte_1
107
orr r3, r3, r5, put_byte_2
108
orr r3, r3, r6, put_byte_3
111
.Linsb_no_4: ands r2, r2, #3
112
ldmeqfd sp!, {r4 - r6, pc}
122
ldmfd sp!, {r4 - r6, pc}
123
ENDPROC(__raw_readsb)