aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/lib/copyuser_64.S53
1 files changed, 38 insertions, 15 deletions
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index d73a59014900..596a285c0755 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -9,6 +9,14 @@
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/ppc_asm.h> 10#include <asm/ppc_asm.h>
11 11
12#ifdef __BIG_ENDIAN__
13#define sLd sld /* Shift towards low-numbered address. */
14#define sHd srd /* Shift towards high-numbered address. */
15#else
16#define sLd srd /* Shift towards low-numbered address. */
17#define sHd sld /* Shift towards high-numbered address. */
18#endif
19
12 .align 7 20 .align 7
13_GLOBAL(__copy_tofrom_user) 21_GLOBAL(__copy_tofrom_user)
14BEGIN_FTR_SECTION 22BEGIN_FTR_SECTION
@@ -118,10 +126,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
118 126
11924: ld r9,0(r4) /* 3+2n loads, 2+2n stores */ 12724: ld r9,0(r4) /* 3+2n loads, 2+2n stores */
12025: ld r0,8(r4) 12825: ld r0,8(r4)
121 sld r6,r9,r10 129 sLd r6,r9,r10
12226: ldu r9,16(r4) 13026: ldu r9,16(r4)
123 srd r7,r0,r11 131 sHd r7,r0,r11
124 sld r8,r0,r10 132 sLd r8,r0,r10
125 or r7,r7,r6 133 or r7,r7,r6
126 blt cr6,79f 134 blt cr6,79f
12727: ld r0,8(r4) 13527: ld r0,8(r4)
@@ -129,35 +137,35 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
129 137
13028: ld r0,0(r4) /* 4+2n loads, 3+2n stores */ 13828: ld r0,0(r4) /* 4+2n loads, 3+2n stores */
13129: ldu r9,8(r4) 13929: ldu r9,8(r4)
132 sld r8,r0,r10 140 sLd r8,r0,r10
133 addi r3,r3,-8 141 addi r3,r3,-8
134 blt cr6,5f 142 blt cr6,5f
13530: ld r0,8(r4) 14330: ld r0,8(r4)
136 srd r12,r9,r11 144 sHd r12,r9,r11
137 sld r6,r9,r10 145 sLd r6,r9,r10
13831: ldu r9,16(r4) 14631: ldu r9,16(r4)
139 or r12,r8,r12 147 or r12,r8,r12
140 srd r7,r0,r11 148 sHd r7,r0,r11
141 sld r8,r0,r10 149 sLd r8,r0,r10
142 addi r3,r3,16 150 addi r3,r3,16
143 beq cr6,78f 151 beq cr6,78f
144 152
1451: or r7,r7,r6 1531: or r7,r7,r6
14632: ld r0,8(r4) 15432: ld r0,8(r4)
14776: std r12,8(r3) 15576: std r12,8(r3)
1482: srd r12,r9,r11 1562: sHd r12,r9,r11
149 sld r6,r9,r10 157 sLd r6,r9,r10
15033: ldu r9,16(r4) 15833: ldu r9,16(r4)
151 or r12,r8,r12 159 or r12,r8,r12
15277: stdu r7,16(r3) 16077: stdu r7,16(r3)
153 srd r7,r0,r11 161 sHd r7,r0,r11
154 sld r8,r0,r10 162 sLd r8,r0,r10
155 bdnz 1b 163 bdnz 1b
156 164
15778: std r12,8(r3) 16578: std r12,8(r3)
158 or r7,r7,r6 166 or r7,r7,r6
15979: std r7,16(r3) 16779: std r7,16(r3)
1605: srd r12,r9,r11 1685: sHd r12,r9,r11
161 or r12,r8,r12 169 or r12,r8,r12
16280: std r12,24(r3) 17080: std r12,24(r3)
163 bne 6f 171 bne 6f
@@ -165,23 +173,38 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
165 blr 173 blr
1666: cmpwi cr1,r5,8 1746: cmpwi cr1,r5,8
167 addi r3,r3,32 175 addi r3,r3,32
168 sld r9,r9,r10 176 sLd r9,r9,r10
169 ble cr1,7f 177 ble cr1,7f
17034: ld r0,8(r4) 17834: ld r0,8(r4)
171 srd r7,r0,r11 179 sHd r7,r0,r11
172 or r9,r7,r9 180 or r9,r7,r9
1737: 1817:
174 bf cr7*4+1,1f 182 bf cr7*4+1,1f
183#ifdef __BIG_ENDIAN__
175 rotldi r9,r9,32 184 rotldi r9,r9,32
185#endif
17694: stw r9,0(r3) 18694: stw r9,0(r3)
187#ifdef __LITTLE_ENDIAN__
188 rotrdi r9,r9,32
189#endif
177 addi r3,r3,4 190 addi r3,r3,4
1781: bf cr7*4+2,2f 1911: bf cr7*4+2,2f
192#ifdef __BIG_ENDIAN__
179 rotldi r9,r9,16 193 rotldi r9,r9,16
194#endif
18095: sth r9,0(r3) 19595: sth r9,0(r3)
196#ifdef __LITTLE_ENDIAN__
197 rotrdi r9,r9,16
198#endif
181 addi r3,r3,2 199 addi r3,r3,2
1822: bf cr7*4+3,3f 2002: bf cr7*4+3,3f
201#ifdef __BIG_ENDIAN__
183 rotldi r9,r9,8 202 rotldi r9,r9,8
203#endif
18496: stb r9,0(r3) 20496: stb r9,0(r3)
205#ifdef __LITTLE_ENDIAN__
206 rotrdi r9,r9,8
207#endif
1853: li r3,0 2083: li r3,0
186 blr 209 blr
187 210