Commit 6958ad05 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

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: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606132447.315714-5-npiggin@gmail.com
parent fc8562c9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment