Fix incorrectly hidden RTS symbols
authorSimon Marlow <marlowsd@gmail.com>
Sat, 29 Aug 2009 13:28:14 +0000 (13:28 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Sat, 29 Aug 2009 13:28:14 +0000 (13:28 +0000)
includes/Rts.h
includes/rts/BlockSignals.h [new file with mode: 0644]
includes/rts/PrimFloat.h [new file with mode: 0644]
includes/rts/Utils.h [new file with mode: 0644]
includes/rts/storage/GC.h
rts/Linker.c
rts/RtsSignals.h
rts/RtsUtils.h
rts/StgPrimFloat.h
rts/sm/Storage.h

index 74d45f2..59c8c2d 100644 (file)
@@ -168,6 +168,7 @@ void _assertFail(const char *filename, unsigned int linenum)
 #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"
@@ -180,6 +181,8 @@ void _assertFail(const char *filename, unsigned int linenum)
 #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 */
diff --git a/includes/rts/BlockSignals.h b/includes/rts/BlockSignals.h
new file mode 100644 (file)
index 0000000..bc02f5f
--- /dev/null
@@ -0,0 +1,37 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (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 */
diff --git a/includes/rts/PrimFloat.h b/includes/rts/PrimFloat.h
new file mode 100644 (file)
index 0000000..7d137a7
--- /dev/null
@@ -0,0 +1,18 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (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 */
diff --git a/includes/rts/Utils.h b/includes/rts/Utils.h
new file mode 100644 (file)
index 0000000..1258f6d
--- /dev/null
@@ -0,0 +1,21 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (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 */
index df4ba9d..b30582d 100644 (file)
@@ -182,6 +182,10 @@ lnat    allocatedBytes  ( void );
 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
    -------------------------------------------------------------------------- */
@@ -197,6 +201,15 @@ void newCAF     (StgClosure*);
 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;
index 6ef0a21..78e112f 100644 (file)
@@ -501,8 +501,8 @@ typedef struct _RtsSymbolVal {
 #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) \
index 3b569df..b222272 100644 (file)
@@ -46,23 +46,6 @@ void resetDefaultHandlers(void);
 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.)
index a47f953..cbf23b0 100644 (file)
@@ -43,9 +43,6 @@ void heapCheckFail( void );
 
 void printRtsInfo(void);
 
-HsInt genSymZh(void);
-HsInt resetGenSymZh(void);
-
 /* Alternate to raise(3) for threaded rts, for OpenBSD */
 int genericRaise(int sig);
 
index 13d3a59..f0e466b 100644 (file)
 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 */
index ea744a7..573d6bc 100644 (file)
@@ -25,9 +25,6 @@ void freeStorage(void);
 
 extern bdescr * pinned_object_block;
 
-extern nat alloc_blocks;
-extern nat alloc_blocks_lim;
-
 INLINE_HEADER rtsBool
 doYouWantToGC( void )
 {
@@ -114,16 +111,7 @@ recordMutableLock(StgClosure *p)
 }
 
 /* -----------------------------------------------------------------------------
-   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);