From cd1a93d89e211b93c6eab4f3bbe692f0bfba8cf1 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 21 Aug 2000 14:16:57 +0000 Subject: [PATCH] [project @ 2000-08-21 14:16:57 by simonmar] - 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 | 6 +++++- ghc/lib/std/PrelGHC.hi-boot | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ghc/includes/PrimOps.h b/ghc/includes/PrimOps.h index 3565707..2972eb6 100644 --- a/ghc/includes/PrimOps.h +++ b/ghc/includes/PrimOps.h @@ -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 -------------------------------------------------------------------------- */ diff --git a/ghc/lib/std/PrelGHC.hi-boot b/ghc/lib/std/PrelGHC.hi-boot index 084c561..93cd557 100644 --- a/ghc/lib/std/PrelGHC.hi-boot +++ b/ghc/lib/std/PrelGHC.hi-boot @@ -325,6 +325,8 @@ __export PrelGHC ForeignObjzh mkForeignObjzh writeForeignObjzh + foreignObjToAddrzh + touchzh StablePtrzh makeStablePtrzh -- 1.7.10.4