Index: lib/libc/arch/mips/genassym.cf =================================================================== RCS file: /cvsroot/src/lib/libc/arch/mips/genassym.cf,v retrieving revision 1.2 diff -u -p -r1.2 genassym.cf --- lib/libc/arch/mips/genassym.cf 14 Dec 2009 01:07:41 -0000 1.2 +++ lib/libc/arch/mips/genassym.cf 12 Aug 2016 15:21:45 -0000 @@ -36,8 +36,8 @@ include include include -define _OFFSETOF_UC_GREGS offsetof(ucontext_t, uc_mcontext.__gregs[0]) define _OFFSETOF_UC_GREGS_V0 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_V0]) +define _OFFSETOF_UC_GREGS_GP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_GP]) define _OFFSETOF_UC_GREGS_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP]) define _OFFSETOF_UC_GREGS_EPC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_EPC]) define _OFFSETOF_UC_LINK offsetof(ucontext_t, uc_link) Index: lib/libc/arch/mips/gen/_resumecontext.S =================================================================== RCS file: /cvsroot/src/lib/libc/arch/mips/gen/_resumecontext.S,v retrieving revision 1.8 diff -u -p -r1.8 _resumecontext.S --- lib/libc/arch/mips/gen/_resumecontext.S 12 Aug 2016 15:21:25 -0000 1.8 +++ lib/libc/arch/mips/gen/_resumecontext.S 12 Aug 2016 15:21:45 -0000 @@ -51,9 +51,10 @@ LEAF_NOPROFILE(__resumecontext) PTR_S zero, _OFFSETOF_UC_LINK(a0) # make sure uc_link is 0 SYSTRAP(getcontext) # get context PTR_L a0, _OFFSETOF_UC_LINK(a0) # linked context? + NOP_L beq a0, zero, 1f # nope, exit process nop - PIC_TAILCALL(setcontext) # yes, become it. + SYSTRAP(setcontext) # yes, become it. /* NOTREACHED (in theory) */ li a0, -1 # failure, 1: Index: lib/libc/arch/mips/sys/getcontext.S =================================================================== RCS file: /cvsroot/src/lib/libc/arch/mips/sys/getcontext.S,v retrieving revision 1.5 diff -u -p -r1.5 getcontext.S --- lib/libc/arch/mips/sys/getcontext.S 10 Aug 2016 16:45:24 -0000 1.5 +++ lib/libc/arch/mips/sys/getcontext.S 12 Aug 2016 15:21:45 -0000 @@ -47,12 +47,12 @@ LEAF(_getcontext) SYSTRAP(getcontext) bne a3, zero, 1f REG_PROLOGUE - REG_S zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0) + REG_S zero, _OFFSETOF_UC_GREGS_V0(a0) #if !defined(__mips_o32) /* PIC_PROLOGUE saved gp in t3 */ - REG_S t3, (_OFFSETOF_UC_GREGS + _REG_GP * SZREG)(a0) + REG_S t3, _OFFSETOF_UC_GREGS_GP(a0) #endif - REG_S ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0) + REG_S ra, _OFFSETOF_UC_GREGS_EPC(a0) REG_EPILOGUE PIC_RETURN() 1: