X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FStixPrim.lhs;h=accb9fe1d0bf429bec1b11e6655fc68b5d887486;hb=7752abc1008b633fdc7a0b9f283ceca40747b609;hp=ffca3c2d196a1c324d2f04e75967020827db746e;hpb=47eef4b5780f0a5b5a37847097842daebd0f9285;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs index ffca3c2..accb9fe 100644 --- a/ghc/compiler/nativeGen/StixPrim.lhs +++ b/ghc/compiler/nativeGen/StixPrim.lhs @@ -22,6 +22,7 @@ import Constants ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE, rESERVED_STACK_WORDS ) import CLabel ( mkIntlikeClosureLabel, mkCharlikeClosureLabel, mkMAP_FROZEN_infoLabel, mkForeignLabel ) +import CallConv ( cCallConv ) import Outputable import FastTypes @@ -254,6 +255,10 @@ primCode ls WriteByteArrayOp_Word64 rs = primCode_WriteByteArrayOp Word64Rep ToDo: saving/restoring of volatile regs around ccalls. +JRS, 001113: always do the call of suspendThread and resumeThread as a ccall +rather than inheriting the calling convention of the thing which we're really +calling. + \begin{code} primCode lhs (CCallOp (CCall (StaticTarget fn) is_asm may_gc cconv)) rhs | is_asm = error "ERROR: Native code generator can't handle casm" @@ -266,8 +271,10 @@ primCode lhs (CCallOp (CCall (StaticTarget fn) is_asm may_gc cconv)) rhs id = StReg (StixTemp uniq IntRep) suspend = StAssign IntRep id - (StCall SLIT("suspendThread") cconv IntRep [stgBaseReg]) - resume = StCall SLIT("resumeThread") cconv VoidRep [id] + (StCall SLIT("suspendThread") {-no:cconv-} cCallConv + IntRep [stgBaseReg]) + resume = StCall SLIT("resumeThread") {-no:cconv-} cCallConv + VoidRep [id] in returnUs (\xs -> save (suspend : ccall : resume : load xs))