From 254528e32a007e508bb5967948ba02aa15c7e482 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Sat, 29 Aug 2009 13:28:14 +0000 Subject: [PATCH] Fix incorrectly hidden RTS symbols --- includes/Rts.h | 3 +++ includes/rts/BlockSignals.h | 37 +++++++++++++++++++++++++++++++++++++ includes/rts/PrimFloat.h | 18 ++++++++++++++++++ includes/rts/Utils.h | 21 +++++++++++++++++++++ includes/rts/storage/GC.h | 13 +++++++++++++ rts/Linker.c | 4 ++-- rts/RtsSignals.h | 17 ----------------- rts/RtsUtils.h | 3 --- rts/StgPrimFloat.h | 5 +++-- rts/sm/Storage.h | 14 +------------- 10 files changed, 98 insertions(+), 37 deletions(-) create mode 100644 includes/rts/BlockSignals.h create mode 100644 includes/rts/PrimFloat.h create mode 100644 includes/rts/Utils.h diff --git a/includes/Rts.h b/includes/Rts.h index 74d45f2..59c8c2d 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -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 index 0000000..bc02f5f --- /dev/null +++ b/includes/rts/BlockSignals.h @@ -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 index 0000000..7d137a7 --- /dev/null +++ b/includes/rts/PrimFloat.h @@ -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 index 0000000..1258f6d --- /dev/null +++ b/includes/rts/Utils.h @@ -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 */ diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index df4ba9d..b30582d 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -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; diff --git a/rts/Linker.c b/rts/Linker.c index 6ef0a21..78e112f 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -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) \ diff --git a/rts/RtsSignals.h b/rts/RtsSignals.h index 3b569df..b222272 100644 --- a/rts/RtsSignals.h +++ b/rts/RtsSignals.h @@ -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.) diff --git a/rts/RtsUtils.h b/rts/RtsUtils.h index a47f953..cbf23b0 100644 --- a/rts/RtsUtils.h +++ b/rts/RtsUtils.h @@ -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); diff --git a/rts/StgPrimFloat.h b/rts/StgPrimFloat.h index 13d3a59..f0e466b 100644 --- a/rts/StgPrimFloat.h +++ b/rts/StgPrimFloat.h @@ -15,11 +15,12 @@ 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 */ diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h index ea744a7..573d6bc 100644 --- a/rts/sm/Storage.h +++ b/rts/sm/Storage.h @@ -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); -- 1.7.10.4