2 /* -----------------------------------------------------------------------------
3 * $Id: Interpreter.h,v 1.3 2001/02/12 04:55:33 chak Exp $
5 * (c) The GHC Team, 1998-2000.
7 * Prototypes for functions in Interpreter.c
9 * ---------------------------------------------------------------------------*/
11 extern StgThreadReturnCode interpretBCO ( Capability* cap );
13 typedef unsigned short UShort;
16 /* --------------------------------------------------------------------------
17 * Sizes of objects it constructs
19 * ------------------------------------------------------------------------*/
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)
31 /* --------------------------------------------------------------------------
33 * ------------------------------------------------------------------------*/
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 );
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 ) ;
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 );
57 extern void PushPtr ( StgPtr );
58 extern StgPtr PopPtr ( void );
62 /*-------------------------------------------------------------------------*/
65 #define MAX_CALL_VALUES 100
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 */
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];