summaryrefslogtreecommitdiff
path: root/ghc/rts/Evaluator.c
diff options
context:
space:
mode:
authorsewardj <unknown>1999-10-26 17:27:54 +0000
committersewardj <unknown>1999-10-26 17:27:54 +0000
commit6642714ec59883c1edd31e9e5b485e99f0edd952 (patch)
tree9cec68849f82246a26bb11b0a0e88ad9754b72ca /ghc/rts/Evaluator.c
parent37cb07db3d7827c8b5058411b12e23e86e6a6520 (diff)
downloadhaskell-6642714ec59883c1edd31e9e5b485e99f0edd952.tar.gz
[project @ 1999-10-26 17:27:25 by sewardj]
Add foreign import/export implementations for x86 stdcall convention. Make parser notice calling conventions on f-i and f-x declarations, check they are supported on the platform Hugs is compiled on. Pass them all the way through the code generator to the interpreter. Allow f-i/f-x decls to omit the calling convention, in which case ccall is used. Remove calling convention from all such decls in the Prelude so it will work on any platform.
Diffstat (limited to 'ghc/rts/Evaluator.c')
-rw-r--r--ghc/rts/Evaluator.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/ghc/rts/Evaluator.c b/ghc/rts/Evaluator.c
index a898471cfe..6dd91fa37b 100644
--- a/ghc/rts/Evaluator.c
+++ b/ghc/rts/Evaluator.c
@@ -5,8 +5,8 @@
* Copyright (c) 1994-1998.
*
* $RCSfile: Evaluator.c,v $
- * $Revision: 1.21 $
- * $Date: 1999/10/22 15:58:22 $
+ * $Revision: 1.22 $
+ * $Date: 1999/10/26 17:27:25 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
@@ -2883,7 +2883,8 @@ static void* enterBCO_primop2 ( int primop2code,
{
StgStablePtr stableptr = PopTaggedStablePtr();
StgAddr typestr = PopTaggedAddr();
- StgAddr adj_thunk = createAdjThunk(stableptr,typestr);
+ StgChar callconv = PopTaggedChar();
+ StgAddr adj_thunk = createAdjThunk(stableptr,typestr,callconv);
PushTaggedAddr(adj_thunk);
break;
}
@@ -3036,13 +3037,18 @@ off the stack.
ASSERT(0);
break;
#endif /* PROVIDE_CONCURRENT */
- case i_ccall_Id:
- case i_ccall_IO:
+ case i_ccall_ccall_Id:
+ case i_ccall_ccall_IO:
+ case i_ccall_stdcall_Id:
+ case i_ccall_stdcall_IO:
{
int r;
CFunDescriptor* descriptor = PopTaggedAddr();
void (*funPtr)(void) = PopTaggedAddr();
- r = ccall(descriptor,funPtr,bco);
+ char cc = (primop2code == i_ccall_stdcall_Id ||
+ primop2code == i_ccall_stdcall_IO)
+ ? 's' : 'c';
+ r = ccall(descriptor,funPtr,bco,cc);
if (r == 0) break;
if (r == 1)
return makeErrorCall(