[project @ 2000-08-21 14:16:57 by simonmar]
authorsimonmar <unknown>
Mon, 21 Aug 2000 14:16:57 +0000 (14:16 +0000)
committersimonmar <unknown>
Mon, 21 Aug 2000 14:16:57 +0000 (14:16 +0000)
- add touch# and foreignObjToAddr# primops.

- add these functions to ForeignObj:

withForeignObj  :: ForeignObj -> (Addr -> IO a) -> IO a
touchForeignObj :: ForeignObj -> IO ()

- foreignObjToAddr, which was previously implemented using a _casm_, now
  uses the foreignObjToAddr# primop.

- replace implementations of readXXXOffForeignObj and writeXXXOffForeignObj
  using the withForeignObj and the Addr operations.  ForeignObj.lhs now has
  no _casms_ in it!  (it still can't be compiled with the NCG though, because
  it has a f.i.d.)

ghc/includes/PrimOps.h
ghc/lib/std/PrelGHC.hi-boot

index 3565707..2972eb6 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.60 2000/08/07 23:37:23 qrczak Exp $
+ * $Id: PrimOps.h,v 1.61 2000/08/21 14:16:57 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -859,6 +859,9 @@ EXTFUN_RTS(finalizzeWeakzh_fast);
 
 #define ForeignObj_CLOSURE_DATA(c)  (((StgForeignObj *)c)->data)
 
+#define foreignObjToAddrzh(r,fo)    r=ForeignObj_CLOSURE_DATA(fo)
+#define touchzh(o)                  /* nothing */
+
 EXTFUN_RTS(mkForeignObjzh_fast);
 
 #define writeForeignObjzh(res,datum) \
@@ -880,6 +883,7 @@ EXTFUN_RTS(mkForeignObjzh_fast);
 
 #endif
 
+
 /* -----------------------------------------------------------------------------
    Constructor tags
    -------------------------------------------------------------------------- */
index 084c561..93cd557 100644 (file)
@@ -325,6 +325,8 @@ __export PrelGHC
   ForeignObjzh
   mkForeignObjzh
   writeForeignObjzh
+  foreignObjToAddrzh
+  touchzh
 
   StablePtrzh
   makeStablePtrzh