riscv64: fix getcontext/swapcontext return values

master
Ariadne Conill 2024-08-07 19:15:42 -07:00
parent c468c50b7b
commit e603fd7239
2 changed files with 5 additions and 4 deletions

View File

@ -25,8 +25,8 @@ FUNC(libucontext_getcontext)
sd s1, REG_OFFSET(REG_S1)(a0)
/* return register block */
sd a0, REG_OFFSET(REG_A0)(a0)
sd a1, REG_OFFSET(REG_A1)(a0)
sd x0, REG_OFFSET(REG_A0)(a0)
sd x0, REG_OFFSET(REG_A1)(a0)
/* second saved register block */
sd s2, REG_OFFSET(REG_S2)(a0)
@ -41,5 +41,6 @@ FUNC(libucontext_getcontext)
sd s11, REG_OFFSET(REG_S11)(a0)
/* done saving, return */
mv a0, x0
ret
END(libucontext_getcontext)

View File

@ -28,8 +28,8 @@ FUNC(libucontext_swapcontext)
sd s1, REG_OFFSET(REG_S1)(a0)
/* return register block */
sd a0, REG_OFFSET(REG_A0)(a0)
sd a1, REG_OFFSET(REG_A1)(a0)
sd x0, REG_OFFSET(REG_A0)(a0)
sd x0, REG_OFFSET(REG_A1)(a0)
/* second saved register block */
sd s2, REG_OFFSET(REG_S2)(a0)