powerpc/32: Rearrange _switch to prepare for 32/64 merge

Change the order of some operations and change some register numbers in
preparation to merge 32-bit and 64-bit switch.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606132447.315714-5-npiggin@gmail.com
This commit is contained in:
Nicholas Piggin 2023-06-06 23:24:45 +10:00 committed by Michael Ellerman
parent fc8562c9b6
commit 6958ad05d5

View File

@ -236,12 +236,12 @@ _GLOBAL(_switch)
stwu r1,-SWITCH_FRAME_SIZE(r1)
mflr r0
stw r0,SWITCH_FRAME_SIZE+4(r1)
stw r1,KSP(r3) /* Set old stack pointer */
/* r3-r12 are caller saved -- Cort */
SAVE_NVGPRS(r1)
stw r0,_NIP(r1) /* Return to switch caller */
mfcr r10
stw r10,_CCR(r1)
stw r1,KSP(r3) /* Set old stack pointer */
mfcr r0
stw r0,_CCR(r1)
/* The sync for SMP migration is taken care of, see entry_64.S */
@ -258,8 +258,8 @@ _GLOBAL(_switch)
/* r3-r12 are destroyed -- Cort */
REST_NVGPRS(r1)
lwz r4,_NIP(r1) /* Return to _switch caller in new task */
mtlr r4
lwz r0,_NIP(r1) /* Return to _switch caller in new task */
mtlr r0
addi r1,r1,SWITCH_FRAME_SIZE
blr