/* -----------------------------------------------------------------------------
- * $Id: Block.h,v 1.18 2005/02/10 13:02:00 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#ifndef CMINUSMINUS
-// to the end...
+/* to the end... */
/* Double-linked block lists: --------------------------------------------- */
/* -----------------------------------------------------------------------------
- * $Id: Bytecodes.h,v 1.10 2004/09/07 10:10:07 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
#define SET_PROF_HDR(c,ccs_) \
((c)->header.prof.ccs = ccs_, \
LDV_RECORD_CREATE((c)))
-#endif // DEBUG_RETAINER
+#endif /* DEBUG_RETAINER */
#define SET_STATIC_PROF_HDR(ccs_) \
prof : { ccs : (CostCentreStack *)ccs_, hp : { rs : NULL } },
#else
/* ----------------------------------------------------------------------------
- * $Id: ClosureTypes.h,v 1.20 2005/02/10 13:02:02 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
typedef struct {
CostCentreStack *ccs;
union {
- struct _RetainerSet *rs; // Retainer Set
- StgWord ldvw; // Lag/Drag/Void Word
+ struct _RetainerSet *rs; /* Retainer Set */
+ StgWord ldvw; /* Lag/Drag/Void Word */
} hp;
} StgProfHeader;
StgClosure *payload[FLEXIBLE_ARRAY];
} StgPAP;
-// AP closures have the same layout, for convenience
+/* AP closures have the same layout, for convenience */
typedef StgPAP StgAP;
typedef struct {
StgHeader header;
- StgWord size; // number of words in payload
+ StgWord size; /* number of words in payload */
StgClosure *fun;
- StgClosure *payload[FLEXIBLE_ARRAY]; // contains a chunk of *stack*
+ StgClosure *payload[FLEXIBLE_ARRAY]; /* contains a chunk of *stack* */
} StgAP_STACK;
typedef struct {
typedef struct {
StgHeader header;
- StgArrWords *instrs; // a pointer to an ArrWords
- StgArrWords *literals; // a pointer to an ArrWords
- StgMutArrPtrs *ptrs; // a pointer to a MutArrPtrs
- StgArrWords *itbls; // a pointer to an ArrWords
- StgHalfWord arity; // arity of this BCO
- StgHalfWord size; // size of this BCO (in words)
- StgWord bitmap[FLEXIBLE_ARRAY]; // an StgLargeBitmap
+ StgArrWords *instrs; /* a pointer to an ArrWords */
+ StgArrWords *literals; /* a pointer to an ArrWords */
+ StgMutArrPtrs *ptrs; /* a pointer to a MutArrPtrs */
+ StgArrWords *itbls; /* a pointer to an ArrWords */
+ StgHalfWord arity; /* arity of this BCO */
+ StgHalfWord size; /* size of this BCO (in words) */
+ StgWord bitmap[FLEXIBLE_ARRAY]; /* an StgLargeBitmap */
} StgBCO;
#define BCO_BITMAP(bco) ((StgLargeBitmap *)((StgBCO *)(bco))->bitmap)
StgTVarWaitQueue *first_wait_queue_entry;
} StgTVar;
-// new_value == expected_value for read-only accesses
-// new_value is a StgTVarWaitQueue entry when trec in state TREC_WAITING
+/* new_value == expected_value for read-only accesses */
+/* new_value is a StgTVarWaitQueue entry when trec in state TREC_WAITING */
typedef struct {
StgTVar *tvar;
StgClosure *expected_value;
} StgTRecChunk;
typedef enum {
- TREC_ACTIVE, // Transaction in progress, outcome undecided
- TREC_CANNOT_COMMIT, // Transaction in progress, inconsistent writes performed
- TREC_MUST_ABORT, // Transaction in progress, inconsistent / out of date reads
- TREC_COMMITTED, // Transaction has committed, now updating tvars
- TREC_ABORTED, // Transaction has aborted, now reverting tvars
- TREC_WAITING, // Transaction currently waiting
+ TREC_ACTIVE, /* Transaction in progress, outcome undecided */
+ TREC_CANNOT_COMMIT, /* Transaction in progress, inconsistent writes performed */
+ TREC_MUST_ABORT, /* Transaction in progress, inconsistent / out of date reads */
+ TREC_COMMITTED, /* Transaction has committed, now updating tvars */
+ TREC_ABORTED, /* Transaction has aborted, now reverting tvars */
+ TREC_WAITING, /* Transaction currently waiting */
} TRecState;
typedef struct StgTRecHeader_ {
#ifndef CMM_H
#define CMM_H
-// In files that are included into both C and C-- (and perhaps
-// Haskell) sources, we sometimes need to conditionally compile bits
-// depending on the language. CMINUSMINUS==1 in .cmm sources:
+/*
+ * In files that are included into both C and C-- (and perhaps
+ * Haskell) sources, we sometimes need to conditionally compile bits
+ * depending on the language. CMINUSMINUS==1 in .cmm sources:
+ */
#define CMINUSMINUS 1
#include "ghcconfig.h"
#define W_SHIFT 4
#endif
-// Converting quantities of words to bytes
+/* Converting quantities of words to bytes */
#define WDS(n) ((n)*SIZEOF_W)
-// Converting quantities of bytes to words
-// NB. these work on *unsigned* values only
+/*
+ * Converting quantities of bytes to words
+ * NB. these work on *unsigned* values only
+ */
#define BYTES_TO_WDS(n) ((n) / SIZEOF_W)
#define ROUNDUP_BYTES_TO_WDS(n) (((n) + SIZEOF_W - 1) / SIZEOF_W)
-// TO_W_(n) converts n to W_ type from a smaller type
+/* TO_W_(n) converts n to W_ type from a smaller type */
#if SIZEOF_W == 4
#define TO_W_(x) %sx32(x)
#define HALF_W_(x) %lobits16(x)
#define DEBUG_ONLY(s) /* nothing */
#endif
-//
-// The IF_DEBUG macro is useful for debug messages that depend on one
-// of the RTS debug options. For example:
-//
-// IF_DEBUG(RtsFlags_DebugFlags_apply,
-// foreign "C" fprintf(stderr, stg_ap_0_ret_str));
-//
-// Note the syntax is slightly different to the C version of this macro.
-//
+/*
+ * The IF_DEBUG macro is useful for debug messages that depend on one
+ * of the RTS debug options. For example:
+ *
+ * IF_DEBUG(RtsFlags_DebugFlags_apply,
+ * foreign "C" fprintf(stderr, stg_ap_0_ret_str));
+ *
+ * Note the syntax is slightly different to the C version of this macro.
+ */
#ifdef DEBUG
#define IF_DEBUG(c,s) if (RtsFlags_DebugFlags_##c(RtsFlags)) { s; }
#else
#include "ClosureTypes.h"
#include "StgFun.h"
-//
-// Need MachRegs, because some of the RTS code is conditionally
-// compiled based on REG_R1, REG_R2, etc.
-//
+/*
+ * Need MachRegs, because some of the RTS code is conditionally
+ * compiled based on REG_R1, REG_R2, etc.
+ */
#define STOLEN_X86_REGS 4
#include "MachRegs.h"
#undef BLOCK_SIZE
#undef MBLOCK_SIZE
-#include "Block.h" // For Bdescr()
+#include "Block.h" /* For Bdescr() */
-// Can't think of a better place to put this.
+/* Can't think of a better place to put this. */
#if SIZEOF_mp_limb_t != SIZEOF_VOID_P
#error mp_limb_t != StgWord: assumptions in PrimOps.cmm are now false
#endif
Allocation and garbage collection
------------------------------------------------------------------------- */
-// ALLOC_PRIM is for allocating memory on the heap for a primitive
-// object. It is used all over PrimOps.cmm.
-//
-// We make the simplifying assumption that the "admin" part of a
-// primitive closure is just the header when calculating sizes for
-// ticky-ticky. It's not clear whether eg. the size field of an array
-// should be counted as "admin", or the various fields of a BCO.
-//
+/*
+ * ALLOC_PRIM is for allocating memory on the heap for a primitive
+ * object. It is used all over PrimOps.cmm.
+ *
+ * We make the simplifying assumption that the "admin" part of a
+ * primitive closure is just the header when calculating sizes for
+ * ticky-ticky. It's not clear whether eg. the size field of an array
+ * should be counted as "admin", or the various fields of a BCO.
+ */
#define ALLOC_PRIM(bytes,liveness,reentry) \
HP_CHK_GEN_TICKY(bytes,liveness,reentry); \
TICK_ALLOC_PRIM(SIZEOF_StgHeader,bytes-SIZEOF_StgHeader,0); \
CCCS_ALLOC(bytes);
-// CCS_ALLOC wants the size in words, because ccs->mem_alloc is in words
+/* CCS_ALLOC wants the size in words, because ccs->mem_alloc is in words */
#define CCCS_ALLOC(__alloc) CCS_ALLOC(BYTES_TO_WDS(__alloc), W_[CCCS])
#define HP_CHK_GEN_TICKY(alloc,liveness,reentry) \
Closures
-------------------------------------------------------------------------- */
-// The offset of the payload of an array
+/* The offset of the payload of an array */
#define BYTE_ARR_CTS(arr) ((arr) + SIZEOF_StgArrWords)
-// Getting/setting the info pointer of a closure
+/* Getting/setting the info pointer of a closure */
#define SET_INFO(p,info) StgHeader_info(p) = info
#define GET_INFO(p) StgHeader_info(p)
-// Determine the size of an ordinary closure from its info table
+/* Determine the size of an ordinary closure from its info table */
#define sizeW_fromITBL(itbl) \
SIZEOF_StgHeader + WDS(%INFO_PTRS(itbl)) + WDS(%INFO_NPTRS(itbl))
-// NB. duplicated from InfoTables.h!
+/* NB. duplicated from InfoTables.h! */
#define BITMAP_SIZE(bitmap) ((bitmap) & BITMAP_SIZE_MASK)
#define BITMAP_BITS(bitmap) ((bitmap) >> BITMAP_BITS_SHIFT)
-// Debugging macros
+/* Debugging macros */
#define LOOKS_LIKE_INFO_PTR(p) \
((p) != NULL && \
(TO_W_(%INFO_TYPE(%STD_INFO(p))) != INVALID_OBJECT) && \
#define LOOKS_LIKE_CLOSURE_PTR(p) (LOOKS_LIKE_INFO_PTR(GET_INFO(p)))
-//
-// The layout of the StgFunInfoExtra part of an info table changes
-// depending on TABLES_NEXT_TO_CODE. So we define field access
-// macros which use the appropriate version here:
-//
+/*
+ * The layout of the StgFunInfoExtra part of an info table changes
+ * depending on TABLES_NEXT_TO_CODE. So we define field access
+ * macros which use the appropriate version here:
+ */
#ifdef TABLES_NEXT_TO_CODE
- // when TABLES_NEXT_TO_CODE, slow_apply is stored as an offset
- // instead of the normal pointer.
+/*
+ * when TABLES_NEXT_TO_CODE, slow_apply is stored as an offset
+ * instead of the normal pointer.
+ */
#define StgFunInfoExtra_slow_apply(fun_info) \
(StgFunInfoExtraRev_slow_apply_offset(fun_info) \
#define TICK_HISTO(histo,n) TICK_HISTO_BY(histo,n,1)
-// An unboxed tuple with n components.
+/* An unboxed tuple with n components. */
#define TICK_RET_UNBOXED_TUP(n) \
TICK_BUMP(RET_UNBOXED_TUP_ctr++); \
TICK_HISTO(RET_UNBOXED_TUP,n)
-// A slow call with n arguments. In the unevald case, this call has
-// already been counted once, so don't count it again.
+/*
+ * A slow call with n arguments. In the unevald case, this call has
+ * already been counted once, so don't count it again.
+ */
#define TICK_SLOW_CALL(n) \
TICK_BUMP(SLOW_CALL_ctr); \
TICK_HISTO(SLOW_CALL,n)
-// This slow call was found to be to an unevaluated function; undo the
-// ticks we did in TICK_SLOW_CALL.
+/*
+ * This slow call was found to be to an unevaluated function; undo the
+ * ticks we did in TICK_SLOW_CALL.
+ */
#define TICK_SLOW_CALL_UNEVALD(n) \
TICK_BUMP(SLOW_CALL_UNEVALD_ctr); \
TICK_BUMP_BY(SLOW_CALL_ctr,-1); \
TICK_HISTO_BY(SLOW_CALL,n,-1);
-// Updating a closure with a new CON
+/* Updating a closure with a new CON */
#define TICK_UPD_CON_IN_NEW(n) \
TICK_BUMP(UPD_CON_IN_NEW_ctr); \
TICK_HISTO(UPD_CON_IN_NEW,n)
TICK_BUMP(ALLOC_HEAP_ctr); \
TICK_BUMP_BY(ALLOC_HEAP_tot,n)
-#endif // CMM_H
+#endif /* CMM_H */
/* ----------------------------------------------------------------------------
- * $Id: Constants.h,v 1.28 2005/02/10 13:02:03 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
#define LDV_LAST_MASK 0x00007FFF
#define LDV_STATE_CREATE 0x00000000
#define LDV_STATE_USE 0x40000000
-#endif // SIZEOF_VOID_P
+#endif /* SIZEOF_VOID_P */
/* -----------------------------------------------------------------------------
TSO related constants
/*
- Time-stamp: <Fri Mar 24 2000 23:55:42 Stardate: [-30]4554.98 hwloidl>
- $Id: GranSim.h,v 1.4 2004/11/10 04:17:50 wolfgang Exp $
-
Headers for GranSim specific objects.
Note that in GranSim we have one run-queue and blocking-queue for each
extern StgTSO *CurrentTSO;
-//@node Headers for GranSim specific objects, , ,
-//@section Headers for GranSim specific objects
-
-//@menu
-//* Externs and prototypes::
-//* Run and blocking queues::
-//* Spark queues::
-//* Processor related stuff::
-//* GranSim costs::
-//* STG called GranSim functions::
-//* STG-called routines::
-//@end menu
-
-//@node Externs and prototypes, Run and blocking queues, Includes, Headers for GranSim specific objects
-//@subsection Externs and prototypes
+/*
+ * @node Headers for GranSim specific objects, , ,
+ * @section Headers for GranSim specific objects
+ *
+ * @menu
+ * * Externs and prototypes::
+ * * Run and blocking queues::
+ * * Spark queues::
+ * * Processor related stuff::
+ * * GranSim costs::
+ * * STG called GranSim functions::
+ * * STG-called routines::
+ * @end menu
+ *
+ * @node Externs and prototypes, Run and blocking queues, Includes, Headers for GranSim specific objects
+ * @subsection Externs and prototypes
+ */
/* Global constants */
extern char *gran_event_names[];
extern nat SurplusThreads; /* How many excess threads are there */
extern nat sparksIgnored, sparksCreated;
-//@node Run and blocking queues, Spark queues, Externs and prototypes, Headers for GranSim specific objects
-//@subsection Run and blocking queues
+/*
+ * @node Run and blocking queues, Spark queues, Externs and prototypes, Headers for GranSim specific objects
+ * @subsection Run and blocking queues
+ */
/* declared in Schedule.c */
extern StgTSO *run_queue_hds[], *run_queue_tls[];
#define pending_sparks_tl pending_sparks_tls[CurrentProc]
#define ccalling_threads ccalling_threadss[CurrentProc]
-//@node Spark queues, Processor related stuff, Run and blocking queues, Headers for GranSim specific objects
-//@subsection Spark queues
+/*
+ * @node Spark queues, Processor related stuff, Run and blocking queues, Headers for GranSim specific objects
+ * @subsection Spark queues
+ */
/*
In GranSim we use a double linked list to represent spark queues.
rtsSpark *newSpark(StgClosure *node,
nat name, nat gran_info, nat size_info,
nat par_info, nat local);
-// void add_to_spark_queue(rtsSpark *spark);
+/* void add_to_spark_queue(rtsSpark *spark); */
-//@node Processor related stuff, GranSim costs, Spark queues, Headers for GranSim specific objects
-//@subsection Processor related stuff
+/*
+ * @node Processor related stuff, GranSim costs, Spark queues, Headers for GranSim specific objects
+ * @subsection Processor related stuff
+ */
extern PEs CurrentProc;
extern rtsTime CurrentTime[];
/* Maximum number of PEs that can be simulated */
-#define MAX_PROC 32 /* (BITS_IN(StgWord)) */ // ToDo: fix this!!
-//#if MAX_PROC==16
-//#else
-//#error MAX_PROC should be 32 on this architecture
-//#endif
+#define MAX_PROC 32 /* (BITS_IN(StgWord)) */ /* ToDo: fix this!! */
+/*
+#if MAX_PROC==16
+#else
+#error MAX_PROC should be 32 on this architecture
+#endif
+*/
-// #define CurrentTSO CurrentTSOs[CurrentProc]
+/* #define CurrentTSO CurrentTSOs[CurrentProc] */
/* Processor numbers to bitmasks and vice-versa */
#define MainProc 0 /* Id of main processor */
#define GRAN_TIME_SLICE 1000 /* max time between 2 ReSchedules */
-//@node GranSim costs, STG called GranSim functions, Processor related stuff, Headers for GranSim specific objects
-//@subsection GranSim costs
+/*
+ * @node GranSim costs, STG called GranSim functions, Processor related stuff, Headers for GranSim specific objects
+ * @subsection GranSim costs
+ */
/* Default constants for communication (see RtsFlags on how to change them) */
#define PRI_SPARK_OVERHEAD 5
#define PRI_SCHED_OVERHEAD 5
-//@node STG called GranSim functions, STG-called routines, GranSim costs, Headers for GranSim specific objects
-//@subsection STG called GranSim functions
+/*
+ * @node STG called GranSim functions, STG-called routines, GranSim costs, Headers for GranSim specific objects
+ * @subsection STG called GranSim functions
+ */
/* STG called GranSim functions */
void GranSimAllocate(StgInt n);
void GranSimBlock(StgTSO *tso, PEs proc, StgClosure *node);
-//@node STG-called routines, , STG called GranSim functions, Headers for GranSim specific objects
-//@subsection STG-called routines
+/*
+ * @node STG-called routines, , STG called GranSim functions, Headers for GranSim specific objects
+ * @subsection STG-called routines
+ */
/* Wrapped version of calls to GranSim-specific STG routines */
/*
ToDo: Clean up this mess of GRAN macros!!! -- HWL
*/
-// DO_GRAN_FETCH((StgClosure*)R1.p);
+/* DO_GRAN_FETCH((StgClosure*)R1.p); */
#define GRAN_FETCH() /* nothing */
#define GRAN_FETCH_AND_RESCHEDULE(liveness,reenter) \
DO_GRAN_FETCH((StgClosure*)R1.p); \
DO_GRAN_YIELD(liveness,ENTRY_CODE((D_)(*R1.p)));
-// RESTORE_EVERYTHING is done implicitly before entering threaded world agian
+/* RESTORE_EVERYTHING is done implicitly before entering threaded world again */
/*
This is the only macro currently enabled;
}
-// YIELD(liveness,reenter)
+/* YIELD(liveness,reenter) */
-// GRAN_YIELD(liveness_mask);
+/* GRAN_YIELD(liveness_mask); */
-// GRAN_FETCH_AND_RESCHEDULE(liveness_mask,reenter)
+/* GRAN_FETCH_AND_RESCHEDULE(liveness_mask,reenter) */
#define THREAD_CONTEXT_SWITCH(liveness_mask,reenter) \
do { \
/* -----------------------------------------------------------------------------
- * $Id: Hooks.h,v 1.7 2004/02/15 13:29:44 krasimir Exp $
*
* (c) The GHC Team, 1998-1999
*
/* -----------------------------------------------------------------------------
- * $Id: HsFFI.h,v 1.20 2004/08/13 13:09:13 simonmar Exp $
*
* (c) The GHC Team, 2000
*
/* ----------------------------------------------------------------------------
- * $Id: InfoTables.h,v 1.35 2004/11/08 12:26:55 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
#if 0 && (defined(PAR) || defined(GRAN))
-// CURRENTLY UNUSED
-// ToDo: use this in StgInfoTable (mutually recursive) -- HWL
+/* CURRENTLY UNUSED
+ ToDo: use this in StgInfoTable (mutually recursive) -- HWL */
typedef struct {
StgInfoTable *rbh_infoptr; /* infoptr to the RBH */
# endif
/* see ParallelRts.h */
-// EXTFUN(RBH_entry);
-//StgClosure *convertToRBH(StgClosure *closure);
-//#if defined(GRAN)
-//void convertFromRBH(StgClosure *closure);
-//#elif defined(PAR)
-//void convertToFetchMe(StgPtr closure, globalAddr *ga);
-//#endif
+/*
+EXTFUN(RBH_entry);
+StgClosure *convertToRBH(StgClosure *closure);
+#if defined(GRAN)
+void convertFromRBH(StgClosure *closure);
+#elif defined(PAR)
+void convertToFetchMe(StgPtr closure, globalAddr *ga);
+#endif
+*/
#endif
#else /* !DEBUG_CLOSURE */
-// There is no DEBUG-specific stuff in an info table at this time.
+/* There is no DEBUG-specific stuff in an info table at this time. */
#endif /* DEBUG_CLOSURE */
In these bitmaps: 0 == ptr, 1 == non-ptr.
-------------------------------------------------------------------------- */
-//
-// Small bitmaps: for a small bitmap, we store the size and bitmap in
-// the same word, using the following macros. If the bitmap doesn't
-// fit in a single word, we use a pointer to an StgLargeBitmap below.
-//
+/*
+ * Small bitmaps: for a small bitmap, we store the size and bitmap in
+ * the same word, using the following macros. If the bitmap doesn't
+ * fit in a single word, we use a pointer to an StgLargeBitmap below.
+ */
#define MK_SMALL_BITMAP(size,bits) (((bits)<<BITMAP_BITS_SHIFT) | (size))
#define BITMAP_SIZE(bitmap) ((bitmap) & BITMAP_SIZE_MASK)
#define BITMAP_BITS(bitmap) ((bitmap) >> BITMAP_BITS_SHIFT)
-//
-// A large bitmap.
-//
+/*
+ * A large bitmap.
+ */
typedef struct {
StgWord size;
StgWord bitmap[FLEXIBLE_ARRAY];
garbage-collect CAFs.
-------------------------------------------------------------------------- */
-// An SRT is just an array of closure pointers:
+/* An SRT is just an array of closure pointers: */
typedef StgClosure* StgSRT[];
-// Each info table refers to some subset of the closure pointers in an
-// SRT. It does this using a pair of an StgSRT pointer and a
-// half-word bitmap. If the half-word bitmap isn't large enough, then
-// we fall back to a large SRT, including an unbounded bitmap. If the
-// half-word bitmap is set to all ones (0xffff), then the StgSRT
-// pointer instead points to an StgLargeSRT:
+/*
+ * Each info table refers to some subset of the closure pointers in an
+ * SRT. It does this using a pair of an StgSRT pointer and a
+ * half-word bitmap. If the half-word bitmap isn't large enough, then
+ * we fall back to a large SRT, including an unbounded bitmap. If the
+ * half-word bitmap is set to all ones (0xffff), then the StgSRT
+ * pointer instead points to an StgLargeSRT:
+ */
typedef struct StgLargeSRT_ {
StgSRT *srt;
StgLargeBitmap l;
Info Tables
------------------------------------------------------------------------- */
-//
-// Stuff describing the closure layout. Well, actually, it might
-// contain the selector index for a THUNK_SELECTOR. This union is one
-// word long.
-//
+/*
+ * Stuff describing the closure layout. Well, actually, it might
+ * contain the selector index for a THUNK_SELECTOR. This union is one
+ * word long.
+ */
typedef union {
- struct { // Heap closure payload layout:
- StgHalfWord ptrs; // number of pointers
- StgHalfWord nptrs; // number of non-pointers
+ struct { /* Heap closure payload layout: */
+ StgHalfWord ptrs; /* number of pointers */
+ StgHalfWord nptrs; /* number of non-pointers */
} payload;
- StgWord bitmap; // word-sized bit pattern describing
- // a stack frame: see below
+ StgWord bitmap; /* word-sized bit pattern describing */
+ /* a stack frame: see below */
#ifndef TABLES_NEXT_TO_CODE
- StgLargeBitmap* large_bitmap; // pointer to large bitmap structure
+ StgLargeBitmap* large_bitmap; /* pointer to large bitmap structure */
#else
- StgWord large_bitmap_offset; // offset from info table to large bitmap structure
+ StgWord large_bitmap_offset; /* offset from info table to large bitmap structure */
#endif
- StgWord selector_offset; // used in THUNK_SELECTORs
+ StgWord selector_offset; /* used in THUNK_SELECTORs */
} StgClosureInfo;
-//
-// The "standard" part of an info table. Every info table has this bit.
-//
+/*
+ * The "standard" part of an info table. Every info table has this bit.
+ */
typedef struct _StgInfoTable {
#ifndef TABLES_NEXT_TO_CODE
- StgFunPtr entry; // pointer to the entry code
+ StgFunPtr entry; /* pointer to the entry code */
#endif
#if defined(PAR) || defined(GRAN)
StgProfInfo prof;
#endif
#ifdef TICKY
- // Ticky-specific stuff would go here.
+ /* Ticky-specific stuff would go here. */
#endif
#ifdef DEBUG_CLOSURE
- // Debug-specific stuff would go here.
+ /* Debug-specific stuff would go here. */
#endif
- StgClosureInfo layout; // closure layout info (one word)
+ StgClosureInfo layout; /* closure layout info (one word) */
- StgHalfWord type; // closure type
- StgHalfWord srt_bitmap; // number of entries in SRT (or constructor tag)
+ StgHalfWord type; /* closure type */
+ StgHalfWord srt_bitmap; /* number of entries in SRT (or constructor tag) */
#ifdef TABLES_NEXT_TO_CODE
StgCode code[FLEXIBLE_ARRAY];
-------------------------------------------------------------------------- */
typedef struct _StgFunInfoExtraRev {
- StgWord slow_apply_offset; // apply to args on the stack
- StgWord bitmap; // arg ptr/nonptr bitmap
- StgWord srt_offset; // pointer to the SRT table
- StgHalfWord fun_type; // function type
- StgHalfWord arity; // function arity
+ StgWord slow_apply_offset; /* apply to args on the stack */
+ StgWord bitmap; /* arg ptr/nonptr bitmap */
+ StgWord srt_offset; /* pointer to the SRT table */
+ StgHalfWord fun_type; /* function type */
+ StgHalfWord arity; /* function arity */
} StgFunInfoExtraRev;
typedef struct _StgFunInfoExtraFwd {
- StgHalfWord fun_type; // function type
- StgHalfWord arity; // function arity
- StgSRT *srt; // pointer to the SRT table
- StgWord bitmap; // arg ptr/nonptr bitmap
- StgFun *slow_apply; // apply to args on the stack
+ StgHalfWord fun_type; /* function type */
+ StgHalfWord arity; /* function arity */
+ StgSRT *srt; /* pointer to the SRT table */
+ StgWord bitmap; /* arg ptr/nonptr bitmap */
+ StgFun *slow_apply; /* apply to args on the stack */
} StgFunInfoExtraFwd;
typedef struct {
Return info tables
-------------------------------------------------------------------------- */
-// When info tables are laid out backwards, we can omit the SRT
-// pointer iff srt_bitmap is zero.
+/*
+ * When info tables are laid out backwards, we can omit the SRT
+ * pointer iff srt_bitmap is zero.
+ */
typedef struct {
#if defined(TABLES_NEXT_TO_CODE)
- StgWord srt_offset; // offset to the SRT table
+ StgWord srt_offset; /* offset to the SRT table */
StgInfoTable i;
#else
StgInfoTable i;
- StgSRT *srt; // pointer to the SRT table
+ StgSRT *srt; /* pointer to the SRT table */
StgFunPtr vector[FLEXIBLE_ARRAY];
#endif
} StgRetInfoTable;
Thunk info tables
-------------------------------------------------------------------------- */
-// When info tables are laid out backwards, we can omit the SRT
-// pointer iff srt_bitmap is zero.
+/*
+ * When info tables are laid out backwards, we can omit the SRT
+ * pointer iff srt_bitmap is zero.
+ */
typedef struct _StgThunkInfoTable {
#if !defined(TABLES_NEXT_TO_CODE)
StgInfoTable i;
#endif
#if defined(TABLES_NEXT_TO_CODE)
- StgWord srt_offset; // offset to the SRT table
+ StgWord srt_offset; /* offset to the SRT table */
#else
- StgSRT *srt; // pointer to the SRT table
+ StgSRT *srt; /* pointer to the SRT table */
#endif
#if defined(TABLES_NEXT_TO_CODE)
StgInfoTable i;
Accessor macros for fields that might be offsets (C version)
-------------------------------------------------------------------------- */
-// GET_SRT(info)
-// info must be a Stg[Ret|Thunk]InfoTable* (an info table that has a SRT)
+/*
+ * GET_SRT(info)
+ * info must be a Stg[Ret|Thunk]InfoTable* (an info table that has a SRT)
+ */
#ifdef TABLES_NEXT_TO_CODE
#define GET_SRT(info) ((StgSRT*) (((StgWord) ((info)+1)) + (info)->srt_offset))
#else
#define GET_SRT(info) ((info)->srt)
#endif
-// GET_FUN_SRT(info)
-// info must be a StgFunInfoTable*
+/*
+ * GET_FUN_SRT(info)
+ * info must be a StgFunInfoTable*
+ */
#ifdef TABLES_NEXT_TO_CODE
#define GET_FUN_SRT(info) ((StgSRT*) (((StgWord) ((info)+1)) + (info)->f.srt_offset))
#else
/* -----------------------------------------------------------------------------
- * $Id: Linker.h,v 1.4 2002/05/01 15:46:14 simonmar Exp $
*
* (c) The GHC Team, 2000
*
/* -----------------------------------------------------------------------------
- * $Id: MachRegs.h,v 1.22 2005/02/09 15:59:35 wolfgang Exp $
*
* (c) The GHC Team, 1998-1999
*
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.29 2005/03/22 11:53:48 simonmar Exp $
-#
TOP = ..
include $(TOP)/mk/boilerplate.mk
/*
- Time-stamp: <Tue Mar 06 2001 00:09:10 Stardate: [-30]6285.03 hwloidl>
- $Id: Parallel.h,v 1.4 2001/03/22 03:51:09 hwloidl Exp $
-
Definitions for GUM i.e. running on a parallel machine.
This section contains definitions applicable only to programs compiled
#if defined(PAR) || defined(GRAN) /* whole file */
-//@node Parallel definitions, End of File
-//@section Parallel definitions
-
-//@menu
-//* Basic definitions::
-//* GUM::
-//* GranSim::
-//@end menu
-
-//@node Basic definitions, GUM, Parallel definitions, Parallel definitions
-//@subsection Basic definitions
+/*
+ * @node Parallel definitions, End of File
+ * @section Parallel definitions
+ *
+ * @menu
+ * * Basic definitions::
+ * * GUM::
+ * * GranSim::
+ * @end menu
+ *
+ * @node Basic definitions, GUM, Parallel definitions, Parallel definitions
+ * @subsection Basic definitions
+ */
/* This clashes with TICKY, but currently TICKY and PAR hate each other anyway */
#define _HS sizeofW(StgHeader)
# define ADVISORY_POOL 1 /* idx of pool of advisory sparks (parallelism) */
#endif
-//@menu
-//* GUM::
-//* GranSim::
-//@end menu
-//*/
-
-//@node GUM, GranSim, Basic definitions, Parallel definitions
-//@subsection GUM
+/*
+ * @menu
+ * * GUM::
+ * * GranSim::
+ * @end menu
+ *
+ * @node GUM, GranSim, Basic definitions, Parallel definitions
+ * @subsection GUM
+ */
#if defined(PAR)
/*
packet in the parallel (GUM) system.
*/
-//@menu
-//* Types::
-//* Externs::
-//* Prototypes::
-//* Macros::
-//@end menu
-//*/
-
-//@node Types, Externs, GUM, GUM
-//@subsubsection Types
+/*
+ * @menu
+ * * Types::
+ * * Externs::
+ * * Prototypes::
+ * * Macros::
+ * @end menu
+ *
+ * @node Types, Externs, GUM, GUM
+ * @subsubsection Types
+ */
/* Sparks and spark queues */
typedef StgClosure *rtsSpark;
#define PACK_BUFFER_HDR_SIZE 4
-//@node Externs, Prototypes, Types, GUM
-//@subsubsection Externs
+/*
+ * @node Externs, Prototypes, Types, GUM
+ * @subsubsection Externs
+ */
-// extern rtsBool do_sp_profile;
+/* extern rtsBool do_sp_profile; */
extern globalAddr theGlobalFromGA, theGlobalToGA;
extern StgBlockedFetch *PendingFetches;
extern GlobalTaskId *allPEs;
extern rtsBool IAmMainThread, GlobalStopPending;
-//extern rtsBool fishing;
+/*extern rtsBool fishing; */
extern rtsTime last_fish_arrived_at;
extern nat outstandingFishes;
extern GlobalTaskId SysManTask;
extern GALA *liveRemoteGAs;
*/
-//@node Prototypes, Macros, Externs, GUM
-//@subsubsection Prototypes
+/*
+ * @node Prototypes, Macros, Externs, GUM
+ * @subsubsection Prototypes
+ */
/* From ParInit.c */
void initParallelSystem(void);
void registerTask (GlobalTaskId gtid);
globalAddr *LAGAlookup (StgClosure *addr);
StgClosure *GALAlookup (globalAddr *ga);
-//static GALA *allocIndirection (StgPtr addr);
+/*static GALA *allocIndirection (StgPtr addr); */
globalAddr *makeGlobal (StgClosure *addr, rtsBool preferred);
globalAddr *setRemoteGA (StgClosure *addr, globalAddr *ga, rtsBool preferred);
void splitWeight (globalAddr *to, globalAddr *from);
StgInt highest_slot (void);
# endif
-//@node Macros, , Prototypes, GUM
-//@subsubsection Macros
+/*
+ * @node Macros, , Prototypes, GUM
+ * @subsubsection Macros
+ */
/* delay (in us) between dying fish returning and sending out a new fish */
#define FISH_DELAY 1000
/* max no. of outstanding spark steals */
#define MAX_FISHES 1
-// ToDo: check which of these is actually needed!
+/* ToDo: check which of these is actually needed! */
# define PACK_HEAP_REQUIRED ((RtsFlags.ParFlags.packBufferSize - PACK_HDR_SIZE) / (PACK_GA_SIZE + _HS) * (MIN_UPD_SIZE + 2))
#endif /* PAR */
-//@node GranSim, , GUM, Parallel definitions
-//@subsection GranSim
+/*
+ * @node GranSim, , GUM, Parallel definitions
+ * @subsection GranSim
+ */
#if defined(GRAN)
/* ToDo: Check which of the PAR routines are needed in GranSim -- HWL */
-//@menu
-//* Types::
-//* Prototypes::
-//* Macros::
-//@end menu
-//*/
-
-//@node Types, Prototypes, GranSim, GranSim
-//@subsubsection Types
+/*
+ * @menu
+ * * Types::
+ * * Prototypes::
+ * * Macros::
+ * @end menu
+ *
+ * @node Types, Prototypes, GranSim, GranSim
+ * @subsubsection Types
+ */
typedef StgWord *StgBuffer;
typedef struct rtsPackBuffer_ {
StgWord *buffer;
} rtsPackBuffer;
-//@node Macros, , Prototypes, GranSim
-//@subsubsection Macros
+/*
+ * @node Macros, , Prototypes, GranSim
+ * @subsubsection Macros
+ */
/* max no. of outstanding spark steals */
#define MAX_FISHES 1
#endif /* GRAN */
-//@node End of File, , Parallel definitions
-//@section End of File
+/*
+ * @node End of File, , Parallel definitions
+ * @section End of File
+ */
#endif /* defined(PAR) || defined(GRAN) whole file */
Rts.h
Stg.h
- ghcconfig.h // configuration info derived by the configure script.
- RtsConfig.h // settings for Rts things (eg. eager vs. lazy BH)
- MachDeps.h // sizes of various basic types
- StgTypes.h // basic types specific to the virtual machine
- TailCalls.h // tail calls in .hc code
- StgDLL.h // stuff related to Windows DLLs
- MachRegs.h // global register assignments for this arch
- Regs.h // "registers" in the virtual machine
- StgProf.h // profiling gubbins
- StgMiscClosures.h // decls for closures & info tables in the RTS
- RtsExternal.h // decls for RTS things required by .hc code
+ ghcconfig.h /* configuration info derived by the configure script. */
+ RtsConfig.h /* settings for Rts things (eg. eager vs. lazy BH) */
+ MachDeps.h /* sizes of various basic types */
+ StgTypes.h /* basic types specific to the virtual machine */
+ TailCalls.h /* tail calls in .hc code */
+ StgDLL.h /* stuff related to Windows DLLs */
+ MachRegs.h /* global register assignments for this arch */
+ Regs.h /* "registers" in the virtual machine */
+ StgProf.h /* profiling gubbins */
+ StgMiscClosures.h /* decls for closures & info tables in the RTS */
+ RtsExternal.h /* decls for RTS things required by .hc code */
(RtsAPI.h)
(HsFFI.h)
- RtsTypes.h // types used in the RTS
+ RtsTypes.h /* types used in the RTS */
- Constants.h // build-time constants
+ Constants.h /* build-time constants */
StgLdvProf.h
StgFun.h
Closures.h
- Liveness.h // macros for constructing RET_DYN liveness masks
+ Liveness.h /* macros for constructing RET_DYN liveness masks */
ClosureMacros.h
ClosureTypes.h
InfoTables.h
TSO.h
- Updates.h // macros for performing updates
+ Updates.h /* macros for performing updates */
GranSim.h
Parallel.h
SMP.h
DNInvoke.h
Dotnet.h
-Cmm.h // included into .cmm source only
- DerivedConstants.h // generated by mkDerivedConstants.c from other
- // .h files.
+Cmm.h /* included into .cmm source only */
+ DerivedConstants.h /* generated by mkDerivedConstants.c from other */
+ /* .h files. */
(Constants.h)
(ClosureTypes.h)
(StgFun.h)
(Liveness.h)
(Block.h)
-Bytecodes.h // Bytecode definitions for the interpreter
-Linker.h // External API to the linker
-RtsFlags.h // External API to the RTS runtime flags
-SchedAPI.h // External API to the RTS scheduler
-ieee-flpt.h // ToDo: needed?
+Bytecodes.h /* Bytecode definitions for the interpreter */
+Linker.h /* External API to the linker */
+RtsFlags.h /* External API to the RTS runtime flags */
+SchedAPI.h /* External API to the RTS scheduler */
+ieee-flpt.h /* ToDo: needed? */
-RtsAPI.h // The top-level interface to the RTS (rts_evalIO(), etc.)
-HsFFI.h // The external FFI api
+RtsAPI.h /* The top-level interface to the RTS (rts_evalIO(), etc.) */
+HsFFI.h /* The external FFI api */
StgUnion rR6;
StgUnion rR7;
StgUnion rR8;
- StgUnion rR9; // used occasionally by heap/stack checks
- StgUnion rR10; // used occasionally by heap/stack checks
+ StgUnion rR9; /* used occasionally by heap/stack checks */
+ StgUnion rR10; /* used occasionally by heap/stack checks */
StgFloat rF1;
StgFloat rF2;
StgFloat rF3;
struct StgTSO_ *rCurrentTSO;
struct bdescr_ *rNursery;
struct bdescr_ *rCurrentNursery;
- StgWord rHpAlloc; // number of *bytes* being allocated in heap
+ StgWord rHpAlloc; /* number of *bytes* being allocated in heap */
#if defined(SMP) || defined(PAR)
- StgSparkPool rSparks; // per-task spark pool
+ StgSparkPool rSparks; /* per-task spark pool */
#endif
} StgRegTable;
/* -----------------------------------------------------------------------------
- * $Id: RtsExternal.h,v 1.8 2005/01/31 12:55:50 simonmar Exp $
*
* (c) The GHC Team, 1998-2004
*
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.h,v 1.48 2005/02/03 10:59:05 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
};
struct DEBUG_FLAGS {
- // flags to control debugging output & extra checking in various subsystems
- rtsBool scheduler; // 's'
- rtsBool interpreter; // 'i'
- rtsBool codegen; // 'c'
- rtsBool weak; // 'w'
- rtsBool gccafs; // 'G'
- rtsBool gc; // 'g'
- rtsBool block_alloc; // 'b'
- rtsBool sanity; // 'S' warning: might be expensive!
- rtsBool stable; // 't'
- rtsBool prof; // 'p'
- rtsBool gran; // 'r'
- rtsBool par; // 'P'
- rtsBool linker; // 'l' the object linker
- rtsBool apply; // 'a'
- rtsBool stm; // 'm'
+ /* flags to control debugging output & extra checking in various subsystems */
+ rtsBool scheduler; /* 's' */
+ rtsBool interpreter; /* 'i' */
+ rtsBool codegen; /* 'c' */
+ rtsBool weak; /* 'w' */
+ rtsBool gccafs; /* 'G' */
+ rtsBool gc; /* 'g' */
+ rtsBool block_alloc; /* 'b' */
+ rtsBool sanity; /* 'S' warning: might be expensive! */
+ rtsBool stable; /* 't' */
+ rtsBool prof; /* 'p' */
+ rtsBool gran; /* 'r' */
+ rtsBool par; /* 'P' */
+ rtsBool linker; /* 'l' the object linker */
+ rtsBool apply; /* 'a' */
+ rtsBool stm; /* 'm' */
};
struct COST_CENTRE_FLAGS {
struct GRAN_COST_FLAGS Costs; /* cost metric for simulation */
struct GRAN_DEBUG_FLAGS Debug; /* debugging options */
- nat maxThreads; // ToDo: share with SMP and GUM
- // rtsBool labelling;
+ nat maxThreads; /* ToDo: share with SMP and GUM */
+ /* rtsBool labelling; */
nat packBufferSize;
nat packBufferSize_internal;
rtsBool RandomSteal; /* steal spark/thread from random proc */
rtsBool NoForward; /* no forwarding of fetch messages */
- // unsigned int debug;
- // rtsBool event_trace;
- // rtsBool event_trace_all;
+ /* unsigned int debug; */
+ /* rtsBool event_trace; */
+ /* rtsBool event_trace_all; */
};
#endif /* GRAN */
/* Put them together: */
typedef struct _RTS_FLAGS {
- // The first portion of RTS_FLAGS is invariant.
+ /* The first portion of RTS_FLAGS is invariant. */
struct GC_FLAGS GcFlags;
struct CONCURRENT_FLAGS ConcFlags;
struct DEBUG_FLAGS DebugFlags;
#ifdef COMPILING_RTS_MAIN
extern DLLIMPORT RTS_FLAGS RtsFlags;
#elif IN_STG_CODE
-// Hack because the C code generator can't generate '&label'.
+/* Hack because the C code generator can't generate '&label'. */
extern RTS_FLAGS RtsFlags[];
#else
extern RTS_FLAGS RtsFlags;
extern RtsMsgFunction rtsDebugMsgFn;
extern RtsMsgFunction rtsErrorMsgFn;
-#endif // RTSMESSAGES_H
+#endif /* RTSMESSAGES_H */
typedef struct hashtable ParHashTable;
typedef struct hashlist ParHashList;
-// typedef double REAL_TIME;
-// typedef W_ TIME;
-// typedef GlobalTaskId Proc;
+/* typedef double REAL_TIME; */
+/* typedef W_ TIME; */
+/* typedef GlobalTaskId Proc; */
typedef int GlobalTaskId;
typedef GlobalTaskId PEs;
typedef unsigned int rtsWeight;
#elif defined(GRAN)
-// GlobalTaskId is dummy in GranSim;
-// we define it to have cleaner code in the RTS
+/*
+ * GlobalTaskId is dummy in GranSim;
+ * we define it to have cleaner code in the RTS
+ */
typedef int GlobalTaskId;
typedef lnat rtsTime;
typedef StgWord PEs;
/* ----------------------------------------------------------------------------
- * $Id: SMP.h,v 1.5 2005/01/28 12:55:52 simonmar Exp $
*
* (c) The GHC Team, 1999
*
*/
-// Create and enter a new transaction context
+/* Create and enter a new transaction context */
extern StgTRecHeader *stmStartTransaction(StgTRecHeader *outer);
-// Exit the current transaction context, abandoning any read/write
-// operations performed within it and removing the thread from any
-// tvar wait queues if it was waitin. Note that if nested transactions
-// are not fully supported then this may leave the enclosing
-// transaction contexts doomed to abort.
+/*
+ * Exit the current transaction context, abandoning any read/write
+ * operations performed within it and removing the thread from any
+ * tvar wait queues if it was waitin. Note that if nested transactions
+ * are not fully supported then this may leave the enclosing
+ * transaction contexts doomed to abort.
+ */
extern void stmAbortTransaction(StgTRecHeader *trec);
-// Ensure that a subsequent commit / validation will fail. We use this
-// in our current handling of transactions that may have become invalid
-// and started looping. We strip their stack back to the ATOMICALLY_FRAME,
-// and, when the thread is next scheduled, discover it to be invalid and
-// re-execute it. However, we need to force the transaction to stay invalid
-// in case other threads' updates make it valid in the mean time.
+/*
+ * Ensure that a subsequent commit / validation will fail. We use this
+ * in our current handling of transactions that may have become invalid
+ * and started looping. We strip their stack back to the ATOMICALLY_FRAME,
+ * and, when the thread is next scheduled, discover it to be invalid and
+ * re-execute it. However, we need to force the transaction to stay invalid
+ * in case other threads' updates make it valid in the mean time.
+ */
extern void stmCondemnTransaction(StgTRecHeader *trec);
-// Return the trec within which the specified trec was created (not
-// valid if trec==NO_TREC).
+/*
+ * Return the trec within which the specified trec was created (not
+ * valid if trec==NO_TREC).
+ */
extern StgTRecHeader *stmGetEnclosingTRec(StgTRecHeader *trec);
is actually still valid.
*/
-// Test whether the current transaction context is valid, i.e. whether
-// it is still possible for it to commit successfully. Note: we assume that
-// once stmValidateTransaction has returned FALSE for a given transaction then
-// that transaction will never again be valid -- we rely on this in Schedule.c when
-// kicking invalid threads at GC (in case they are stuck looping)
+/*
+ * Test whether the current transaction context is valid, i.e. whether
+ * it is still possible for it to commit successfully. Note: we assume that
+ * once stmValidateTransaction has returned FALSE for a given transaction then
+ * that transaction will never again be valid -- we rely on this in Schedule.c when
+ * kicking invalid threads at GC (in case they are stuck looping)
+ */
extern StgBool stmValidateTransaction(StgTRecHeader *trec);
-// Test whether the current transaction context is valid and, if so,
-// commit its memory accesses to the heap. stmCommitTransaction must
-// unblock any threads which are waiting on tvars that updates have
-// been committed to.
+/*
+ * Test whether the current transaction context is valid and, if so,
+ * commit its memory accesses to the heap. stmCommitTransaction must
+ * unblock any threads which are waiting on tvars that updates have
+ * been committed to.
+ */
extern StgBool stmCommitTransaction(StgTRecHeader *trec);
-// Test whether the current transaction context is valid and, if so,
-// start the thread waiting for updates to any of the tvars it has
-// ready from and mark it as blocked. It is an error to call stmWait
-// if the thread is already waiting.
+/*
+ * Test whether the current transaction context is valid and, if so,
+ * start the thread waiting for updates to any of the tvars it has
+ * ready from and mark it as blocked. It is an error to call stmWait
+ * if the thread is already waiting.
+ */
extern StgBool stmWait(StgTSO *tso, StgTRecHeader *trec);
-// Test whether the current transaction context is valid and, if so,
-// leave the thread waiting and mark it as blocked again. If the
-// transaction context is no longer valid then stop the thread waiting
-// and leave it as unblocked. It is an error to call stmReWait if the
-// thread is not waiting.
+/*
+ * Test whether the current transaction context is valid and, if so,
+ * leave the thread waiting and mark it as blocked again. If the
+ * transaction context is no longer valid then stop the thread waiting
+ * and leave it as unblocked. It is an error to call stmReWait if the
+ * thread is not waiting.
+ */
extern StgBool stmReWait(StgTSO *tso);
-// Merge the accesses made so far in the second trec into the first trec.
-// Note that the resulting trec is only intended to be used in wait operations.
-// This avoids defining what happens if "trec" and "other" contain conflicting
-// updates.
+/*
+ * Merge the accesses made so far in the second trec into the first trec.
+ * Note that the resulting trec is only intended to be used in wait operations.
+ * This avoids defining what happens if "trec" and "other" contain conflicting
+ * updates.
+ */
extern StgBool stmMergeForWaiting(StgTRecHeader *trec, StgTRecHeader *other);
----------------------
*/
-// Return the logical contents of 'tvar' within the context of the
-// thread's current transaction.
+/*
+ * Return the logical contents of 'tvar' within the context of the
+ * thread's current transaction.
+ */
extern StgClosure *stmReadTVar(StgTRecHeader *trec,
StgTVar *tvar);
-// Update the logical contents of 'tvar' within the context of the
-// thread's current transaction.
+/* Update the logical contents of 'tvar' within the context of the
+ * thread's current transaction.
+ */
extern void stmWriteTVar(StgTRecHeader *trec,
StgTVar *tvar,
/*----------------------------------------------------------------------*/
-// NULLs
+/* NULLs */
#define END_STM_WAIT_QUEUE ((StgTVarWaitQueue *)(void *)&stg_END_STM_WAIT_QUEUE_closure)
#define END_STM_CHUNK_LIST ((StgTRecChunk *)(void *)&stg_END_STM_CHUNK_LIST_closure)
/* -----------------------------------------------------------------------------
- * $Id: SchedAPI.h,v 1.19 2003/11/12 17:27:03 sof Exp $
*
* (c) The GHC Team 1998-2002
*
#define SCHEDAPI_H
#if defined(GRAN)
-// Dummy def for NO_PRI if not in GranSim
+/* Dummy def for NO_PRI if not in GranSim */
#define NO_PRI 0
#endif
#define STG_SIG_HAN (-4)
#define STG_SIG_RST (-5)
-#endif // SIGNALS_H
+#endif /* SIGNALS_H */
/* -----------------------------------------------------------------------------
- * $Id: Stg.h,v 1.67 2005/02/01 14:14:41 simonmar Exp $
*
* (c) The GHC Team, 1998-2004
*
#define ARG_PPPPPPP 23
#define ARG_PPPPPPPP 24
-#endif // STGFUN_H
+#endif /* STGFUN_H */
/* -----------------------------------------------------------------------------
* Data Structures
* ---------------------------------------------------------------------------*/
-// NB. be careful to avoid unwanted padding between fields, by
-// putting the 8-byte fields on an 8-byte boundary. Padding can
-// vary between C compilers, and we don't take into account any
-// possible padding when generating CCS and CC decls in the code
-// generator (compiler/codeGen/CgProf.hs).
+/*
+ * NB. be careful to avoid unwanted padding between fields, by
+ * putting the 8-byte fields on an 8-byte boundary. Padding can
+ * vary between C compilers, and we don't take into account any
+ * possible padding when generating CCS and CC decls in the code
+ * generator (compiler/codeGen/CgProf.hs).
+ */
typedef struct _CostCentre {
StgInt ccID;
/* used for accumulating costs at the end of the run... */
StgWord time_ticks;
- StgWord64 mem_alloc; // align 8 (see above)
+ StgWord64 mem_alloc; /* align 8 (see above) */
StgInt is_caf;
struct _CostCentreStack *prevStack;
struct _IndexTable *indexTable;
- StgWord64 scc_count; // align 8 (see above)
+ StgWord64 scc_count; /* align 8 (see above) */
StgWord selected;
StgWord time_ticks;
- StgWord64 mem_alloc; // align 8 (see above)
- StgWord64 inherited_alloc; // align 8 (see above)
+ StgWord64 mem_alloc; /* align 8 (see above) */
+ StgWord64 inherited_alloc; /* align 8 (see above) */
StgWord inherited_ticks;
CostCentre *root;
extern CostCentre CC_DONT_CARE[];
extern CostCentreStack CCS_DONT_CARE[]; /* shouldn't ever get set */
-#endif // IN_STG_CODE
+#endif /* IN_STG_CODE */
extern unsigned int RTS_VAR(CC_ID); /* global ids */
extern unsigned int RTS_VAR(CCS_ID);
/* ----------------------------------------------------------------------------
- * $Id: StgTicky.h,v 1.16 2004/08/13 13:09:38 simonmar Exp $
*
* (c) The AQUA project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
ALLOC_BH_gds += (g); ALLOC_BH_slp += (s); \
TICK_ALLOC_HISTO(BH,_HS,g,s)
-// admin size doesn't take into account the FUN, that is accounted for
-// in the "goods".
+/*
+ * admin size doesn't take into account the FUN, that is accounted for
+ * in the "goods".
+ */
#define TICK_ALLOC_PAP(g,s) \
ALLOC_PAP_ctr++; ALLOC_PAP_adm += sizeofW(StgPAP)-1; \
ALLOC_PAP_gds += (g); ALLOC_PAP_slp += (s); \
SLOW_CALL_hst[((__idx > 8) ? 8 : __idx)] -= 1; \
}
-// A slow call with n arguments. In the unevald case, this call has
-// already been counted once, so don't count it again.
+/*
+ * A slow call with n arguments. In the unevald case, this call has
+ * already been counted once, so don't count it again.
+ */
#define TICK_SLOW_CALL(n) \
SLOW_CALL_ctr++; \
TICK_SLOW_HISTO(n)
-// This slow call was found to be to an unevaluated function; undo the
-// ticks we did in TICK_SLOW_CALL.
+/*
+ * This slow call was found to be to an unevaluated function; undo the
+ * ticks we did in TICK_SLOW_CALL.
+ */
#define TICK_SLOW_CALL_UNEVALD(n) \
SLOW_CALL_UNEVALD_ctr++; \
SLOW_CALL_ctr--; \
MULTI_CHUNK_SLOW_CALL_ctr++; \
MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr += chunks;
-// A completely unknown tail-call
+/* A completely unknown tail-call */
#define TICK_UNKNOWN_CALL() UNKNOWN_CALL_ctr++
-// slow call patterns (includes "extra" args to known calls,
-// so the total of these will be greater than UNKNOWN_CALL_ctr).
+/*
+ * slow call patterns (includes "extra" args to known calls,
+ * so the total of these will be greater than UNKNOWN_CALL_ctr).
+ */
#define TICK_SLOW_CALL_v() SLOW_CALL_v_ctr++
#define TICK_SLOW_CALL_f() SLOW_CALL_f_ctr++
#define TICK_SLOW_CALL_d() SLOW_CALL_d_ctr++
#define TICK_KNOWN_CALL_TOO_FEW_ARGS() KNOWN_CALL_TOO_FEW_ARGS_ctr++
#define TICK_KNOWN_CALL_EXTRA_ARGS() KNOWN_CALL_EXTRA_ARGS_ctr++
-// A slow call to a FUN found insufficient arguments, and built a PAP
+/* A slow call to a FUN found insufficient arguments, and built a PAP */
#define TICK_SLOW_CALL_FUN_TOO_FEW() SLOW_CALL_FUN_TOO_FEW_ctr++
#define TICK_SLOW_CALL_FUN_CORRECT() SLOW_CALL_FUN_CORRECT_ctr++
#define TICK_SLOW_CALL_FUN_TOO_MANY() SLOW_CALL_FUN_TOO_MANY_ctr++
= {0,0,0,0,0}
#endif
;
-#endif // PAR
+#endif /* PAR */
EXTERN unsigned long ENT_VIA_NODE_ctr INIT(0);
EXTERN unsigned long ENT_STATIC_THK_ctr INIT(0);
void revertCAFs( void );
- // set to disable CAF garbage collection in GHCi.
- // (needed when dynamic libraries are used).
+/* set to disable CAF garbage collection in GHCi. */
+/* (needed when dynamic libraries are used). */
extern rtsBool keepCAFs;
/* -----------------------------------------------------------------------------
extern StgClosure * RTS_VAR(revertible_caf_list);
extern StgTSO * RTS_VAR(resurrected_threads);
-#endif // STORAGE_H
+#endif /* STORAGE_H */
/* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.41 2005/02/10 13:02:05 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
typedef union {
StgClosure *closure;
struct StgTSO_ *tso;
- StgInt fd; // StgInt instead of int, so that it's the same size as the ptrs
+ StgInt fd; /* StgInt instead of int, so that it's the same size as the ptrs */
#if defined(mingw32_HOST_OS)
StgAsyncIOResult* async_result;
#endif
typedef struct StgTSO_ {
StgHeader header;
- struct StgTSO_* link; // Links threads onto blocking queues */
- struct StgTSO_* global_link; // Links all threads together */
+ struct StgTSO_* link; /* Links threads onto blocking queues */
+ struct StgTSO_* global_link; /* Links all threads together */
- StgWord16 what_next; // Values defined in Constants.h
- StgWord16 why_blocked; // Values defined in Constants.h
+ StgWord16 what_next; /* Values defined in Constants.h */
+ StgWord16 why_blocked; /* Values defined in Constants.h */
StgTSOBlockInfo block_info;
struct StgTSO_* blocked_exceptions;
StgThreadID id;
int saved_errno;
struct StgMainThread_* main;
- struct StgTRecHeader_ *trec; // STM transaction record
+ struct StgTRecHeader_ *trec; /* STM transaction record */
#ifdef TICKY_TICKY
- // TICKY-specific stuff would go here.
+ /* TICKY-specific stuff would go here. */
#endif
#ifdef PROFILING
StgTSOProfInfo prof;
/* -----------------------------------------------------------------------------
- * $Id: TailCalls.h,v 1.20 2005/03/08 09:01:20 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
ASSERT( p1 != p2 && !closure_IND(p1) );
- // @LDV profiling
- // Destroy the old closure.
- // Nb: LDV_* stuff cannot mix with ticky-ticky
+ /*
+ * @LDV profiling
+ * Destroy the old closure.
+ * Nb: LDV_* stuff cannot mix with ticky-ticky
+ */
LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1);
bd = Bdescr((P_)p1);
if (bd->gen_no == 0) {
((StgInd *)p1)->indirectee = p2;
SET_INFO(p1, &stg_IND_PERM_info);
- // @LDV profiling
- // We have just created a new closure.
+ /*
+ * @LDV profiling
+ * We have just created a new closure.
+ */
LDV_RECORD_CREATE(p1);
TICK_UPD_NEW_PERM_IND(p1);
} else {
}
((StgInd *)p1)->indirectee = p2;
SET_INFO(p1, &stg_IND_OLDGEN_PERM_info);
- // @LDV profiling
- // We have just created a new closure.
+ /*
+ * @LDV profiling
+ * We have just created a new closure.
+ */
LDV_RECORD_CREATE(p1);
TICK_UPD_OLD_PERM_IND();
}
#define IN_STG_CODE 0
-// We need offsets of profiled things... better be careful that this
-// doesn't affect the offsets of anything else.
+/*
+ * We need offsets of profiled things... better be careful that this
+ * doesn't affect the offsets of anything else.
+ */
#define PROFILING
#include "Rts.h"
#define field_offset(s_type, field) \
field_offset_(str(s_type,field),s_type,field);
-// An access macro for use in C-- sources.
+/* An access macro for use in C-- sources. */
#define struct_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+OFFSET_" str "]\n");
-// Outputs the byte offset and MachRep for a field
+/* Outputs the byte offset and MachRep for a field */
#define struct_field(s_type, field) \
field_offset(s_type, field); \
field_type(s_type, field); \
#define struct_size(s_type) \
def_size(#s_type, sizeof(s_type));
-// Size of a closure type, minus the header, named SIZEOF_<type>_NoHdr
-// Also, we #define SIZEOF_<type> to be the size of the whole closure for .cmm.
+/*
+ * Size of a closure type, minus the header, named SIZEOF_<type>_NoHdr
+ * Also, we #define SIZEOF_<type> to be the size of the whole closure for .cmm.
+ */
#define closure_size(s_type) \
def_size(#s_type "_NoHdr", sizeof(s_type) - sizeof(StgHeader)); \
def_closure_size(#s_type, sizeof(s_type) - sizeof(StgHeader));
-// An access macro for use in C-- sources.
+/* An access macro for use in C-- sources. */
#define closure_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+SIZEOF_StgHeader+OFFSET_" str "]\n");
closure_field_offset_(str(s_type,field),s_type,field); \
closure_payload_macro(str(s_type,field));
-// Byte offset and MachRep for a closure field, minus the header
+/* Byte offset and MachRep for a closure field, minus the header */
#define closure_field(s_type, field) \
closure_field_offset(s_type,field) \
field_type(s_type, field); \
closure_field_macro(str(s_type,field))
-// Byte offset and MachRep for a closure field, minus the header
+/* Byte offset and MachRep for a closure field, minus the header */
#define closure_field_(str, s_type, field) \
closure_field_offset_(str,s_type,field) \
field_type_(str, s_type, field); \
closure_field_macro(str)
-// Byte offset and MachRep for a TSO field, minus the header and
-// variable prof bit.
+/*
+ * Byte offset and MachRep for a TSO field, minus the header and
+ * variable prof bit.
+ */
#define tso_offset(s_type, field) \
def_offset(str(s_type,field), OFFSET(s_type,field) - sizeof(StgHeader) - sizeof(StgTSOProfInfo));
printf("/* This file is created automatically. Do not edit by hand.*/\n\n");
printf("#define STD_HDR_SIZE %d\n", sizeofW(StgHeader) - sizeofW(StgProfHeader));
- // grrr.. PROFILING is on so we need to subtract sizeofW(StgProfHeader)
+ /* grrr.. PROFILING is on so we need to subtract sizeofW(StgProfHeader) */
printf("#define PROF_HDR_SIZE %d\n", sizeofW(StgProfHeader));
printf("#define GRAN_HDR_SIZE %d\n", sizeofW(StgGranHeader));
// canned bitmap for each arg type
extern StgWord stg_arg_bitmaps[];
-#endif // APPLY_H
+#endif /* APPLY_H */
// For internal use only:
extern unsigned long arenaBlocks( void );
-#endif // ARENA_H
+#endif /* ARENA_H */
Sp_adj(n+1); \
jump %ENTRY_CODE(Sp(0));
-#endif // APPLY_H
+#endif /* APPLY_H */
//
extern void grabCapability( Capability **pCap );
-#endif // !RTS_SUPPORTS_THREADS
+#endif /* !RTS_SUPPORTS_THREADS */
#endif /* __CAPABILITY_H__ */
p, info_type((StgClosure *)p)));
break;
}
-#endif // PAR
+#endif /* PAR */
case TVAR_WAIT_QUEUE:
{
}
-#endif // DEBUG
+#endif /* DEBUG */
jump W_[stg_stack_save_entries + WDS(type)];
// jumps to stg_gc_noregs after saving stuff
}
-#endif // !NO_ARG_REGS
+#endif /* !NO_ARG_REGS */
}
/* -----------------------------------------------------------------------------
extern StgThreadReturnCode interpretBCO (Capability* cap);
-#endif // INTERPRETER_H
+#endif /* INTERPRETER_H */
# if defined(openbsd_HOST_OS)
dl_libc_handle = dlopen("libc.so", RTLD_LAZY);
# endif
-# endif // RTLD_DEFAULT
+# endif /* RTLD_DEFAULT */
# endif
}
# error HEAP_ALLOCED not defined
#endif
-#endif // __MBLOCK_H__
+#endif /* __MBLOCK_H__ */
return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER
|| RtsFlags.ProfFlags.retainerSelector != NULL);
}
-#endif // PROFILING
+#endif /* PROFILING */
// Precesses a closure 'c' being destroyed whose size is 'size'.
// Make sure that LDV_recordDead() is not invoked on 'inherently used' closures
"nextEra");
}
}
-#endif // PROFILING
+#endif /* PROFILING */
initEra( &censuses[era] );
}
}
fprintf(fp, "%s", buf);
}
-#endif // PROFILING
+#endif /* PROFILING */
rtsBool
strMatchesSelector( char* str, char* sel )
}
debugBelch(">");
}
-#endif // DEBUG
+#endif /* DEBUG */
#endif /* PROFILING */
}
}
}
-#endif // DEBUG_RETAINER
+#endif /* DEBUG_RETAINER */
#endif /* PROFILING */
for (i = 0; i < HASH_TABLE_SIZE; i++)
hashTable[i] = NULL;
nextId = 2;
-#endif // FIRST_APPROACH
+#endif /* FIRST_APPROACH */
}
/* -----------------------------------------------------------------------------
stgFree(rsArray);
}
-#endif // SECOND_APPROACH
+#endif /* SECOND_APPROACH */
#endif /* PROFILING */
// the best place to define it.
void printRetainer(FILE *, retainer);
-#endif // PROFILING
-#endif // RETAINERSET_H
+#endif /* PROFILING */
+#endif /* RETAINERSET_H */
" -Dl DEBUG: linker",
" -Dm DEBUG: stm",
"",
-#endif // DEBUG
+#endif /* DEBUG */
#if defined(SMP)
" -N<n> Use <n> OS threads (default: 1)",
#endif
error = rtsTrue;
}
)
-#endif // PROFILING
+#endif /* PROFILING */
break;
#if defined(PROFILING)
extern void* __hscore_get_saved_termios(int fd);
extern void __hscore_set_saved_termios(int fd, void* ts);
-#endif // RTSUTILS_H
+#endif /* RTSUTILS_H */
#ifdef DIST
case REMOTE_REF:
return sizeofW(StgFetchMe);
-#endif //DIST
+#endif /*DIST */
case FETCH_ME:
ASSERT(LOOKS_LIKE_GA(((StgFetchMe *)p)->ga));
nat, int,
#endif
double);
-#endif // PROFILING
+#endif /* PROFILING */
#if defined(PROFILING) || defined(DEBUG)
extern void stat_startHeapCensus(void);
#ifdef PROFILING
extern double mut_user_time_during_RP(void);
extern double mut_user_time_during_heap_census(void);
-#endif // PROFILING
+#endif /* PROFILING */
extern void statDescribeGens( void );
extern HsInt64 getAllocations( void );
void cRevalIO(StgClosure *job,StgPEId p);
StgPEId cGetHostOwner(StgByteArray h);
-#endif // DIST
+#endif /* DIST */
-#endif // __DIST_H
+#endif /* __DIST_H */