aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-02-10 23:55:44 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-16 03:58:35 -0400
commit7f664cf9e422105644818b180349e3b10a370de7 (patch)
treeca7a77a0a48bf09f7193dd79e9666bf0dd68f241 /arch/powerpc/boot
parent8c06f0d910ca628b657dc964a7347e70070dc7d6 (diff)
powerpc/boot: don't clobber r6 and r7 in epapr boot
We use r6 and r7 for epapr boot, but the current pre-C init will clobber both of these. This change does a simple replacement, of r6 -> r12 and r7 -> r13, so that we hit platform init with these registers intact. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/crt0.S24
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index e0040621d00c..12866ccb5694 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -155,29 +155,29 @@ p_base: mflr r10 /* r10 now points to runtime addr of p_base */
155 ld r9,(p_rela-p_base)(r10) 155 ld r9,(p_rela-p_base)(r10)
156 add r9,r9,r10 156 add r9,r9,r10
157 157
158 li r7,0 158 li r13,0
159 li r8,0 159 li r8,0
1609: ld r6,0(r11) /* get tag */ 1609: ld r12,0(r11) /* get tag */
161 cmpdi r6,0 161 cmpdi r12,0
162 beq 12f /* end of list */ 162 beq 12f /* end of list */
163 cmpdi r6,RELA 163 cmpdi r12,RELA
164 bne 10f 164 bne 10f
165 ld r7,8(r11) /* get RELA pointer in r7 */ 165 ld r13,8(r11) /* get RELA pointer in r13 */
166 b 11f 166 b 11f
16710: addis r6,r6,(-RELACOUNT)@ha 16710: addis r12,r12,(-RELACOUNT)@ha
168 cmpdi r6,RELACOUNT@l 168 cmpdi r12,RELACOUNT@l
169 bne 11f 169 bne 11f
170 ld r8,8(r11) /* get RELACOUNT value in r8 */ 170 ld r8,8(r11) /* get RELACOUNT value in r8 */
17111: addi r11,r11,16 17111: addi r11,r11,16
172 b 9b 172 b 9b
17312: 17312:
174 cmpdi r7,0 /* check we have both RELA and RELACOUNT */ 174 cmpdi r13,0 /* check we have both RELA and RELACOUNT */
175 cmpdi cr1,r8,0 175 cmpdi cr1,r8,0
176 beq 3f 176 beq 3f
177 beq cr1,3f 177 beq cr1,3f
178 178
179 /* Calcuate the runtime offset. */ 179 /* Calcuate the runtime offset. */
180 subf r7,r7,r9 180 subf r13,r13,r9
181 181
182 /* Run through the list of relocations and process the 182 /* Run through the list of relocations and process the
183 * R_PPC64_RELATIVE ones. */ 183 * R_PPC64_RELATIVE ones. */
@@ -185,10 +185,10 @@ p_base: mflr r10 /* r10 now points to runtime addr of p_base */
18513: ld r0,8(r9) /* ELF64_R_TYPE(reloc->r_info) */ 18513: ld r0,8(r9) /* ELF64_R_TYPE(reloc->r_info) */
186 cmpdi r0,22 /* R_PPC64_RELATIVE */ 186 cmpdi r0,22 /* R_PPC64_RELATIVE */
187 bne 3f 187 bne 3f
188 ld r6,0(r9) /* reloc->r_offset */ 188 ld r12,0(r9) /* reloc->r_offset */
189 ld r0,16(r9) /* reloc->r_addend */ 189 ld r0,16(r9) /* reloc->r_addend */
190 add r0,r0,r7 190 add r0,r0,r13
191 stdx r0,r7,r6 191 stdx r0,r13,r12
192 addi r9,r9,24 192 addi r9,r9,24
193 bdnz 13b 193 bdnz 13b
194 194