1 /* -----------------------------------------------------------------------------
2 * $Id: Interpreter.h,v 1.1 2000/12/19 13:09:52 sewardj Exp $
4 * (c) The GHC Team, 1998-2000.
6 * Prototypes for functions in Interpreter.c
8 * ---------------------------------------------------------------------------*/
12 extern StgThreadReturnCode interpretBCO ( Capability* cap );
17 /* --------------------------------------------------------------------------
18 * Sizes of objects it constructs
20 * ------------------------------------------------------------------------*/
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)
32 /* --------------------------------------------------------------------------
34 * ------------------------------------------------------------------------*/
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 );
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 ) ;
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 );
58 extern void PushPtr ( StgPtr );
59 extern StgPtr PopPtr ( void );
63 /*-------------------------------------------------------------------------*/
66 #define MAX_CALL_VALUES 100
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 */
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];