diff options
| author | sof <unknown> | 1999-03-01 08:19:49 +0000 |
|---|---|---|
| committer | sof <unknown> | 1999-03-01 08:19:49 +0000 |
| commit | 7c906d8a0c55c997afeec2649c4faa359e6647ee (patch) | |
| tree | 042be08caa5aadaf36418d1d07021d3e0846e18a /ghc/lib/exts | |
| parent | 0932e85ef83d76247259ec8d2f49f5fcfba863cc (diff) | |
| download | haskell-7c906d8a0c55c997afeec2649c4faa359e6647ee.tar.gz | |
[project @ 1999-03-01 08:19:49 by sof]
Added:
writeStablePtrOffAddr :: Addr -> Int -> StablePtr a -> IO ()
readStablePtrOffAddr :: Addr -> Int -> IO (StablePtr a)
writeForeignObjOffAddr :: Addr -> Int -> ForeignObj -> IO ()
Diffstat (limited to 'ghc/lib/exts')
| -rw-r--r-- | ghc/lib/exts/Addr.lhs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ghc/lib/exts/Addr.lhs b/ghc/lib/exts/Addr.lhs index 57fd248e96..6d9149d60f 100644 --- a/ghc/lib/exts/Addr.lhs +++ b/ghc/lib/exts/Addr.lhs @@ -25,6 +25,8 @@ module Addr import PreludeBuiltin #else import PrelAddr +import PrelForeign +import PrelStable import PrelBase import PrelIOBase ( IO(..) ) import Word ( indexWord8OffAddr, indexWord16OffAddr @@ -130,6 +132,9 @@ readWordOffAddr a i = _casm_ `` %r=(StgWord)(((StgWord*)%0)[(StgInt)%1]); '' a readAddrOffAddr a i = _casm_ `` %r=(StgAddr)(((StgAddr*)%0)[(StgInt)%1]); '' a i readFloatOffAddr a i = _casm_ `` %r=(StgFloat)(((StgFloat*)%0)[(StgInt)%1]); '' a i readDoubleOffAddr a i = _casm_ `` %r=(StgDouble)(((StgDouble*)%0)[(StgInt)%1]); '' a i + +readStablePtrOffAddr :: Addr -> Int -> IO (StablePtr a) +readStablePtrOffAddr a i = _casm_ `` %r=(StgStablePtr)(((StgStablePtr*)%0)[(StgInt)%1]); '' a i #endif \end{code} @@ -167,5 +172,16 @@ writeFloatOffAddr (A# a#) (I# i#) (F# e#) = IO $ \ s# -> writeDoubleOffAddr (A# a#) (I# i#) (D# e#) = IO $ \ s# -> case (writeDoubleOffAddr# a# i# e# s#) of s2# -> (# s2#, () #) + +#ifndef __PARALLEL_HASKELL__ +writeForeignObjOffAddr :: Addr -> Int -> ForeignObj -> IO () +writeForeignObjOffAddr (A# a#) (I# i#) (ForeignObj e#) = IO $ \ s# -> + case (writeForeignObjOffAddr# a# i# e# s#) of s2# -> (# s2#, () #) +#endif + +writeStablePtrOffAddr :: Addr -> Int -> StablePtr a -> IO () +writeStablePtrOffAddr (A# a#) (I# i#) (StablePtr e#) = IO $ \ s# -> + case (writeStablePtrOffAddr# a# i# e# s#) of s2# -> (# s2# , () #) + #endif \end{code} |
