/* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.32 2000/08/02 14:13:27 rrt Exp $
+ * $Id: StgMacros.h,v 1.33 2000/08/15 14:18:43 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
tso = CurrentTSO;
tso->sp = Sp;
tso->su = Su;
- tso->splim = SpLim;
CloseNursery(Hp);
#ifdef REG_CurrentTSO
tso = CurrentTSO;
Sp = tso->sp;
Su = tso->su;
- SpLim = tso->splim;
+ SpLim = (P_)&(tso->stack) + RESERVED_STACK_WORDS;
OpenNursery(Hp,HpLim);
#ifdef REG_CurrentNursery
Module initialisation
-------------------------------------------------------------------------- */
+#if 1 /* old init stuff */
+
#define PUSH_INIT_STACK(reg_function) \
*(Sp++) = (W_)reg_function
JMP_(POP_INIT_STACK()); \
FE_ }
+#else
+
+#define PUSH_INIT_STACK(reg_function) /* nothing */
+#define POP_INIT_STACK() /* nothing */
+#define REGISTER_IMPORT(reg_mod_name) /* nothing */
+
+#define START_MOD_INIT(reg_mod_name) \
+ FN_(reg_mod_name) { \
+ EF_(StgReturn); \
+ TEXT_SET(hs_init_set, reg_mod_name); \
+ FB_;
+ /* extern decls go here, followed by init code */
+
+#define REGISTER_FOREIGN_EXPORT(reg_fe_binder) \
+ STGCALL1(getStablePtr,reg_fe_binder)
+
+
+#define END_MOD_INIT() \
+ JMP_(StgReturn); \
+ FE_ } \
+
+#endif
+
/* -----------------------------------------------------------------------------
Support for _ccall_GC_ and _casm_GC.
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.16 2000/05/26 10:14:33 sewardj Exp $
+ * $Id: TSO.h,v 1.17 2000/08/15 14:18:43 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
* storage manager, and won't be copied during garbage collection.
*/
+/*
+ * ToDo: make this structure sensible on a non-32-bit arch.
+ */
+
typedef struct StgTSO_ {
StgHeader header;
StgMutClosure * mut_link; /* TSO's are mutable of course! */
struct StgTSO_* global_link; /* Links all threads together */
- StgTSOWhatNext what_next;
- StgTSOBlockReason why_blocked;
+ StgTSOWhatNext what_next : 16;
+ StgTSOBlockReason why_blocked : 16;
StgTSOBlockInfo block_info;
struct StgTSO_* blocked_exceptions;
StgThreadID id;
+
StgTSOTickyInfo ticky;
StgTSOProfInfo prof;
StgTSOParInfo par;
StgWord max_stack_size; /* maximum stack size in *words* */
StgPtr sp;
StgUpdateFrame* su;
- StgPtr splim;
StgWord stack[0];
} StgTSO;
tso->stack < tso->sp < tso->stack+tso->stack_size
tso->stack_size <= tso->max_stack_size
- tso->splim == tso->stack + RESERVED_STACK_WORDS;
RESERVED_STACK_WORDS is large enough for any heap-check or
stack-check failure.
/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.83 2000/05/26 08:42:59 simonmar Exp $
+ * $Id: GC.c,v 1.84 2000/08/15 14:18:43 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
/* relocate the stack pointers... */
new_tso->su = (StgUpdateFrame *) ((StgPtr)new_tso->su + diff);
new_tso->sp = (StgPtr)new_tso->sp + diff;
- new_tso->splim = (StgPtr)new_tso->splim + diff;
relocate_TSO(tso, new_tso);
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.75 2000/08/15 11:48:06 simonmar Exp $
+ * $Id: Schedule.c,v 1.76 2000/08/15 14:18:43 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
tso->why_blocked = NotBlocked;
tso->blocked_exceptions = NULL;
- tso->splim = (P_)&(tso->stack) + RESERVED_STACK_WORDS;
tso->stack_size = stack_size;
tso->max_stack_size = round_to_mblocks(RtsFlags.GcFlags.maxStkSize)
- TSO_STRUCT_SIZEW;
diff = (P_)new_sp - (P_)tso->sp; /* In *words* */
dest->su = (StgUpdateFrame *) ((P_)dest->su + diff);
dest->sp = new_sp;
- dest->splim = (P_)dest->splim + (nat)((P_)dest - (P_)tso);
dest->stack_size = new_stack_size;
/* and relocate the update frame list */
/* -----------------------------------------------------------------------------
- * $Id: StgCRun.c,v 1.19 2000/08/07 23:37:23 qrczak Exp $
+ * $Id: StgCRun.c,v 1.20 2000/08/15 14:18:43 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#if STACK_DETAILS
fprintf(stderr,
"== SB = %p SP = %p(%p) SU = %p SpLim = %p(%p)\n",
- sb, sp, tso->sp, su, basereg->rSpLim, tso->splim);
+ sb, sp, tso->sp, su, basereg->rSpLim, tso->stack + RESERVED_STACK_WORDS);
#endif
if (su >= sb) goto postloop;