X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FHeapStackCheck.cmm;h=9b5593789ff747807fdf89d06c03f687fb55a410;hb=9d7da331989abcd1844e9d03b8d1e4163796fa85;hp=ea2d64fa97beec374378c417d5e865ff66c98b21;hpb=9e10d632f946bae5dd9a9ccd199c8345ca696d15;p=ghc-hetmet.git diff --git a/ghc/rts/HeapStackCheck.cmm b/ghc/rts/HeapStackCheck.cmm index ea2d64f..9b55937 100644 --- a/ghc/rts/HeapStackCheck.cmm +++ b/ghc/rts/HeapStackCheck.cmm @@ -42,6 +42,11 @@ * at all, it won't yield. Hopefully this won't be a problem in practice. */ +#define PRE_RETURN(why,what_next) \ + StgTSO_what_next(CurrentTSO) = what_next::I16; \ + StgRegTable_rRet(BaseReg) = why; \ + R1 = BaseReg; + /* Remember that the return address is *removed* when returning to a * ThreadRunGHC thread. */ @@ -69,13 +74,9 @@ R1 = StackOverflow; \ } \ sched: \ - StgTSO_what_next(CurrentTSO) = ThreadRunGHC::I16; \ + PRE_RETURN(R1,ThreadRunGHC); \ jump stg_returnToSched; -#define PRE_RETURN(why,what_next) \ - StgTSO_what_next(CurrentTSO) = what_next::I16; \ - R1 = why; - #define HP_GENERIC \ PRE_RETURN(HeapOverflow, ThreadRunGHC) \ jump stg_returnToSched; @@ -946,3 +947,18 @@ stg_block_async_void } #endif + +/* ----------------------------------------------------------------------------- + STM-specific waiting + -------------------------------------------------------------------------- */ + +stg_block_stmwait_finally +{ + foreign "C" stmWaitUnlock(MyCapability() "ptr", R3 "ptr"); + jump StgReturn; +} + +stg_block_stmwait +{ + BLOCK_BUT_FIRST(stg_block_stmwait_finally); +}