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