[project @ 1999-03-02 19:44:07 by sof]
authorsof <unknown>
Tue, 2 Mar 1999 19:44:23 +0000 (19:44 +0000)
committersof <unknown>
Tue, 2 Mar 1999 19:44:23 +0000 (19:44 +0000)
- misc changes to support DLLs
- StgNat* --> StgWord*

16 files changed:
ghc/includes/Block.h
ghc/includes/ClosureMacros.h
ghc/includes/InfoMacros.h
ghc/includes/InfoTables.h
ghc/includes/Prelude.h
ghc/includes/PrimOps.h
ghc/includes/Regs.h
ghc/includes/RtsAPI.h
ghc/includes/Stable.h
ghc/includes/Stg.h
ghc/includes/StgMacros.h
ghc/includes/StgMiscClosures.h
ghc/includes/StgStorage.h
ghc/includes/StgTypes.h
ghc/includes/TSO.h
ghc/includes/Updates.h

index f924a8e..c665583 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Block.h,v 1.4 1999/02/05 16:02:19 simonm Exp $
+ * $Id: Block.h,v 1.5 1999/03/02 19:44:07 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -47,12 +47,12 @@ typedef struct _bdescr {
   struct _bdescr *back;                /* used (occasionally) for doubly-linked lists*/
   struct _generation *gen;     /* generation */
   struct _step *step;          /* step */
-  StgNat32 blocks;             /* no. of blocks (if grp head, 0 otherwise) */
-  StgNat32 evacuated;           /* block is in to-space */
+  StgWord32 blocks;            /* no. of blocks (if grp head, 0 otherwise) */
+  StgWord32 evacuated;           /* block is in to-space */
 #if SIZEOF_VOID_P == 8
-  StgNat32 _padding[2];
+  StgWord32 _padding[2];
 #else
-  StgNat32 _padding[0];
+  StgWord32 _padding[0];
 #endif
 } bdescr;
 
index c99caaa..db7970c 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: ClosureMacros.h,v 1.4 1999/02/05 16:02:20 simonm Exp $
+ * $Id: ClosureMacros.h,v 1.5 1999/03/02 19:44:08 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -105,6 +105,28 @@ extern StgFun DATA_SECTION_END_MARKER_DECL;
 #define IS_DATA_PTR(p) ((P_)(p) >= (P_)&TEXT_SECTION_END_MARKER && (P_)(p) < (P_)&DATA_SECTION_END_MARKER)
 #define IS_USER_PTR(p) ((P_)(p) >= (P_)&DATA_SECTION_END_MARKER)
 
+#ifdef HAVE_WIN32_DLL_SUPPORT
+/* ToDo: clean up */
+extern char* base_non_committed;
+#define HEAP_ALLOCED(x)  (((char*)(x) >= base_non_committed) && ((char*)(x) <= (base_non_committed + 128 * 1024 * 1024)))
+#endif
+
+#ifndef HAVE_WIN32_DLL_SUPPORT
+#define LOOKS_LIKE_STATIC(r) IS_DATA_PTR(r)
+#else
+/* Static closures are 'identified' by being prefixed with a zero. This is
+   so that they can be distinguished from pointers to info tables. Relies
+   on the fact that info tables are reversed.
+   
+   LOOKS_LIKE_STATIC_CLOSURE() - discriminates between static closures and info tbls
+                                 (needed by LOOKS_LIKE_GHC_INFO() below - [Win32 DLLs only.])
+   LOOKS_LIKE_STATIC() - distinguishes between static and heap allocated data.
+ */
+#define LOOKS_LIKE_STATIC(r) (!(HEAP_ALLOCED(r)))
+#define LOOKS_LIKE_STATIC_CLOSURE(r) ((*(((unsigned long *)(r))-1)) == 0)
+#endif
+
+
 /* -----------------------------------------------------------------------------
    Macros for distinguishing infotables from closures.
    
@@ -129,11 +151,13 @@ extern StgFun DATA_SECTION_END_MARKER_DECL;
 #define LOOKS_LIKE_GHC_INFO(info) IS_CODE_PTR(info)
 #else
 /* otherwise we have entry pointers on closures */
-#define LOOKS_LIKE_GHC_INFO(info) IS_CODE_PTR(info)
+# ifdef HAVE_WIN32_DLL_SUPPORT
+#  define LOOKS_LIKE_GHC_INFO(info) (!HEAP_ALLOCED(info) && !LOOKS_LIKE_STATIC_CLOSURE(info))
+# else
+#  define LOOKS_LIKE_GHC_INFO(info) IS_CODE_PTR(info)
+# endif
 #endif
 
-#define LOOKS_LIKE_STATIC(r) IS_DATA_PTR(r)
-
 /* -----------------------------------------------------------------------------
    Macros for calculating how big a closure will be (used during allocation)
    -------------------------------------------------------------------------- */
@@ -319,6 +343,6 @@ SET_STATIC_HDR(PrelBase_CZh_closure,PrelBase_CZh_info,costCentreStack,const);
 #define bcoConstChar( bco, i )   (*stgCast(StgChar*,      ((bco)->payload+(bco)->n_ptrs+i)))
 #define bcoConstFloat( bco, i )  (PK_FLT(stgCast(StgWord*,(bco)->payload+(bco)->n_ptrs+i)))
 #define bcoConstDouble( bco, i ) (PK_DBL(stgCast(StgWord*,(bco)->payload+(bco)->n_ptrs+i)))
-#define bcoInstr( bco, i )       (stgCast(StgNat8*,       ((bco)->payload+(bco)->n_ptrs+(bco)->n_words))[i])
+#define bcoInstr( bco, i )       (stgCast(StgWord8*,      ((bco)->payload+(bco)->n_ptrs+(bco)->n_words))[i])
 
 #endif /* CLOSUREMACROS_H */
index c64864e..c56ab94 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: InfoMacros.h,v 1.3 1999/02/05 16:02:22 simonm Exp $
+ * $Id: InfoMacros.h,v 1.4 1999/03/02 19:44:09 sof Exp $
  * 
  * (c) The GHC Team, 1998-1999
  *
