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