2 /* -----------------------------------------------------------------------------
3 * $Id: Interpreter.h,v 1.2 2000/12/19 16:48:35 sewardj Exp $
5 * (c) The GHC Team, 1998-2000.
7 * Prototypes for functions in Interpreter.c
9 * ---------------------------------------------------------------------------*/
13 extern StgThreadReturnCode interpretBCO ( Capability* cap );
15 typedef unsigned short UShort;
20 /* --------------------------------------------------------------------------
21 * Sizes of objects it constructs
23 * ------------------------------------------------------------------------*/
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)
35 /* --------------------------------------------------------------------------
37 * ------------------------------------------------------------------------*/
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 );
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 ) ;
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 );
61 extern void PushPtr ( StgPtr );
62 extern StgPtr PopPtr ( void );
66 /*-------------------------------------------------------------------------*/
69 #define MAX_CALL_VALUES 100
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 */
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];