#include "rts/Parallel.h"
#include "rts/Hooks.h"
#include "rts/Signals.h"
+#include "rts/BlockSignals.h"
#include "rts/Hpc.h"
#include "rts/Flags.h"
#include "rts/Adjustor.h"
#include "rts/Timer.h"
#include "rts/Stable.h"
#include "rts/TTY.h"
+#include "rts/Utils.h"
+#include "rts/PrimFloat.h"
/* Misc stuff without a home */
DLL_IMPORT_RTS extern char **prog_argv; /* so we can get at these from Haskell */
--- /dev/null
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2009
+ *
+ * RTS signal handling
+ *
+ * Do not #include this file directly: #include "Rts.h" instead.
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef RTS_BLOCKSIGNALS_H
+#define RTS_BLOCKSIGNALS_H
+
+/* Used by runProcess() in the process package
+ */
+
+/*
+ * Function: blockUserSignals()
+ *
+ * Temporarily block the delivery of further console events. Needed to
+ * avoid race conditions when GCing the queue of outstanding handlers or
+ * when emptying the queue by running the handlers.
+ *
+ */
+void blockUserSignals(void);
+
+/*
+ * Function: unblockUserSignals()
+ *
+ * The inverse of blockUserSignals(); re-enable the deliver of console events.
+ */
+void unblockUserSignals(void);
+
+#endif /* RTS_BLOCKSIGNALS_H */
--- /dev/null
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2009
+ *
+ * Primitive floating-point operations
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef RTS_PRIMFLOAT_H
+#define RTS_PRIMFLOAT_H
+
+StgDouble __int_encodeDouble (I_ j, I_ e);
+StgFloat __int_encodeFloat (I_ j, I_ e);
+
+#endif /* RTS_PRIMFLOAT_H */
--- /dev/null
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2009
+ *
+ * RTS external APIs. This file declares everything that the GHC RTS
+ * exposes externally.
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef RTS_UTILS_H
+#define RTS_UTILS_H
+
+// Used in GHC (basicTypes/Unique.lhs, and Data.Unique in the base
+// package.
+HsInt genSymZh(void);
+HsInt resetGenSymZh(void);
+
+#endif /* RTS_UTILS_H */
void * allocateExec(unsigned int len, void **exec_addr);
void freeExec (void *p);
+// Used by GC checks in external .cmm code:
+extern nat alloc_blocks;
+extern nat alloc_blocks_lim;
+
/* -----------------------------------------------------------------------------
Performing Garbage Collection
-------------------------------------------------------------------------- */
void newDynCAF (StgClosure *);
void revertCAFs (void);
+/* -----------------------------------------------------------------------------
+ This is the write barrier for MUT_VARs, a.k.a. IORefs. A
+ MUT_VAR_CLEAN object is not on the mutable list; a MUT_VAR_DIRTY
+ is. When written to, a MUT_VAR_CLEAN turns into a MUT_VAR_DIRTY
+ and is put on the mutable list.
+ -------------------------------------------------------------------------- */
+
+void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
+
/* set to disable CAF garbage collection in GHCi. */
/* (needed when dynamic libraries are used). */
extern rtsBool keepCAFs;
#if !defined(mingw32_HOST_OS)
#define RTS_USER_SIGNALS_SYMBOLS \
SymI_HasProto(setIOManagerPipe) \
- SymI_NeedsProto(blockUserSignals) \
- SymI_NeedsProto(unblockUserSignals)
+ SymI_HasProto(blockUserSignals) \
+ SymI_HasProto(unblockUserSignals)
#else
#define RTS_USER_SIGNALS_SYMBOLS \
SymI_HasProto(sendIOManagerEvent) \
void freeSignalHandlers(void);
/*
- * Function: blockUserSignals()
- *
- * Temporarily block the delivery of further console events. Needed to
- * avoid race conditions when GCing the queue of outstanding handlers or
- * when emptying the queue by running the handlers.
- *
- */
-void blockUserSignals(void);
-
-/*
- * Function: unblockUserSignals()
- *
- * The inverse of blockUserSignals(); re-enable the deliver of console events.
- */
-void unblockUserSignals(void);
-
-/*
* Function: awaitUserSignals()
*
* Wait for the next console event. Currently a NOP (returns immediately.)
void printRtsInfo(void);
-HsInt genSymZh(void);
-HsInt resetGenSymZh(void);
-
/* Alternate to raise(3) for threaded rts, for OpenBSD */
int genericRaise(int sig);
void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl);
void __decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt);
StgDouble __2Int_encodeDouble (I_ j_high, I_ j_low, I_ e);
-StgDouble __int_encodeDouble (I_ j, I_ e);
StgDouble __word_encodeDouble (W_ j, I_ e);
-StgFloat __int_encodeFloat (I_ j, I_ e);
StgFloat __word_encodeFloat (W_ j, I_ e);
+// __int_encodeDouble and __int_encodeFloat are public, declared in
+// includes/rts/PrimFloat.h.
+
#pragma GCC visibility pop
#endif /* STGPRIMFLOAT_H */
extern bdescr * pinned_object_block;
-extern nat alloc_blocks;
-extern nat alloc_blocks_lim;
-
INLINE_HEADER rtsBool
doYouWantToGC( void )
{
}
/* -----------------------------------------------------------------------------
- This is the write barrier for MUT_VARs, a.k.a. IORefs. A
- MUT_VAR_CLEAN object is not on the mutable list; a MUT_VAR_DIRTY
- is. When written to, a MUT_VAR_CLEAN turns into a MUT_VAR_DIRTY
- and is put on the mutable list.
- -------------------------------------------------------------------------- */
-
-void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
-
-/* -----------------------------------------------------------------------------
- Similarly, the write barrier for MVARs
+ The write barrier for MVARs
-------------------------------------------------------------------------- */
void dirty_MVAR(StgRegTable *reg, StgClosure *p);