1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) IBM Corporation, 2011
4 * Derived from copyuser_power7.s by Anton Blanchard <anton@au.ibm.com>
5 * Author - Balbir Singh <bsingharora@gmail.com>
7 #include <asm/ppc_asm.h>
9 #include <asm/export.h>
13 EX_TABLE(100b,.Ldo_err1)
18 EX_TABLE(200b,.Ldo_err2)
22 300: EX_TABLE(300b,.Ldone)
26 ld r22,STK_REG(R22)(r1)
27 ld r21,STK_REG(R21)(r1)
28 ld r20,STK_REG(R20)(r1)
29 ld r19,STK_REG(R19)(r1)
30 ld r18,STK_REG(R18)(r1)
31 ld r17,STK_REG(R17)(r1)
32 ld r16,STK_REG(R16)(r1)
33 ld r15,STK_REG(R15)(r1)
34 ld r14,STK_REG(R14)(r1)
35 addi r1,r1,STACKFRAMESIZE
37 /* Do a byte by byte copy to get the exact remaining size */
53 _GLOBAL(copy_mc_generic)
59 /* Get the source 8B aligned */
89 stdu r1,-STACKFRAMESIZE(r1)
90 std r14,STK_REG(R14)(r1)
91 std r15,STK_REG(R15)(r1)
92 std r16,STK_REG(R16)(r1)
93 std r17,STK_REG(R17)(r1)
94 std r18,STK_REG(R18)(r1)
95 std r19,STK_REG(R19)(r1)
96 std r20,STK_REG(R20)(r1)
97 std r21,STK_REG(R21)(r1)
98 std r22,STK_REG(R22)(r1)
99 std r0,STACKFRAMESIZE+16(r1)
105 /* Now do cacheline (128B) sized loads and stores. */
138 err2; std r20,104(r3)
139 err2; std r21,112(r3)
140 err2; std r22,120(r3)
147 /* Up to 127B to go */
172 7: ld r14,STK_REG(R14)(r1)
173 ld r15,STK_REG(R15)(r1)
174 ld r16,STK_REG(R16)(r1)
175 ld r17,STK_REG(R17)(r1)
176 ld r18,STK_REG(R18)(r1)
177 ld r19,STK_REG(R19)(r1)
178 ld r20,STK_REG(R20)(r1)
179 ld r21,STK_REG(R21)(r1)
180 ld r22,STK_REG(R22)(r1)
181 addi r1,r1,STACKFRAMESIZE
183 /* Up to 63B to go */
197 /* Up to 31B to go */
207 9: clrldi r5,r5,(64-4)
209 /* Up to 15B to go */
213 err1; lwz r0,0(r4) /* Less chance of a reject with word ops */
242 EXPORT_SYMBOL_GPL(copy_mc_generic);