@@ -48,7 +48,7 @@ INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_, \
                      prof_descr, prof_type)            \
         entry_class(entry);                             \
        info_class StgInfoTable info = {                \
-               layout : { bitmap : (StgNat32)bitmap_ },\
+               layout : { bitmap : (StgWord32)bitmap_ },\
                SRT_INFO(type,srt_,srt_off_,srt_len_),  \
                 INIT_ENTRY(entry)                       \
        }
@@ -139,7 +139,7 @@ typedef struct {
 
 #define VEC_INFO_TABLE(bitmap_,srt_,srt_off_,srt_len_,type)    \
        i : {                                                   \
-               layout : { bitmap : (StgNat32)bitmap_ },        \
+               layout : { bitmap : (StgWord32)bitmap_ },       \
                SRT_INFO(type,srt_,srt_off_,srt_len_)           \
        }
 
@@ -163,7 +163,7 @@ typedef StgInfoTable StgPolyInfoTable;
 #define VEC_POLY_INFO_TABLE(nm,bitmap_,srt_,srt_off_,srt_len_,type) \
   StgFunPtr nm##_vec[8] = POLY_VEC(nm);                         \
   const StgInfoTable nm##_info = {                                     \
-               layout : { bitmap : (StgNat32)bitmap_ },        \
+               layout : { bitmap : (StgWord32)bitmap_ },       \
                SRT_INFO(type,srt_,srt_off_,srt_len_),          \
                vector : &nm##_vec,                              \
                 INIT_ENTRY(nm##_entry)                          \
@@ -185,7 +185,7 @@ typedef vec_info_8 StgPolyInfoTable;
   const vec_info_8 nm##_info = {                                \
        vec : POLY_VEC(nm),                                     \
        i : {                                                   \
-               layout : { bitmap : (StgNat32)bitmap_ },        \
+               layout : { bitmap : (StgWord32)bitmap_ },       \
                SRT_INFO(type,srt_,srt_off_,srt_len_),          \
                 INIT_ENTRY(nm##_entry)                          \
            }                                                   \
@@ -198,4 +198,16 @@ typedef vec_info_8 StgPolyInfoTable;
 #define BITMAP(lbl,size) \
   static const StgLargeBitmap lbl = { size, {
 
+/* DLL_SRT_ENTRY is used on the Win32 side when filling initialising
+   an entry in an SRT table with a reference to a closure that's
+   living in a DLL. See elsewhere for reasons as to why we need
+   to distinguish these kinds of references.
+   (ToDo: fill in a more precise href.)
+*/
+#ifdef HAVE_WIN32_DLL_SUPPORT
+#define DLL_SRT_ENTRY(x) ((StgClosure*)(((char*)&DLL_IMPORT_DATA_VAR(x)) + 1))
+#else
+#define DLL_SRT_ENTRY(x) no-can-do
+#endif
+
 #endif /* INFOMACROS_H */
index 5dd8a67..e99dabb 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: InfoTables.h,v 1.11 1999/02/15 12:12:55 simonm Exp $
+ * $Id: InfoTables.h,v 1.12 1999/03/02 19:44:10 sof Exp $
  * 
  * (c) The GHC Team, 1998-1999
  *
@@ -273,21 +273,21 @@ typedef struct {
  */
 
 typedef union {
-
-  StgWord bitmap;              /* bit pattern, 1 = pointer, 0 = non-pointer */
-  StgWord selector_offset;     /* used in THUNK_SELECTORs */
-  StgLargeBitmap* large_bitmap;        /* pointer to large bitmap structure */
-
 #if SIZEOF_VOID_P == 8
   struct {
-    StgNat32 ptrs;             /* number of pointers     */
-    StgNat32 nptrs;            /* number of non-pointers */
+    StgWord32 ptrs;            /* number of pointers     */
+    StgWord32 nptrs;           /* number of non-pointers */
   } payload;
 #else
   struct {
-    StgNat16 ptrs;             /* number of pointers     */
-    StgNat16 nptrs;            /* number of non-pointers */
+    StgWord16 ptrs;            /* number of pointers     */
+    StgWord16 nptrs;           /* number of non-pointers */
   } payload;
+
+  StgWord bitmap;              /* bit pattern, 1 = pointer, 0 = non-pointer */
+  StgWord selector_offset;     /* used in THUNK_SELECTORs */
+  StgLargeBitmap* large_bitmap;        /* pointer to large bitmap structure */
+
 #endif
   
 } StgClosureInfo;
@@ -314,13 +314,13 @@ typedef struct _StgInfoTable {
 #endif
     StgClosureInfo  layout;    /* closure layout info (pointer-sized) */
 #if SIZEOF_VOID_P == 8
-    StgNat16        flags;     /* }                                   */
+    StgWord16       flags;     /* }                                   */
     StgClosureType  type : 16; /* } These 4 elements fit into 64 bits */
-    StgNat32        srt_len;    /* }                                   */
+    StgWord32       srt_len;    /* }                                   */
 #else
-    StgNat8         flags;     /* }                                   */
+    StgWord8        flags;     /* }                                   */
     StgClosureType  type : 8;  /* } These 4 elements fit into 32 bits */
-    StgNat16        srt_len;    /* }                                   */
+    StgWord16       srt_len;    /* }                                   */
 #endif
 #if USE_MINIINTERPRETER
     StgFunPtr       (*vector)[];
index a66c54b..f6d38a4 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Prelude.h,v 1.5 1999/02/05 16:02:24 simonm Exp $
+ * $Id: Prelude.h,v 1.6 1999/03/02 19:44:11 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
 #ifndef PRELUDE_H
 #define PRELUDE_H
 
+#ifdef COMPILING_RTS
+
 #ifdef COMPILER
-extern const StgClosure PrelBase_Z91Z93_static_closure;
-extern const StgClosure PrelBase_Z40Z41_static_closure;
-extern const StgClosure PrelBase_True_static_closure;
-extern const StgClosure PrelBase_False_static_closure;
+extern DLL_IMPORT const StgClosure PrelBase_Z91Z93_static_closure;
+extern DLL_IMPORT const StgClosure PrelBase_Z40Z41_static_closure;
+extern DLL_IMPORT const StgClosure PrelBase_True_static_closure;
+extern DLL_IMPORT const StgClosure PrelBase_False_static_closure;
+extern DLL_IMPORT const StgClosure PrelPack_unpackCString_closure;
 extern const StgClosure PrelMain_mainIO_closure;
-extern const StgClosure PrelPack_unpackCString_closure;
 
-extern const StgInfoTable PrelBase_Czh_static_info;
-extern const StgInfoTable PrelBase_Izh_static_info;
-extern const StgInfoTable PrelBase_Fzh_static_info;
-extern const StgInfoTable PrelBase_Dzh_static_info;
-extern const StgInfoTable PrelAddr_Azh_static_info;
-extern const StgInfoTable PrelAddr_Wzh_static_info;
-extern const StgInfoTable PrelBase_Czh_con_info;
-extern const StgInfoTable PrelBase_Izh_con_info;
-extern const StgInfoTable PrelBase_Fzh_con_info;
-extern const StgInfoTable PrelBase_Dzh_con_info;
-extern const StgInfoTable PrelAddr_Azh_con_info;
-extern const StgInfoTable PrelAddr_Wzh_con_info;
-extern const StgInfoTable PrelAddr_I64zh_con_info;
-extern const StgInfoTable PrelAddr_W64zh_con_info;
-extern const StgInfoTable PrelStable_StablePtr_static_info;
-extern const StgInfoTable PrelStable_StablePtr_con_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Czh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Izh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Fzh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Dzh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_static_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Czh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Izh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Fzh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelBase_Dzh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_I64zh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelAddr_W64zh_con_info;
+extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_static_info;
+extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_con_info;
 
 /* Define canonical names so we can abstract away from the actual
  * module these names are defined in.
@@ -88,4 +90,6 @@ extern const StgInfoTable StablePtr_static_info;
 
 #endif
 
+#endif
+
 #endif /* PRELUDE_H */
index 8ca1869..81857af 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.21 1999/03/01 10:25:20 simonm Exp $
+ * $Id: PrimOps.h,v 1.22 1999/03/02 19:44:12 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -59,7 +59,7 @@
 #define zlzezhzh(r,a,b)        r=(I_)((a)<=(b))
 
 /*  used by returning comparison primops, defined in Prims.hc. */
-extern const StgClosure *PrelBase_Bool_closure_tbl[];
+extern DLL_IMPORT_RTS const StgClosure *PrelBase_Bool_closure_tbl[];
 
 /* -----------------------------------------------------------------------------
    Char# PrimOps.
@@ -380,7 +380,7 @@ EF_(decodeDoublezh_fast);
 #define integerToWord64zh(r, sa,da)                            \
 { unsigned long int* d;                                                \
   I_ aa;                                                       \
-  StgNat64 res;                                                        \
+  StgWord64 res;                                               \
                                                                \
   d            = (unsigned long int *) (BYTE_ARR_CTS(da));     \
   aa = ((StgArrWords *)da)->words;                             \
@@ -420,12 +420,12 @@ EF_(word64ToIntegerzh_fast);
 
 /* The rest are (way!) out of line, implemented via C entry points.
  */
-I_ stg_gtWord64 (StgNat64, StgNat64);
-I_ stg_geWord64 (StgNat64, StgNat64);
-I_ stg_eqWord64 (StgNat64, StgNat64);
-I_ stg_neWord64 (StgNat64, StgNat64);
-I_ stg_ltWord64 (StgNat64, StgNat64);
-I_ stg_leWord64 (StgNat64, StgNat64);
+I_ stg_gtWord64 (StgWord64, StgWord64);
+I_ stg_geWord64 (StgWord64, StgWord64);
+I_ stg_eqWord64 (StgWord64, StgWord64);
+I_ stg_neWord64 (StgWord64, StgWord64);
+I_ stg_ltWord64 (StgWord64, StgWord64);
+I_ stg_leWord64 (StgWord64, StgWord64);
 
 I_ stg_gtInt64 (StgInt64, StgInt64);
 I_ stg_geInt64 (StgInt64, StgInt64);
@@ -434,8 +434,8 @@ I_ stg_neInt64 (StgInt64, StgInt64);
 I_ stg_ltInt64 (StgInt64, StgInt64);
 I_ stg_leInt64 (StgInt64, StgInt64);
 
-LW_ stg_remWord64  (StgNat64, StgNat64);
-LW_ stg_quotWord64 (StgNat64, StgNat64);
+LW_ stg_remWord64  (StgWord64, StgWord64);
+LW_ stg_quotWord64 (StgWord64, StgWord64);
 
 LI_ stg_remInt64    (StgInt64, StgInt64);
 LI_ stg_quotInt64   (StgInt64, StgInt64);
@@ -444,13 +444,13 @@ LI_ stg_plusInt64   (StgInt64, StgInt64);
 LI_ stg_minusInt64  (StgInt64, StgInt64);
 LI_ stg_timesInt64  (StgInt64, StgInt64);
 
-LW_ stg_and64  (StgNat64, StgNat64);
-LW_ stg_or64   (StgNat64, StgNat64);
-LW_ stg_xor64  (StgNat64, StgNat64);
-LW_ stg_not64  (StgNat64);
+LW_ stg_and64  (StgWord64, StgWord64);
+LW_ stg_or64   (StgWord64, StgWord64);
+LW_ stg_xor64  (StgWord64, StgWord64);
+LW_ stg_not64  (StgWord64);
 
-LW_ stg_shiftL64   (StgNat64, StgInt);
-LW_ stg_shiftRL64  (StgNat64, StgInt);
+LW_ stg_shiftL64   (StgWord64, StgInt);
+LW_ stg_shiftRL64  (StgWord64, StgInt);
 LI_ stg_iShiftL64  (StgInt64, StgInt);
 LI_ stg_iShiftRL64 (StgInt64, StgInt);
 LI_ stg_iShiftRA64 (StgInt64, StgInt);
@@ -460,8 +460,8 @@ I_ stg_int64ToInt     (StgInt64);
 LW_ stg_int64ToWord64 (StgInt64);
 
 LW_ stg_wordToWord64  (StgWord);
-W_  stg_word64ToWord  (StgNat64);
-LI_ stg_word64ToInt64 (StgNat64);
+W_  stg_word64ToWord  (StgWord64);
+LI_ stg_word64ToInt64 (StgWord64);
 #endif
 
 /* -----------------------------------------------------------------------------
index e1b59ff..df44cc9 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Regs.h,v 1.3 1999/02/05 16:02:26 simonm Exp $
+ * $Id: Regs.h,v 1.4 1999/03/02 19:44:14 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -42,7 +42,7 @@ typedef struct {
   StgFloat       rF4;
   StgDouble      rD1;
   StgDouble      rD2;
-  StgNat64        rL1;
+  StgWord64       rL1;
   StgPtr         rSp;
   StgUpdateFrame *rSu;
   StgPtr         rSpLim;
@@ -50,7 +50,7 @@ typedef struct {
   StgPtr         rHpLim;
 } StgRegTable;
 
-extern StgRegTable  MainRegTable;
+extern DLL_IMPORT_RTS StgRegTable  MainRegTable;
 
 /*
  * Registers Hp and HpLim are global across the entire system, and are
@@ -226,7 +226,7 @@ GLOBAL_REG_DECL(StgDouble,D2,REG_D2)
 #endif
 
 #ifdef REG_L1
-GLOBAL_REG_DECL(StgNat64,L1,REG_L1)
+GLOBAL_REG_DECL(StgWord64,L1,REG_L1)
 #else
 #define L1 (BaseReg->rL1)
 #endif
index cc6f7e7..c9c24f9 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.h,v 1.3 1999/02/05 16:02:27 simonm Exp $
+ * $Id: RtsAPI.h,v 1.4 1999/03/02 19:44:15 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -48,7 +48,9 @@ HaskellObj   rts_apply        ( HaskellObj, HaskellObj );
    ------------------------------------------------------------------------- */
 char         rts_getChar      ( HaskellObj );
 int          rts_getInt       ( HaskellObj );
+int          rts_getInt32     ( HaskellObj );
 unsigned int rts_getWord      ( HaskellObj );
+unsigned int rts_getWord32    ( HaskellObj );
 float        rts_getFloat     ( HaskellObj );
 double       rts_getDouble    ( HaskellObj );
 StgStablePtr rts_getStablePtr ( HaskellObj );
index 70c4674..960ac27 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stable.h,v 1.3 1999/02/26 12:46:45 simonm Exp $
+ * $Id: Stable.h,v 1.4 1999/03/02 19:44:16 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -27,10 +27,10 @@ typedef struct {
   StgClosure *sn_obj;          /* the StableName object (or NULL) */
 } snEntry;
 
-extern snEntry *stable_ptr_table;
-extern snEntry *stable_ptr_free;
+extern DLL_IMPORT_RTS snEntry *stable_ptr_table;
+extern DLL_IMPORT_RTS snEntry *stable_ptr_free;
 
-extern unsigned int SPT_size;
+extern DLL_IMPORT_RTS unsigned int SPT_size;
 
 extern inline StgPtr
 deRefStablePtr(StgStablePtr sp)
index f38eba4..e0c42ee 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stg.h,v 1.6 1999/02/05 16:02:28 simonm Exp $
+ * $Id: Stg.h,v 1.7 1999/03/02 19:44:17 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
 #define COMPILER 1
 #endif
 
+/* This is a feature test - doesn't belong here. FixMe. */
+#ifdef __MINGW32__
+#define HAVE_WIN32_DLL_SUPPORT
+#endif
+
+#ifdef HAVE_WIN32_DLL_SUPPORT
+# if __GNUC__ && !defined(__declspec)
+#  define DLLIMPORT
+# else
+#  define DLLIMPORT __declspec(dllimport)
+#  define DLLIMPORT_DATA(x) _imp__##x
+# endif
+#else
+# define DLLIMPORT
+#endif
+
+#ifdef COMPILING_RTS
+#define DLL_IMPORT DLLIMPORT
+#define DLL_IMPORT_RTS
+#define DLL_IMPORT_DATA
+#define DLL_IMPORT_DATA_VAR(x) x
+#else
+#define DLL_IMPORT
+#define DLL_IMPORT_RTS DLLIMPORT
+#define DLL_IMPORT_DATA DLLIMPORT
+#define DLL_IMPORT_DATA_VAR(x) _imp__##x
+#endif
+
 /* bit macros
  */
 #define BITS_PER_BYTE 8
@@ -129,8 +157,13 @@ void _stgAssert (char *, unsigned int);
 #include "Hooks.h"
 
 /* Misc stuff without a home */
+#ifdef BUILDING_RTS_DLL
+extern DLLIMPORT char **prog_argv;     /* so we can get at these from Haskell */
+extern DLLIMPORT int    prog_argc;
+#else
 extern char **prog_argv;       /* so we can get at these from Haskell */
 extern int    prog_argc;
+#endif
 
 extern char **environ;
 
index a3ca202..3687a80 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.6 1999/02/26 09:28:43 simonm Exp $
+ * $Id: StgMacros.h,v 1.7 1999/03/02 19:44:18 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
   --------------------------------------------------------------------------- */
 
 #define STGFUN(f)       StgFunPtr f(void)
-#define STATICFUN(f)    static StgFunPtr f(void)
 #define EXTFUN(f)      extern StgFunPtr f(void)
+#define EXTFUN_RTS(f)  extern DLL_IMPORT_RTS StgFunPtr f(void)
 #define FN_(f)         F_ f(void)
 #define IFN_(f)                static F_ f(void)
 #define IF_(f)         static F_ f(void)
 #define EF_(f)         extern F_ f(void)
+#define EDF_(f)                extern DLLIMPORT F_ f(void)
 
 #define ED_            extern
+#define EDD_           extern DLLIMPORT 
 #define ED_RO_         extern const
 #define ID_            extern
 #define ID_RO_         extern const
 #define EI_             extern const StgInfoTable
+#define EDI_            extern DLLIMPORT const StgInfoTable
 #define II_             extern const StgInfoTable
 #define EC_            extern StgClosure
+#define EDC_           extern DLLIMPORT StgClosure
 #define IC_            extern StgClosure
 
 /* -----------------------------------------------------------------------------
@@ -121,7 +125,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 /* -----------------------------------------------------------------------------
    Argument checks.
    
-   If (Sp + <n_args>) > Su { JMP_(stg_updatePAP); }
+   If (Sp + <n_args>) > Su { JMP_(stg_update_PAP); }
    
    Sp points to the topmost used word on the stack, and Su points to
    the most recently pushed update frame.
@@ -160,7 +164,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define STK_CHK(headroom,ret,r,layout,tag_assts)               \
        if (Sp - headroom < SpLim) {                            \
-           EXTFUN(stg_chk_##layout);                           \
+           EXTFUN_RTS(stg_chk_##layout);                       \
            tag_assts                                           \
            (r) = (P_)ret;                                      \
            JMP_(stg_chk_##layout);                             \
@@ -168,7 +172,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
        
 #define HP_CHK(headroom,ret,r,layout,tag_assts)                        \
        if ((Hp += headroom) > HpLim) {                         \
-           EXTFUN(stg_chk_##layout);                           \
+           EXTFUN_RTS(stg_chk_##layout);                       \
            tag_assts                                           \
            (r) = (P_)ret;                                      \
            JMP_(stg_chk_##layout);                             \
@@ -177,7 +181,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define HP_STK_CHK(stk_headroom,hp_headroom,ret,r,layout,tag_assts) \
        if (Sp - stk_headroom < SpLim || (Hp += hp_headroom) > HpLim) { \
-           EXTFUN(stg_chk_##layout);                           \
+           EXTFUN_RTS(stg_chk_##layout);                       \
            tag_assts                                           \
            (r) = (P_)ret;                                      \
            JMP_(stg_chk_##layout);                             \
@@ -201,14 +205,14 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define STK_CHK_NP(headroom,ptrs,tag_assts)                    \
        if ((Sp - (headroom)) < SpLim) {                        \
-           EXTFUN(stg_gc_enter_##ptrs);                        \
+           EXTFUN_RTS(stg_gc_enter_##ptrs);                    \
             tag_assts                                          \
            JMP_(stg_gc_enter_##ptrs);                          \
        }
 
 #define HP_CHK_NP(headroom,ptrs,tag_assts)                     \
        if ((Hp += (headroom)) > HpLim) {                       \
-           EXTFUN(stg_gc_enter_##ptrs);                        \
+           EXTFUN_RTS(stg_gc_enter_##ptrs);                    \
             tag_assts                                          \
            JMP_(stg_gc_enter_##ptrs);                          \
        }                                                       \
@@ -216,7 +220,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define HP_CHK_SEQ_NP(headroom,ptrs,tag_assts)                 \
        if ((Hp += (headroom)) > HpLim) {                       \
-           EXTFUN(stg_gc_seq_##ptrs);                          \
+           EXTFUN_RTS(stg_gc_seq_##ptrs);                      \
             tag_assts                                          \
            JMP_(stg_gc_seq_##ptrs);                            \
        }                                                       \
@@ -224,7 +228,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define HP_STK_CHK_NP(stk_headroom, hp_headroom, ptrs, tag_assts) \
        if ((Sp - (stk_headroom)) < SpLim || (Hp += (hp_headroom)) > HpLim) { \
-           EXTFUN(stg_gc_enter_##ptrs);                        \
+           EXTFUN_RTS(stg_gc_enter_##ptrs);                    \
             tag_assts                                          \
            JMP_(stg_gc_enter_##ptrs);                          \
        }                                                       \
@@ -234,7 +238,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define GEN_HP_CHK_ALT(headroom,lbl,tag_assts)                 \
        if ((Hp += (headroom)) > HpLim) {                       \
-           EXTFUN(lbl);                                        \
+           EXTFUN_RTS(lbl);                                    \
             tag_assts                                          \
            JMP_(lbl);                                          \
        }                                                       \
@@ -349,9 +353,11 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
    out to be slowing us down we can make specialised ones.
    -------------------------------------------------------------------------- */
 
+EF_(stg_gen_yield);
+EF_(stg_gen_block);
+
 #define YIELD(liveness,reentry)                        \
   {                                            \
-   EF_(stg_gen_yield);                         \
    R9.w  = (W_)LIVENESS_MASK(liveness);                \
    R10.w = (W_)reentry;                                \
    JMP_(stg_gen_yield);                                \
@@ -359,7 +365,6 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define BLOCK(liveness,reentry)                        \
   {                                            \
-   EF_(stg_gen_block);                         \
    R9.w  = (W_)LIVENESS_MASK(liveness);                \
    R10.w = (W_)reentry;                                \
    JMP_(stg_gen_block);                                \
@@ -367,7 +372,7 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
 
 #define BLOCK_NP(ptrs)                         \
   {                                            \
-    EF_(stg_bock_##ptrs);                      \
+    EF_(stg_block_##ptrs);                     \
     JMP_(stg_block_##ptrs);                    \
   }
 
@@ -378,8 +383,11 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
    We use a RET_DYN frame the same as for a dynamic heap check.
    ------------------------------------------------------------------------- */
 
+#if COMPILING_RTS
 EI_(stg_gen_chk_info);
-
+#else
+EDI_(stg_gen_chk_info);
+#endif
 /* -----------------------------------------------------------------------------
    Vectored Returns
 
@@ -530,11 +538,11 @@ typedef union
   } int64_thing;
 
 typedef union
-  { StgNat64 w;
+  { StgWord64 w;
     unpacked_double_word wu;
   } word64_thing;
 
-static inline void ASSIGN_Word64(W_ p_dest[], StgNat64 src)
+static inline void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
 {
     word64_thing y;
     y.w = src;
@@ -542,7 +550,7 @@ static inline void ASSIGN_Word64(W_ p_dest[], StgNat64 src)
     p_dest[1] = y.wu.dlo;
 }
 
-static inline StgNat64 PK_Word64(W_ p_src[])
+static inline StgWord64 PK_Word64(W_ p_src[])
 {
     word64_thing y;
     y.wu.dhi = p_src[0];
@@ -571,7 +579,7 @@ static inline StgInt64 PK_Int64(W_ p_src[])
    Catch frames
    -------------------------------------------------------------------------- */
 
-extern const StgPolyInfoTable catch_frame_info;
+extern DLL_IMPORT_DATA const StgPolyInfoTable catch_frame_info;
 
 /* -----------------------------------------------------------------------------
    Seq frames
@@ -580,7 +588,7 @@ extern const StgPolyInfoTable catch_frame_info;
    an update...
    -------------------------------------------------------------------------- */
 
-extern const StgPolyInfoTable seq_frame_info;
+extern DLL_IMPORT_DATA const StgPolyInfoTable seq_frame_info;
 
 #define PUSH_SEQ_FRAME(sp)                                     \
        {                                                       \
@@ -642,7 +650,7 @@ static __inline__ void
 LoadThreadState (void)
 {
 #ifdef REG_Base
-  BaseReg = &MainRegTable;
+  BaseReg = (StgRegTable*)&MainRegTable;
 #endif
 
   Sp    = CurrentTSO->sp;
index 8695118..daddd28 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.h,v 1.10 1999/02/11 17:40:23 simonm Exp $
+ * $Id: StgMiscClosures.h,v 1.11 1999/03/02 19:44:20 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -45,36 +45,36 @@ STGFUN(dummy_ret_entry);
 
 /* info tables */
 
-extern const StgInfoTable IND_info;
-extern const StgInfoTable IND_STATIC_info;
-extern const StgInfoTable IND_PERM_info;
-extern const StgInfoTable IND_OLDGEN_info;
-extern const StgInfoTable IND_OLDGEN_PERM_info;
-extern const StgInfoTable CAF_UNENTERED_info;
-extern const StgInfoTable CAF_ENTERED_info;
-extern const StgInfoTable CAF_BLACKHOLE_info;
-extern const StgInfoTable BLACKHOLE_info;
-extern const StgInfoTable BLACKHOLE_BQ_info;
-extern const StgInfoTable BCO_info;
-extern const StgInfoTable EVACUATED_info;
-extern const StgInfoTable FOREIGN_info;
-extern const StgInfoTable WEAK_info;
-extern const StgInfoTable DEAD_WEAK_info;
-extern const StgInfoTable NO_FINALIZER_info;
-extern const StgInfoTable STABLE_NAME_info;
-extern const StgInfoTable FULL_MVAR_info;
-extern const StgInfoTable EMPTY_MVAR_info;
-extern const StgInfoTable TSO_info;
-extern const StgInfoTable ARR_WORDS_info;
-extern const StgInfoTable MUT_ARR_PTRS_info;
-extern const StgInfoTable MUT_ARR_PTRS_FROZEN_info;
-extern const StgInfoTable MUT_VAR_info;
-extern const StgInfoTable END_TSO_QUEUE_info;
-extern const StgInfoTable MUT_CONS_info;
-extern const StgInfoTable END_MUT_LIST_info;
-extern const StgInfoTable catch_info;
-extern const StgInfoTable seq_info;
-extern const StgInfoTable dummy_ret_info;
+extern DLL_IMPORT_RTS const StgInfoTable IND_info;
+extern DLL_IMPORT_RTS const StgInfoTable IND_STATIC_info;
+extern DLL_IMPORT_RTS const StgInfoTable IND_PERM_info;
+extern DLL_IMPORT_RTS const StgInfoTable IND_OLDGEN_info;
+extern DLL_IMPORT_RTS const StgInfoTable IND_OLDGEN_PERM_info;
+extern DLL_IMPORT_RTS const StgInfoTable CAF_UNENTERED_info;
+extern DLL_IMPORT_RTS const StgInfoTable CAF_ENTERED_info;
+extern DLL_IMPORT_RTS const StgInfoTable CAF_BLACKHOLE_info;
+extern DLL_IMPORT_RTS const StgInfoTable BLACKHOLE_info;
+extern DLL_IMPORT_RTS const StgInfoTable BLACKHOLE_BQ_info;
+extern DLL_IMPORT_RTS const StgInfoTable BCO_info;
+extern DLL_IMPORT_RTS const StgInfoTable EVACUATED_info;
+extern DLL_IMPORT_RTS const StgInfoTable FOREIGN_info;
+extern DLL_IMPORT_RTS const StgInfoTable WEAK_info;
+extern DLL_IMPORT_RTS const StgInfoTable DEAD_WEAK_info;
+extern DLL_IMPORT_RTS const StgInfoTable STABLE_NAME_info;
+extern DLL_IMPORT_RTS const StgInfoTable FULL_MVAR_info;
+extern DLL_IMPORT_RTS const StgInfoTable EMPTY_MVAR_info;
+extern DLL_IMPORT_RTS const StgInfoTable TSO_info;
+extern DLL_IMPORT_RTS const StgInfoTable ARR_WORDS_info;
+extern DLL_IMPORT_RTS const StgInfoTable MUT_ARR_WORDS_info;
+extern DLL_IMPORT_RTS const StgInfoTable MUT_ARR_PTRS_info;
+extern DLL_IMPORT_RTS const StgInfoTable MUT_ARR_PTRS_FROZEN_info;
+extern DLL_IMPORT_RTS const StgInfoTable MUT_VAR_info;
+extern DLL_IMPORT_RTS const StgInfoTable END_TSO_QUEUE_info;
+extern DLL_IMPORT_RTS const StgInfoTable MUT_CONS_info;
+extern DLL_IMPORT_RTS const StgInfoTable END_MUT_LIST_info;
+extern DLL_IMPORT_RTS const StgInfoTable catch_info;
+extern DLL_IMPORT_RTS const StgInfoTable seq_info;
+extern DLL_IMPORT_RTS const StgInfoTable dummy_ret_info;
 
 #ifdef INTERPRETER
 
@@ -85,13 +85,13 @@ extern const StgInfoTable ret_bco_info;
 
 /* closures */
 
-extern StgClosure END_TSO_QUEUE_closure;
-extern StgClosure END_MUT_LIST_closure;
-extern StgClosure NO_FINALIZER_closure;
-extern StgClosure dummy_ret_closure;
+extern DLL_IMPORT_DATA StgClosure END_TSO_QUEUE_closure;
+extern DLL_IMPORT_DATA StgClosure END_MUT_LIST_closure;
+extern DLL_IMPORT_DATA StgClosure NO_FINALIZER_closure;
+extern DLL_IMPORT_DATA StgClosure dummy_ret_closure;
 
-extern StgIntCharlikeClosure CHARLIKE_closure[];
-extern StgIntCharlikeClosure INTLIKE_closure[];
+extern DLL_IMPORT_DATA StgIntCharlikeClosure CHARLIKE_closure[];
+extern DLL_IMPORT_DATA StgIntCharlikeClosure INTLIKE_closure[];
 
 /* standard entry points */
 
@@ -99,49 +99,55 @@ extern StgFun stg_error_entry;
 
 /* standard selector thunks */
 
-EI_ __sel_0_upd_info;
-EI_ __sel_1_upd_info;
-EI_ __sel_2_upd_info;
-EI_ __sel_3_upd_info;
-EI_ __sel_4_upd_info;
-EI_ __sel_5_upd_info;
-EI_ __sel_6_upd_info;
-EI_ __sel_7_upd_info;
-EI_ __sel_8_upd_info;
-EI_ __sel_8_upd_info;
-EI_ __sel_9_upd_info;
-EI_ __sel_10_upd_info;
-EI_ __sel_11_upd_info;
-EI_ __sel_12_upd_info;
-EI_ __sel_13_upd_info;
-EI_ __sel_14_upd_info;
-EI_ __sel_15_upd_info;
-
-EI_ __sel_0_noupd_info;
-EI_ __sel_1_noupd_info;
-EI_ __sel_2_noupd_info;
-EI_ __sel_3_noupd_info;
-EI_ __sel_4_noupd_info;
-EI_ __sel_5_noupd_info;
-EI_ __sel_6_noupd_info;
-EI_ __sel_7_noupd_info;
-EI_ __sel_8_noupd_info;
-EI_ __sel_9_noupd_info;
-EI_ __sel_10_noupd_info;
-EI_ __sel_11_noupd_info;
-EI_ __sel_12_noupd_info;
-EI_ __sel_13_noupd_info;
-EI_ __sel_14_noupd_info;
-EI_ __sel_15_noupd_info;
+#ifdef COMPILING_RTS
+#define EI__ EI_
+#else
+#define EI__ EDI_
+#endif
+
+EI__ __sel_0_upd_info;
+EI__ __sel_1_upd_info;
+EI__ __sel_2_upd_info;
+EI__ __sel_3_upd_info;
+EI__ __sel_4_upd_info;
+EI__ __sel_5_upd_info;
+EI__ __sel_6_upd_info;
+EI__ __sel_7_upd_info;
+EI__ __sel_8_upd_info;
+EI__ __sel_8_upd_info;
+EI__ __sel_9_upd_info;
+EI__ __sel_10_upd_info;
+EI__ __sel_11_upd_info;
+EI__ __sel_12_upd_info;
+EI__ __sel_13_upd_info;
+EI__ __sel_14_upd_info;
+EI__ __sel_15_upd_info;
+
+EI__ __sel_0_noupd_info;
+EI__ __sel_1_noupd_info;
+EI__ __sel_2_noupd_info;
+EI__ __sel_3_noupd_info;
+EI__ __sel_4_noupd_info;
+EI__ __sel_5_noupd_info;
+EI__ __sel_6_noupd_info;
+EI__ __sel_7_noupd_info;
+EI__ __sel_8_noupd_info;
+EI__ __sel_9_noupd_info;
+EI__ __sel_10_noupd_info;
+EI__ __sel_11_noupd_info;
+EI__ __sel_12_noupd_info;
+EI__ __sel_13_noupd_info;
+EI__ __sel_14_noupd_info;
+EI__ __sel_15_noupd_info;
 
 /* standard ap thunks */
 
-EI_ __ap_1_upd_info;
-EI_ __ap_2_upd_info;
-EI_ __ap_3_upd_info;
-EI_ __ap_4_upd_info;
-EI_ __ap_5_upd_info;
-EI_ __ap_6_upd_info;
-EI_ __ap_7_upd_info;
-EI_ __ap_8_upd_info;
+EI__ __ap_1_upd_info;
+EI__ __ap_2_upd_info;
+EI__ __ap_3_upd_info;
+EI__ __ap_4_upd_info;
+EI__ __ap_5_upd_info;
+EI__ __ap_6_upd_info;
+EI__ __ap_7_upd_info;
+EI__ __ap_8_upd_info;
 
index c01f68b..6b1237e 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgStorage.h,v 1.3 1999/02/05 16:02:29 simonm Exp $
+ * $Id: StgStorage.h,v 1.4 1999/03/02 19:44:21 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -12,7 +12,7 @@
 
 #include "Block.h"
 
-extern bdescr *current_nursery;
+extern DLL_IMPORT_RTS bdescr *current_nursery;
 
 /* -----------------------------------------------------------------------------
    Allocation area for compiled code
index 91f13b0..3470d70 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.4 1999/02/05 16:02:30 simonm Exp $
+ * $Id: StgTypes.h,v 1.5 1999/03/02 19:44:21 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -7,8 +7,8 @@
 
  * Specifically:
 
-       StgInt8, 16, 32, 64
-       StgNat8, 16, 32, 64
+       StgInt8,  16, 32, 64
+       StgWord8, 16, 32, 64
        StgChar, StgFloat, StgDouble
 
        ***** All the same size: *****
  */
 
 typedef signed   char            StgInt8;
-typedef unsigned char            StgNat8;
+typedef unsigned char            StgWord8;
 
 typedef signed   short           StgInt16;
-typedef unsigned short           StgNat16;
+typedef unsigned short           StgWord16;
 
 
 #if SIZEOF_UNSIGNED_INT == 4
 typedef signed   int             StgInt32;
-typedef unsigned int             StgNat32;
+typedef unsigned int             StgWord32;
 #else
 #error GHC untested on this architecture: sizeof(unisgned int) != 4
 #endif
@@ -55,11 +55,11 @@ typedef unsigned int             StgNat32;
 
 #ifdef SUPPORT_LONG_LONGS
 /* assume long long is 64 bits */
-typedef unsigned long long int StgNat64;
+typedef unsigned long long int StgWord64;
 typedef signed long long int   StgInt64;
 #elif SIZEOF_LONG == 8
 typedef signed   long          StgInt64;
-typedef unsigned long          StgNat64;
+typedef unsigned long          StgWord64;
 #else
 #error GHC untested on this architecture: sizeof(void *) < 8 and no long longs.
 #endif
@@ -72,11 +72,11 @@ typedef unsigned long          StgNat64;
 
 #if SIZEOF_VOID_P == 8
 typedef StgInt64           StgInt;
-typedef StgNat64           StgWord;
+typedef StgWord64          StgWord;
 #else
 #if SIZEOF_VOID_P == 4
 typedef StgInt32           StgInt; 
-typedef StgNat32           StgWord;
+typedef StgWord32          StgWord;
 #else
 #error GHC untested on this architecture: sizeof(void *) != 4 or 8
 #endif
@@ -88,7 +88,7 @@ typedef void*              StgAddr;
  * Other commonly-used STG datatypes.
  */
 
-typedef StgNat8            StgChar;
+typedef StgWord8           StgChar;
 
 /*
  * If a double fits in an StgWord, don't bother using floats.
@@ -117,14 +117,14 @@ typedef StgInt             StgStackOffset;   /* offset in words! */
 
 typedef StgWord*           StgStackPtr;
 
-typedef StgNat8           StgCode;         /* close enough */
+typedef StgWord8          StgCode;         /* close enough */
 typedef StgCode*          StgCodePtr;  
 
 typedef StgPtr*            StgArray;        /* the goods of an Array# */
 typedef char*             StgByteArray;    /* the goods of a ByteArray# */
 
 typedef StgInt64              LI_;
-typedef StgNat64              LW_;
+typedef StgWord64             LW_;
 
 /* Stable Pointers:  A stable pointer is represented as an index into
  * the stable pointer table in the low 24 bits with a weight in the
index f22cbe5..d898bc7 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.4 1999/02/05 16:02:30 simonm Exp $
+ * $Id: TSO.h,v 1.5 1999/03/02 19:44:22 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -53,8 +53,9 @@ typedef enum {
  * having to worry about overflow.  A little calculation shows that
  * even doing 10^6 forks per second would take 35 million years to
  * overflow a 64 bit thread ID :-)
+ *
  */
-typedef StgNat32 StgThreadID;
+typedef StgWord32 StgThreadID;
 
 /*
  * This type is returned to the scheduler by a thread that has
@@ -98,7 +99,7 @@ typedef struct StgTSO_ {
   StgWord            stack[0];
 } StgTSO;
 
-extern StgTSO      *CurrentTSO;
+extern DLL_IMPORT_RTS StgTSO      *CurrentTSO;
 
 
 /* Workaround for a bug/quirk in gcc on certain architectures.
index ebcebf1..12a48f4 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Updates.h,v 1.7 1999/02/05 16:02:31 simonm Exp $
+ * $Id: Updates.h,v 1.8 1999/03/02 19:44:23 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -56,7 +56,7 @@ extern void awaken_blocked_queue(StgTSO *q);
 #define PUSH_STD_CCCS(frame)
 #endif
 
-extern const StgPolyInfoTable Upd_frame_info; 
+extern DLL_IMPORT_DATA const StgPolyInfoTable Upd_frame_info; 
 
 #define PUSH_UPD_FRAME(target, Sp_offset)                      \
        {                                                       \
@@ -98,7 +98,7 @@ extern void newCAF(StgClosure*);
 
 #define UPD_CAF(cafptr, bhptr)                                 \
   {                                                            \
-    SET_INFO((StgInd *)cafptr,&IND_STATIC_info);               \
+    SET_INFO((StgInd *)cafptr,(const StgInfoTable*)&IND_STATIC_info);          \
     ((StgInd *)cafptr)->indirectee   = (StgClosure *)(bhptr);  \
     STGCALL1(newCAF,(StgClosure *)cafptr);                     \
   }
@@ -107,16 +107,16 @@ extern void newCAF(StgClosure*);
    Update-related prototypes
    -------------------------------------------------------------------------- */
 
-extern STGFUN(Upd_frame_entry);
+DLL_IMPORT_RTS extern STGFUN(Upd_frame_entry);
 
-extern const StgInfoTable PAP_info;
-STGFUN(PAP_entry);
+extern DLL_IMPORT_DATA const StgInfoTable PAP_info;
+DLL_IMPORT_RTS STGFUN(PAP_entry);
 
-EXTFUN(stg_update_PAP);
+EXTFUN_RTS(stg_update_PAP);
 
-extern const StgInfoTable AP_UPD_info;
-STGFUN(AP_UPD_entry);
+extern DLL_IMPORT_DATA const StgInfoTable AP_UPD_info;
+DLL_IMPORT_RTS STGFUN(AP_UPD_entry);
 
-extern const StgInfoTable raise_info;
+extern DLL_IMPORT_DATA const StgInfoTable raise_info;
 
 #endif /* UPDATES_H */