diff options
author | sewardj <unknown> | 1999-10-15 11:03:10 +0000 |
---|---|---|
committer | sewardj <unknown> | 1999-10-15 11:03:10 +0000 |
commit | dfb12323d9fd0c8fb717b8e548592f20163b4ed0 (patch) | |
tree | 7900eb0f51b03a254425cd3f978eb1e245071e11 /ghc/interpreter/storage.c | |
parent | f5fd4677bc522dba98447c6b3451441e8ab8e33e (diff) | |
download | haskell-dfb12323d9fd0c8fb717b8e548592f20163b4ed0.tar.gz |
[project @ 1999-10-15 11:02:06 by sewardj]
Added basic support for foreign export dynamic.
Many aspects of it are still broken:
* Only supports x86-linux.
* The range of allowable types is small: Char Int Float Double
Addr and Word.
* Adjustor thunks are never freed.
* Returning Doubles or Floats doesn't work at all.
I expect to fix some of these shortly. foreign import also
needs redoing, so it can accept any number of arguments of
any type.
Also:
* Fixed setRtsFlags in Evaluator.c to make it endian-independent.
* Fixed raisePrim in Evaluator.c so things like division by zero,
array index errors, etc, throw an exception instead of
terminating StgHugs. raisePrim is renamed makeErrorCall.
Diffstat (limited to 'ghc/interpreter/storage.c')
-rw-r--r-- | ghc/interpreter/storage.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ghc/interpreter/storage.c b/ghc/interpreter/storage.c index 7de66abd5a..2015905d98 100644 --- a/ghc/interpreter/storage.c +++ b/ghc/interpreter/storage.c @@ -8,8 +8,8 @@ * in the distribution for details. * * $RCSfile: storage.c,v $ - * $Revision: 1.8 $ - * $Date: 1999/07/06 15:24:43 $ + * $Revision: 1.9 $ + * $Date: 1999/10/15 11:02:26 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -503,6 +503,16 @@ Name nameFromStgVar ( StgVar v ) return NIL; } +void* getHugs_AsmObject_for ( char* s ) +{ + StgVar v; + Name n = findName(findText(s)); + if (isNull(n)) internal("getHugs_AsmObject_for(1)"); + v = name(n).stgVar; + if (!isStgVar(v) || !isPtr(stgVarInfo(v))) + internal("getHugs_AsmObject_for(2)"); + return ptrOf(stgVarInfo(v)); +} /* -------------------------------------------------------------------------- * Primitive functions: |