Skip to content

Commit

Permalink
powerpc/32: Rearrange _switch to prepare for 32/64 merge
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Jun 14, 2023
1 parent fc8562c commit 6958ad0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand All @@ -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

Expand Down

0 comments on commit 6958ad0

Please sign in to comment.