ASSERT(Sp != 0); \
ASSERT(SpLim != 0); \
ASSERT(HpLim != 0); \
- ASSERT(SpLim - RESERVED_STACK_WORDS <= Sp); \
+ ASSERT(SpLim - WDS(RESERVED_STACK_WORDS) <= Sp); \
ASSERT(HpLim >= Hp);
/* -----------------------------------------------------------------------------
SAVE_THREAD_STATE();
- /* R1 contains the return value of the thread */
- R1 = ThreadFinished;
+ /* The return code goes in BaseReg->rRet, and BaseReg is returned in R1 */
+ StgRegTable_rRet(BaseReg) = ThreadFinished;
+ R1 = BaseReg;
jump StgReturn;
}
stg_returnToSched
{
SAVE_THREAD_STATE();
- foreign "C" threadPaused(CurrentTSO);
+ foreign "C" threadPaused(MyCapability() "ptr", CurrentTSO);
jump StgReturn;
}
stg_returnToSchedButFirst
{
SAVE_THREAD_STATE();
- foreign "C" threadPaused(CurrentTSO);
+ foreign "C" threadPaused(MyCapability() "ptr", CurrentTSO);
jump R2;
}