Permalink
Browse files

[project @ 2005-03-27 13:41:13 by panne]

* Some preprocessors don't like the C99/C++ '//' comments after a
  directive, so use '/* */' instead. For consistency, a lot of '//' in
  the include files were converted, too.

* UnDOSified libraries/base/cbits/runProcess.c.

* My favourite sport: Killed $Id$s.
  • Loading branch information...
1 parent c0cca2e commit 03dc2dd3dd814ad85cc4c45e9cafc7b73163c8be panne committed Mar 27, 2005
Showing with 513 additions and 439 deletions.
  1. +1 −2 ghc/includes/Block.h
  2. +0 −1 ghc/includes/Bytecodes.h
  3. +1 −1 ghc/includes/ClosureMacros.h
  4. +0 −1 ghc/includes/ClosureTypes.h
  5. +20 −20 ghc/includes/Closures.h
  6. +61 −50 ghc/includes/Cmm.h
  7. +1 −2 ghc/includes/Constants.h
  8. +55 −42 ghc/includes/GranSim.h
  9. +0 −1 ghc/includes/Hooks.h
  10. +0 −1 ghc/includes/HsFFI.h
  11. +81 −70 ghc/includes/InfoTables.h
  12. +0 −1 ghc/includes/Linker.h
  13. +0 −1 ghc/includes/MachRegs.h
  14. +0 −2 ghc/includes/Makefile
  15. +71 −57 ghc/includes/Parallel.h
  16. +25 −25 ghc/includes/README
  17. +4 −4 ghc/includes/Regs.h
  18. +0 −1 ghc/includes/RtsExternal.h
  19. +23 −24 ghc/includes/RtsFlags.h
  20. +1 −1 ghc/includes/RtsMessages.h
  21. +7 −5 ghc/includes/RtsTypes.h
  22. +0 −1 ghc/includes/SMP.h
  23. +60 −41 ghc/includes/STM.h
  24. +1 −2 ghc/includes/SchedAPI.h
  25. +1 −1 ghc/includes/Signals.h
  26. +0 −1 ghc/includes/Stg.h
  27. +1 −1 ghc/includes/StgFun.h
  28. +12 −10 ghc/includes/StgProf.h
  29. +19 −12 ghc/includes/StgTicky.h
  30. +3 −3 ghc/includes/Storage.h
  31. +7 −8 ghc/includes/TSO.h
  32. +0 −1 ghc/includes/TailCalls.h
  33. +13 −7 ghc/includes/Updates.h
  34. +18 −12 ghc/includes/mkDerivedConstants.c
  35. +1 −1 ghc/rts/Apply.h
  36. +1 −1 ghc/rts/Arena.h
  37. +1 −1 ghc/rts/AutoApply.h
  38. +1 −1 ghc/rts/Capability.h
  39. +2 −2 ghc/rts/GC.c
  40. +1 −1 ghc/rts/HeapStackCheck.cmm
  41. +1 −1 ghc/rts/Interpreter.h
  42. +1 −1 ghc/rts/Linker.c
  43. +1 −1 ghc/rts/MBlock.h
  44. +3 −3 ghc/rts/ProfHeap.c
  45. +1 −1 ghc/rts/Profiling.c
  46. +1 −1 ghc/rts/RetainerProfile.c
  47. +2 −2 ghc/rts/RetainerSet.c
  48. +2 −2 ghc/rts/RetainerSet.h
  49. +2 −2 ghc/rts/RtsFlags.c
  50. +1 −1 ghc/rts/RtsUtils.h
  51. +1 −1 ghc/rts/Sanity.c
  52. +2 −2 ghc/rts/Stats.h
  53. +2 −2 ghc/rts/parallel/Dist.h
View
@@ -1,5 +1,4 @@
/* -----------------------------------------------------------------------------
- * $Id: Block.h,v 1.18 2005/02/10 13:02:00 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -143,7 +142,7 @@ INLINE_HEADER bdescr *Bdescr(StgPtr p)
#ifndef CMINUSMINUS
-// to the end...
+/* to the end... */
/* Double-linked block lists: --------------------------------------------- */
View
@@ -1,5 +1,4 @@
/* -----------------------------------------------------------------------------
- * $Id: Bytecodes.h,v 1.10 2004/09/07 10:10:07 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
@@ -114,7 +114,7 @@
#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
@@ -1,5 +1,4 @@
/* ----------------------------------------------------------------------------
- * $Id: ClosureTypes.h,v 1.20 2005/02/10 13:02:02 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
View
@@ -21,8 +21,8 @@
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;
@@ -79,14 +79,14 @@ typedef struct {
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 {
@@ -194,13 +194,13 @@ typedef struct _StgDeadWeak { /* Weak v */
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)
@@ -317,8 +317,8 @@ typedef struct {
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;
@@ -335,12 +335,12 @@ typedef struct StgTRecChunk_ {
} 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_ {
View
@@ -58,9 +58,11 @@
#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"
@@ -146,15 +148,17 @@
#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)
@@ -200,15 +204,15 @@
#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
@@ -268,10 +272,10 @@
#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"
@@ -280,10 +284,10 @@
#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
@@ -292,20 +296,21 @@
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) \
@@ -323,37 +328,39 @@
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) && \
(TO_W_(%INFO_TYPE(%STD_INFO(p))) < N_CLOSURE_TYPES))
#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) \
@@ -447,25 +454,29 @@
#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)
@@ -474,4 +485,4 @@
TICK_BUMP(ALLOC_HEAP_ctr); \
TICK_BUMP_BY(ALLOC_HEAP_tot,n)
-#endif // CMM_H
+#endif /* CMM_H */
View
@@ -1,5 +1,4 @@
/* ----------------------------------------------------------------------------
- * $Id: Constants.h,v 1.28 2005/02/10 13:02:03 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
@@ -196,7 +195,7 @@
#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
Oops, something went wrong.

0 comments on commit 03dc2dd

Please sign in to comment.