diff --git a/libs/context/src/asm/jump_ppc64_sysv_elf_gas.S b/libs/context/src/asm/jump_ppc64_sysv_elf_gas.S index 28907db32..f3b7a230b 100644 --- a/libs/context/src/asm/jump_ppc64_sysv_elf_gas.S +++ b/libs/context/src/asm/jump_ppc64_sysv_elf_gas.S @@ -97,7 +97,7 @@ jump_fcontext: # endif #endif # reserve space on stack - subi %r1, %r1, 184 + subi %r1, %r1, 200 #if _CALL_ELF != 2 std %r2, 0(%r1) # save TOC @@ -133,6 +133,10 @@ jump_fcontext: # save LR as PC std %r0, 176(%r1) + # save VS63 + li %r31, 184 + stvx %v31, %r1, %r31 + # store RSP (pointing to context-data) in R6 mr %r6, %r1 @@ -145,6 +149,11 @@ jump_fcontext: ld %r2, 0(%r1) # restore TOC #endif + + # restore VS63 + li %r31, 184 + lvx %v31, %r1, %r31 + ld %r14, 8(%r1) # restore R14 ld %r15, 16(%r1) # restore R15 ld %r16, 24(%r1) # restore R16 @@ -180,7 +189,7 @@ jump_fcontext: mtctr %r12 # adjust stack - addi %r1, %r1, 184 + addi %r1, %r1, 200 #if _CALL_ELF == 2 # copy transfer_t into transfer_fn arg registers diff --git a/libs/context/src/asm/ontop_ppc64_sysv_elf_gas.S b/libs/context/src/asm/ontop_ppc64_sysv_elf_gas.S index cd97f4567..f8954edcf 100644 --- a/libs/context/src/asm/ontop_ppc64_sysv_elf_gas.S +++ b/libs/context/src/asm/ontop_ppc64_sysv_elf_gas.S @@ -97,7 +97,7 @@ ontop_fcontext: # endif #endif # reserve space on stack - subi %r1, %r1, 184 + subi %r1, %r1, 200 #if _CALL_ELF != 2 std %r2, 0(%r1) # save TOC @@ -133,6 +133,10 @@ ontop_fcontext: # save LR as PC std %r0, 176(%r1) + # save VS63 + li %r31, 184 + stvx %v31, %r1, %r31 + # store RSP (pointing to context-data) in R7 mr %r7, %r1 @@ -144,6 +148,10 @@ ontop_fcontext: mr %r1, %r4 #endif + # restore VS63 + li %r31, 184 + lvx %v31, %r1, %r31 + ld %r14, 8(%r1) # restore R14 ld %r15, 16(%r1) # restore R15 ld %r16, 24(%r1) # restore R16 @@ -203,7 +211,7 @@ return_to_ctx: mtlr %r0 # adjust stack - addi %r1, %r1, 184 + addi %r1, %r1, 200 # jump to context bctr