2 * linux/arch/arm/lib/io-readsw-armv4.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 .macro pack, rd, hw1, hw2
15 orr \rd, \hw1, \hw2, lsl #16
17 orr \rd, \hw2, \hw1, lsl #16
21 .insw_align: movs ip, r1, lsl #31
33 stmfd sp!, {r4, r5, lr}
38 .insw_8_lp: ldrh r3, [r0]
55 stmia r1!, {r3 - r5, ip}
58 .no_insw_8: tst r2, #4
71 .no_insw_4: movs r2, r2, lsl #31
79 .no_insw_2: ldrneh r3, [r0]
82 ldmfd sp!, {r4, r5, pc}
85 #define _BE_ONLY_(code...) code
86 #define _LE_ONLY_(code...)
87 #define push_hbyte0 lsr #8
88 #define pull_hbyte1 lsl #24
90 #define _BE_ONLY_(code...)
91 #define _LE_ONLY_(code...) code
92 #define push_hbyte0 lsl #24
93 #define pull_hbyte1 lsr #8
96 .insw_noalign: stmfd sp!, {r4, lr}
102 _BE_ONLY_( mov ip, ip, ror #8 )
104 _LE_ONLY_( mov ip, ip, lsr #8 )
105 _BE_ONLY_( mov ip, ip, lsr #24 )
109 _BE_ONLY_( mov ip, ip, lsl #24 )
114 orr ip, ip, r3, lsl #8
115 orr ip, ip, r4, push_hbyte0
117 mov ip, r4, pull_hbyte1
120 _BE_ONLY_( mov ip, ip, lsr #24 )
125 _BE_ONLY_( movne ip, ip, ror #8 )
127 _LE_ONLY_( movne ip, ip, lsr #8 )
128 _BE_ONLY_( movne ip, ip, lsr #24 )