X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2Fprimops.txt.pp;h=4d7d4d91982138447b3e20656c544aeb1fd67b82;hb=729a6eb1de3041883bd82c46864e1b5f50855b59;hp=ade88b4b6b23b0d09773425fd9619ec12767f3e6;hpb=fbbed914e114b6b55158319dca8956885f301ff5;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/primops.txt.pp b/ghc/compiler/prelude/primops.txt.pp index ade88b4..4d7d4d9 100644 --- a/ghc/compiler/prelude/primops.txt.pp +++ b/ghc/compiler/prelude/primops.txt.pp @@ -1,5 +1,5 @@ ----------------------------------------------------------------------- --- $Id: primops.txt.pp,v 1.21 2002/06/26 08:18:38 stolz Exp $ +-- $Id: primops.txt.pp,v 1.30 2003/10/01 10:57:39 wolfgang Exp $ -- -- Primitive Operations -- @@ -1274,6 +1274,18 @@ primop SameMutVarOp "sameMutVar#" GenPrimOp with usage = { mangle SameMutVarOp [mkP, mkP] mkM } +-- not really the right type, but we don't know about pairs here. The +-- correct type is +-- +-- MutVar# s a -> (a -> (a,b)) -> State# s -> (# State# s, b #) +-- +primop AtomicModifyMutVarOp "atomicModifyMutVar#" GenPrimOp + MutVar# s a -> (a -> b) -> State# s -> (# State# s, c #) + with + usage = { mangle AtomicModifyMutVarOp [mkP, mkM, mkP] mkM } + has_side_effects = True + out_of_line = True + ------------------------------------------------------------------------ section "Exceptions" ------------------------------------------------------------------------ @@ -1300,6 +1312,15 @@ primop RaiseOp "raise#" GenPrimOp usage = { mangle RaiseOp [mkM] mkM } out_of_line = True +-- raiseIO# needs to be a primop, because exceptions in the IO monad +-- must be *precise* - we don't want the strictness analyser turning +-- one kind of bottom into another, as it is allowed to do in pure code. + +primop RaiseIOOp "raiseIO#" GenPrimOp + a -> State# RealWorld -> (# State# RealWorld, b #) + with + out_of_line = True + primop BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp (State# RealWorld -> (# State# RealWorld, a #)) -> (State# RealWorld -> (# State# RealWorld, a #)) @@ -1403,6 +1424,33 @@ primop WaitWriteOp "waitWrite#" GenPrimOp has_side_effects = True out_of_line = True +#ifdef mingw32_TARGET_OS +primop AsyncReadOp "asyncRead#" GenPrimOp + Int# -> Int# -> Int# -> Addr# -> State# RealWorld-> (# State# RealWorld, Int#, Int# #) + {Asynchronously read bytes from specified file descriptor.} + with + needs_wrapper = True + has_side_effects = True + out_of_line = True + +primop AsyncWriteOp "asyncWrite#" GenPrimOp + Int# -> Int# -> Int# -> Addr# -> State# RealWorld-> (# State# RealWorld, Int#, Int# #) + {Asynchronously write bytes from specified file descriptor.} + with + needs_wrapper = True + has_side_effects = True + out_of_line = True + +primop AsyncDoProcOp "asyncDoProc#" GenPrimOp + Addr# -> Addr# -> State# RealWorld-> (# State# RealWorld, Int#, Int# #) + {Asynchronously perform procedure (first arg), passing it 2nd arg.} + with + needs_wrapper = True + has_side_effects = True + out_of_line = True + +#endif + ------------------------------------------------------------------------ section "Concurrency primitives" {(In a non-concurrent implementation, ThreadId\# can be as singleton @@ -1417,12 +1465,6 @@ primop ForkOp "fork#" GenPrimOp has_side_effects = True out_of_line = True -primop ForkProcessOp "forkProcess#" GenPrimOp - State# RealWorld -> (# State# RealWorld, Int# #) - with - has_side_effects = True - out_of_line = True - primop KillThreadOp "killThread#" GenPrimOp ThreadId# -> a -> State# RealWorld -> State# RealWorld with @@ -1446,6 +1488,11 @@ primop LabelThreadOp "labelThread#" GenPrimOp with has_side_effects = True out_of_line = True + +primop IsCurrentThreadBoundOp "isCurrentThreadBound#" GenPrimOp + State# RealWorld -> (# State# RealWorld, Int# #) + with + out_of_line = True ------------------------------------------------------------------------ section "Weak pointers" @@ -1469,7 +1516,7 @@ primop DeRefWeakOp "deRefWeak#" GenPrimOp primop FinalizeWeakOp "finalizeWeak#" GenPrimOp Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, - (State# RealWorld -> (# State# RealWorld, Unit #)) #) + (State# RealWorld -> (# State# RealWorld, () #)) #) with usage = { mangle FinalizeWeakOp [mkM, mkP] (mkR . (inUB FinalizeWeakOp @@ -1622,12 +1669,12 @@ primop AddrToHValueOp "addrToHValue#" GenPrimOp {Convert an Addr\# to a followable type.} primop MkApUpd0_Op "mkApUpd0#" GenPrimOp - a -> (# a #) + BCO# -> (# a #) with out_of_line = True primop NewBCOOp "newBCO#" GenPrimOp - ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> State# s -> (# State# s, BCO# #) + ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> Int# -> ByteArr# -> State# s -> (# State# s, BCO# #) with has_side_effects = True out_of_line = True