Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/arch/arm/lib/io-writesl.S | |
3 | * | |
4 | * Copyright (C) 1995-2000 Russell King | |
5 | * | |
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. | |
9 | */ | |
10 | #include <linux/linkage.h> | |
11 | #include <asm/assembler.h> | |
4dd1837d | 12 | #include <asm/export.h> |
1da177e4 LT |
13 | |
14 | ENTRY(__raw_writesl) | |
15 | teq r2, #0 @ do we have to check for the zero len? | |
6ebbf2ce | 16 | reteq lr |
1da177e4 LT |
17 | ands ip, r1, #3 |
18 | bne 3f | |
19 | ||
20 | subs r2, r2, #4 | |
21 | bmi 2f | |
22 | stmfd sp!, {r4, lr} | |
23 | 1: ldmia r1!, {r3, r4, ip, lr} | |
24 | subs r2, r2, #4 | |
25 | str r3, [r0, #0] | |
26 | str r4, [r0, #0] | |
27 | str ip, [r0, #0] | |
28 | str lr, [r0, #0] | |
29 | bpl 1b | |
30 | ldmfd sp!, {r4, lr} | |
31 | 2: movs r2, r2, lsl #31 | |
32 | ldmcsia r1!, {r3, ip} | |
33 | strcs r3, [r0, #0] | |
34 | ldrne r3, [r1, #0] | |
35 | strcs ip, [r0, #0] | |
36 | strne r3, [r0, #0] | |
6ebbf2ce | 37 | ret lr |
1da177e4 LT |
38 | |
39 | 3: bic r1, r1, #3 | |
40 | ldr r3, [r1], #4 | |
41 | cmp ip, #2 | |
42 | blt 5f | |
43 | bgt 6f | |
44 | ||
d98b90ea | 45 | 4: mov ip, r3, lspull #16 |
1da177e4 LT |
46 | ldr r3, [r1], #4 |
47 | subs r2, r2, #1 | |
d98b90ea | 48 | orr ip, ip, r3, lspush #16 |
1da177e4 LT |
49 | str ip, [r0] |
50 | bne 4b | |
6ebbf2ce | 51 | ret lr |
1da177e4 | 52 | |
d98b90ea | 53 | 5: mov ip, r3, lspull #8 |
1da177e4 LT |
54 | ldr r3, [r1], #4 |
55 | subs r2, r2, #1 | |
d98b90ea | 56 | orr ip, ip, r3, lspush #24 |
1da177e4 LT |
57 | str ip, [r0] |
58 | bne 5b | |
6ebbf2ce | 59 | ret lr |
1da177e4 | 60 | |
d98b90ea | 61 | 6: mov ip, r3, lspull #24 |
1da177e4 LT |
62 | ldr r3, [r1], #4 |
63 | subs r2, r2, #1 | |
d98b90ea | 64 | orr ip, ip, r3, lspush #8 |
1da177e4 LT |
65 | str ip, [r0] |
66 | bne 6b | |
6ebbf2ce | 67 | ret lr |
93ed3970 | 68 | ENDPROC(__raw_writesl) |
4dd1837d | 69 | EXPORT_SYMBOL(__raw_writesl) |