[project @ 2000-12-19 13:09:52 by sewardj]
[ghc-hetmet.git] / ghc / rts / Interpreter.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Interpreter.h,v 1.1 2000/12/19 13:09:52 sewardj Exp $
3  *
4  * (c) The GHC Team, 1998-2000.
5  *
6  * Prototypes for functions in Interpreter.c
7  *
8  * ---------------------------------------------------------------------------*/
9
10 #ifdef GHCI
11
12 extern StgThreadReturnCode interpretBCO ( Capability* cap );
13
14 #endif
15
16 #if 0
17 /* --------------------------------------------------------------------------
18  * Sizes of objects it constructs
19  * (used by Assembler)
20  * ------------------------------------------------------------------------*/
21
22 #define Izh_sizeW       CONSTR_sizeW(0,sizeofW(StgInt))
23 #define I64zh_sizeW     CONSTR_sizeW(0,sizeofW(StgInt64))
24 #define Wzh_sizeW       CONSTR_sizeW(0,sizeofW(StgWord))
25 #define Azh_sizeW       CONSTR_sizeW(0,sizeofW(StgAddr))
26 #define Czh_sizeW       CONSTR_sizeW(0,sizeofW(StgWord))
27 #define Fzh_sizeW       CONSTR_sizeW(0,sizeofW(StgFloat))
28 #define Dzh_sizeW       CONSTR_sizeW(0,sizeofW(StgDouble))
29 #define Stablezh_sizeW  CONSTR_sizeW(0,sizeofW(StgStablePtr))
30 #define Genericzh_sizeW CONSTR_sizeW(1,0)
31
32 /* --------------------------------------------------------------------------
33  * 
34  * ------------------------------------------------------------------------*/
35
36
37 extern nat marshall   ( char arg_ty, void* arg );
38 extern nat unmarshall ( char res_ty, void* res );
39 extern nat argSize    ( const char* ks );
40
41
42 extern StgInt          PopTaggedInt        ( void ) ;
43 extern StgWord         PopTaggedWord       ( void ) ;
44 extern StgAddr         PopTaggedAddr       ( void ) ;
45 extern StgStablePtr    PopTaggedStablePtr  ( void ) ;
46 extern StgChar         PopTaggedChar       ( void ) ;
47 extern StgFloat        PopTaggedFloat      ( void ) ;
48 extern StgDouble       PopTaggedDouble     ( void ) ;
49
50 extern void   PushTaggedInt        ( StgInt       );
51 extern void   PushTaggedWord       ( StgWord      );
52 extern void   PushTaggedAddr       ( StgAddr      );
53 extern void   PushTaggedStablePtr  ( StgStablePtr );
54 extern void   PushTaggedChar       ( StgChar      );
55 extern void   PushTaggedFloat      ( StgFloat     );
56 extern void   PushTaggedDouble     ( StgDouble    );
57
58 extern void   PushPtr        ( StgPtr );
59 extern StgPtr PopPtr         ( void );
60
61 extern int    numEnters;
62
63 /*-------------------------------------------------------------------------*/
64 #ifdef XMLAMBDA
65
66 #define MAX_CALL_VALUES  100
67
68 /* Self contained CallInfo structure for the i_ccall instruction */
69 typedef struct _CallInfo {
70   unsigned int  argCount;
71   unsigned int  resultCount;
72   char          callConv;     /* 's'=stdcall, 'c'=ccall */
73   
74 /* The strings arg_tys and result_tys reside here. 
75    This allows us to put the complete CallInfo in the nonptrwords of a BCO */
76   char          data[MAX_CALL_VALUES+2];  
77 } CallInfo;
78
79 #endif
80 #endif