diff --git a/arch/loongarch64/getcontext.S b/arch/loongarch64/getcontext.S index 49c90a9..27f4d36 100644 --- a/arch/loongarch64/getcontext.S +++ b/arch/loongarch64/getcontext.S @@ -35,11 +35,14 @@ FUNC(libucontext_getcontext) st.d $s8, $a0, REG_OFFSET(31) st.d $a2, $a0, REG_OFFSET(3) + st.d $zero, $a0, REG_OFFSET(4) st.d $a3, $a0, REG_OFFSET(22) st.d $ra, $a0, REG_OFFSET(1) st.d $ra, $a0, (MCONTEXT_PC) + move $a0, $zero + POP_FRAME(libucontext_getcontext) jr $ra diff --git a/arch/loongarch64/swapcontext.S b/arch/loongarch64/swapcontext.S index 6cde30e..0d589a4 100644 --- a/arch/loongarch64/swapcontext.S +++ b/arch/loongarch64/swapcontext.S @@ -39,6 +39,7 @@ FUNC(libucontext_swapcontext) st.d $s8, $t5, REG_OFFSET(31) st.d $a3, $t5, REG_OFFSET(3) + st.d $zero, $t5, REG_OFFSET(4) st.d $a4, $t5, REG_OFFSET(22) st.d $ra, $t5, REG_OFFSET(1)