/* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.95 2002/06/04 16:13:53 sof Exp $
+ * $Id: PrimOps.h,v 1.96 2002/07/17 09:21:48 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#define STG_SIG_ERR (-3)
#define STG_SIG_HAN (-4)
-extern StgInt stg_sig_install (StgInt, StgInt, StgStablePtr, sigset_t *);
-#define stg_sig_default(sig,mask) stg_sig_install(sig,STG_SIG_DFL,0,(sigset_t *)mask)
-#define stg_sig_ignore(sig,mask) stg_sig_install(sig,STG_SIG_IGN,0,(sigset_t *)mask)
-#define stg_sig_catch(sig,ptr,mask) stg_sig_install(sig,STG_SIG_HAN,ptr,(sigset_t *)mask)
-
+extern StgInt stg_sig_install (StgInt, StgInt, StgStablePtr, void *);
+#define stg_sig_default(sig,mask) stg_sig_install(sig,STG_SIG_DFL,0,(void *)mask)
+#define stg_sig_ignore(sig,mask) stg_sig_install(sig,STG_SIG_IGN,0,(void *)mask)
+#define stg_sig_catch(sig,ptr,mask) stg_sig_install(sig,STG_SIG_HAN,ptr,(void *)mask)
/* ------------------------------------------------------------------------
Parallel PrimOps
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.h,v 1.41 2001/12/12 14:58:26 simonmar Exp $
+ * $Id: RtsFlags.h,v 1.42 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#ifndef RTSFLAGS_H
#define RTSFLAGS_H
+#include <stdio.h>
+
/* For defaults, see the @initRtsFlagsDefaults@ routine. */
struct GC_FLAGS {
/* -----------------------------------------------------------------------------
- * $Id: Stg.h,v 1.46 2002/06/03 13:08:41 matthewc Exp $
+ * $Id: Stg.h,v 1.47 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
/* RTS public interface */
#include "RtsAPI.h"
-/* these are all ANSI C headers */
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
#ifdef SMP
#include <pthread.h>
#endif
/* --------------------------------------------------------------------------
- * $Id: mkNativeHdr.c,v 1.8 2002/01/08 10:36:24 sewardj Exp $
+ * $Id: mkNativeHdr.c,v 1.9 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team, 1992-1998
*
*
* ------------------------------------------------------------------------*/
+#include <stdio.h>
+
#include "Stg.h"
#define OFFSET(table, x) ((StgUnion *) &(x) - (StgUnion *) (&table))
/* -----------------------------------------------------------------------------
- $Id: Arena.c,v 1.1 2001/10/18 14:41:01 simonmar Exp $
+ $Id: Arena.c,v 1.2 2002/07/17 09:21:49 simonmar Exp $
(c) The University of Glasgow 2001
Arena allocation. Arenas provide fast memory allocation at the
#include "BlockAlloc.h"
#include "Arena.h"
+#include <stdlib.h>
+
// Each arena struct is allocated using malloc().
struct _Arena {
bdescr *current;
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.13 2001/11/08 14:42:11 simonmar Exp $
+ * $Id: BlockAlloc.c,v 1.14 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team 1998-2000
*
#include "BlockAlloc.h"
#include "MBlock.h"
+#include <string.h>
+
static void initMBlock(void *mblock);
static bdescr *allocMegaGroup(nat mblocks);
static void freeMegaGroup(bdescr *bd);
* Copyright (c) 1994-1998.
*
* $RCSfile: Disassembler.c,v $
- * $Revision: 1.24 $
- * $Date: 2001/08/14 13:40:09 $
+ * $Revision: 1.25 $
+ * $Date: 2002/07/17 09:21:49 $
* ---------------------------------------------------------------------------*/
#ifdef DEBUG
#include "Disassembler.h"
#include "Interpreter.h"
+#include <stdio.h>
+
/* --------------------------------------------------------------------------
* Disassembler
* ------------------------------------------------------------------------*/
/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.136 2002/07/10 09:28:54 simonmar Exp $
+ * $Id: GC.c,v 1.137 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
#include "RetainerProfile.h"
#include "LdvProfile.h"
+#include <string.h>
+
/* STATIC OBJECT LIST.
*
* During GC:
/*-----------------------------------------------------------------------------
- * $Id: Hash.c,v 1.8 2002/04/09 12:55:11 simonmar Exp $
+ * $Id: Hash.c,v 1.9 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The AQUA Project, Glasgow University, 1995-1998
* (c) The GHC Team, 1999
#include "Hash.h"
#include "RtsUtils.h"
+#include <stdlib.h>
+#include <string.h>
+
#define HSEGSIZE 1024 /* Size of a single hash table segment */
/* Also the minimum size of a hash table */
#define HDIRSIZE 1024 /* Size of the segment directory */
/* -----------------------------------------------------------------------------
- * $Id: Itimer.c,v 1.29 2001/11/27 01:57:59 sof Exp $
+ * $Id: Itimer.c,v 1.30 2002/07/17 09:21:49 simonmar Exp $
*
* (c) The GHC Team, 1995-1999
*
# include <windows.h>
#endif
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
lnat total_ticks = 0;
/* ticks left before next pre-emptive context switch */
/* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.28 2002/04/12 04:00:35 sof Exp $
+ * $Id: MBlock.c,v 1.29 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
#include <windows.h>
#endif
+#include <errno.h>
+
lnat mblocks_allocated = 0;
void *
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.99 2002/06/26 08:18:41 stolz Exp $
+ * $Id: PrimOps.hc,v 1.100 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#include "Itimer.h"
#include "Prelude.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#include <stdlib.h>
+
/* ** temporary **
classes CCallable and CReturnable don't really exist, but the
/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.51 2002/02/04 20:26:25 sof Exp $
+ * $Id: Printer.c,v 1.52 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team, 1994-2000.
*
#include "Rts.h"
#include "Printer.h"
+#include <stdio.h>
+
#ifdef DEBUG
#include "RtsUtils.h"
#include "Bytecodes.h" /* for InstrPtr */
#include "Disassembler.h"
-#include "Printer.h"
+#include <stdlib.h>
+#include <string.h>
#if defined(GRAN) || defined(PAR)
// HWL: explicit fixed header size to make debugging easier
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.56 2001/12/12 14:31:43 simonmar Exp $
+ * $Id: RtsFlags.c,v 1.57 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
#include <ctype.h>
#endif
+#include <stdlib.h>
+#include <string.h>
+
extern struct RTS_FLAGS RtsFlags;
/*
/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.64 2002/06/26 08:18:41 stolz Exp $
+ * $Id: RtsStartup.c,v 1.65 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
# include "LLC.h"
#endif
+#include <stdlib.h>
+
/*
* Flag Structure
*/
/* -----------------------------------------------------------------------------
- * $Id: RtsUtils.c,v 1.25 2002/05/18 05:28:14 ken Exp $
+ * $Id: RtsUtils.c,v 1.26 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#include <sys/time.h>
#endif
+#include <stdlib.h>
+#include <string.h>
#include <stdarg.h>
/* variable-argument error function. */
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.147 2002/07/10 09:28:56 simonmar Exp $
+ * $Id: Schedule.c,v 1.148 2002/07/17 09:21:50 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#include <unistd.h>
#endif
+#include <string.h>
+#include <stdlib.h>
#include <stdarg.h>
//@node Variables and Data structures, Prototypes, Includes, Main scheduling code
/* -----------------------------------------------------------------------------
- * $Id: Select.c,v 1.20 2002/07/09 20:44:24 sof Exp $
+ * $Id: Select.c,v 1.21 2002/07/17 09:21:51 simonmar Exp $
*
- * (c) The GHC Team 1995-1999
+ * (c) The GHC Team 1995-2002
*
* Support for concurrent non-blocking I/O and thread waiting.
*
# include <windows.h>
# endif
+#include <errno.h>
+#include <string.h>
+
/* last timestamp */
nat timestamp = 0;
/* -----------------------------------------------------------------------------
- * $Id: Signals.c,v 1.25 2002/07/02 12:24:48 simonmar Exp $
+ * $Id: Signals.c,v 1.26 2002/07/17 09:21:51 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#include "StablePriv.h"
#ifdef alpha_TARGET_ARCH
-#include <machine/fpu.h>
+# include <machine/fpu.h>
#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
+#include <stdlib.h>
+
#ifndef mingw32_TARGET_OS
#ifndef PAR
* -------------------------------------------------------------------------- */
StgInt
-stg_sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
+stg_sig_install(StgInt sig, StgInt spi, StgStablePtr handler, void *mask)
{
sigset_t signals;
struct sigaction action;
barf("stg_sig_install: bad spi");
}
- if (mask != 0)
- action.sa_mask = *mask;
+ if (mask != NULL)
+ action.sa_mask = *(sigset_t *)mask;
else
sigemptyset(&action.sa_mask);
/* -----------------------------------------------------------------------------
- * $Id: StgPrimFloat.c,v 1.8 2001/08/14 13:40:09 sewardj Exp $
+ * $Id: StgPrimFloat.c,v 1.9 2002/07/17 09:21:51 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#include "PosixSource.h"
#include "Rts.h"
+#include <math.h>
+
/*
* Encoding and decoding Doubles. Code based on the HBC code
* (lib/fltcode.c).
/* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.66 2002/05/14 08:17:38 matthewc Exp $
+ * $Id: Storage.c,v 1.67 2002/07/17 09:21:51 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#include "RetainerProfile.h" // for counting memory blocks (memInventory)
+#include <stdlib.h>
+#include <string.h>
+
#ifdef darwin_TARGET_OS
#include <mach-o/getsect.h>
unsigned long macho_etext = 0;
#include "PosixSource.h"
#include "ThreadLabels.h"
+#include <stdlib.h>
+
HashTable * threadLabels = NULL;
void
/* -----------------------------------------------------------------------------
- * $Id: ErrorHdr.c,v 1.2 1998/12/02 13:29:11 simonm Exp $
+ * $Id: ErrorHdr.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
#include "Rts.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
void
ErrorHdrHook (long fd)
{
/* -----------------------------------------------------------------------------
- * $Id: MallocFail.c,v 1.2 1998/12/02 13:29:12 simonm Exp $
+ * $Id: MallocFail.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
#include "Rts.h"
+#include <stdio.h>
+
void
MallocFailHook (lnat request_size /* in bytes */, char *msg)
{
/* -----------------------------------------------------------------------------
- * $Id: NoRunnableThreads.c,v 1.2 1998/12/02 13:29:13 simonm Exp $
+ * $Id: NoRunnableThreads.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
#include "Rts.h"
+#include <stdio.h>
+
/*
Hook to invoke when there's nothing left on the runnable threads
queue {\em and} we've got nothing to wait for. The value
/* -----------------------------------------------------------------------------
- * $Id: OutOfHeap.c,v 1.3 1999/06/29 13:06:45 panne Exp $
+ * $Id: OutOfHeap.c,v 1.4 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
* ---------------------------------------------------------------------------*/
#include "Rts.h"
+#include <stdio.h>
void
OutOfHeapHook (lnat request_size, lnat heap_size) /* both sizes in bytes */
/* -----------------------------------------------------------------------------
- * $Id: PatErrorHdr.c,v 1.2 1998/12/02 13:29:15 simonm Exp $
+ * $Id: PatErrorHdr.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
#include "Rts.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
void
PatErrorHdrHook (long fd)
{
/* -----------------------------------------------------------------------------
- * $Id: RtsOpts.c,v 1.1 2001/10/01 11:36:29 simonmar Exp $
+ * $Id: RtsOpts.c,v 1.2 2002/07/17 09:21:51 simonmar Exp $
*
* Default RTS options.
*
#include "Rts.h"
+#include <stdlib.h>
+
// Default RTS options can be given by providing an alternate
// definition for this variable, pointing to a string of RTS options.
char *ghc_rts_opts = NULL;
/* -----------------------------------------------------------------------------
- * $Id: StackOverflow.c,v 1.2 1998/12/02 13:29:15 simonm Exp $
+ * $Id: StackOverflow.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
*
* User-overridable RTS hooks.
*
#include "Rts.h"
+#include <stdio.h>
+
void
StackOverflowHook (lnat stack_size) /* in bytes */
{