diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-08-02 21:32:04 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-08-02 21:32:04 +0000 |
commit | a2a67cd520b9841114d69a87a423dabcb3b4368e (patch) | |
tree | 3dc6bbf53dff5421c14fbeb2d812c1424f2718c0 /includes/RtsExternal.h | |
parent | 5d379cbe65e406d5c3a848fe7fcd090cafbfeb78 (diff) | |
download | haskell-a2a67cd520b9841114d69a87a423dabcb3b4368e.tar.gz |
RTS tidyup sweep, first phase
The first phase of this tidyup is focussed on the header files, and in
particular making sure we are exposinng publicly exactly what we need
to, and no more.
- Rts.h now includes everything that the RTS exposes publicly,
rather than a random subset of it.
- Most of the public header files have moved into subdirectories, and
many of them have been renamed. But clients should not need to
include any of the other headers directly, just #include the main
public headers: Rts.h, HsFFI.h, RtsAPI.h.
- All the headers needed for via-C compilation have moved into the
stg subdirectory, which is self-contained. Most of the headers for
the rest of the RTS APIs have moved into the rts subdirectory.
- I left MachDeps.h where it is, because it is so widely used in
Haskell code.
- I left a deprecated stub for RtsFlags.h in place. The flag
structures are now exposed by Rts.h.
- Various internal APIs are no longer exposed by public header files.
- Various bits of dead code and declarations have been removed
- More gcc warnings are turned on, and the RTS code is more
warning-clean.
- More source files #include "PosixSource.h", and hence only use
standard POSIX (1003.1c-1995) interfaces.
There is a lot more tidying up still to do, this is just the first
pass. I also intend to standardise the names for external RTS APIs
(e.g use the rts_ prefix consistently), and declare the internal APIs
as hidden for shared libraries.
Diffstat (limited to 'includes/RtsExternal.h')
-rw-r--r-- | includes/RtsExternal.h | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/includes/RtsExternal.h b/includes/RtsExternal.h deleted file mode 100644 index 2272b2a429..0000000000 --- a/includes/RtsExternal.h +++ /dev/null @@ -1,129 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * (c) The GHC Team, 1998-2004 - * - * Things visible externally to the RTS - * - * -------------------------------------------------------------------------- */ - -#ifndef RTSEXTERNAL_H -#define RTSEXTERNAL_H - -/* The RTS public interface. */ -#include "RtsAPI.h" - -/* The standard FFI interface */ -#include "HsFFI.h" - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -/* ----------------------------------------------------------------------------- - Functions exported by the RTS for use in Stg code - -------------------------------------------------------------------------- */ - -#if IN_STG_CODE -extern void newCAF(void*); -#else -extern void newCAF(StgClosure*); -#endif - -/* ToDo: remove? */ -extern HsInt genSymZh(void); -extern HsInt resetGenSymZh(void); - -/* Alternate to raise(3) for threaded rts, for OpenBSD */ -extern int genericRaise(int sig); - -/* Concurrency/Exception PrimOps. */ -extern int cmp_thread(StgPtr tso1, StgPtr tso2); -extern int rts_getThreadId(StgPtr tso); -extern int forkOS_createThread ( HsStablePtr entry ); -extern pid_t forkProcess(HsStablePtr *entry); -extern HsBool rtsSupportsBoundThreads(void); -extern StgInt newSpark (StgRegTable *reg, StgClosure *p); -extern void stopTimer(void); -extern unsigned int n_capabilities; - -/* grimy low-level support functions defined in StgPrimFloat.c */ -extern StgDouble __encodeDouble (I_ size, StgByteArray arr, I_ e); -extern StgDouble __2Int_encodeDouble (I_ j_high, I_ j_low, I_ e); -extern StgDouble __int_encodeDouble (I_ j, I_ e); -extern StgDouble __word_encodeDouble (W_ j, I_ e); -extern StgFloat __encodeFloat (I_ size, StgByteArray arr, I_ e); -extern StgFloat __int_encodeFloat (I_ j, I_ e); -extern StgFloat __word_encodeFloat (W_ j, I_ e); -extern StgInt isDoubleNaN(StgDouble d); -extern StgInt isDoubleInfinite(StgDouble d); -extern StgInt isDoubleDenormalized(StgDouble d); -extern StgInt isDoubleNegativeZero(StgDouble d); -extern StgInt isFloatNaN(StgFloat f); -extern StgInt isFloatInfinite(StgFloat f); -extern StgInt isFloatDenormalized(StgFloat f); -extern StgInt isFloatNegativeZero(StgFloat f); - -/* Suspending/resuming threads around foreign calls */ -extern void * suspendThread ( StgRegTable * ); -extern StgRegTable * resumeThread ( void * ); - -/* scheduler stuff */ -extern void stg_scheduleThread (StgRegTable *reg, struct StgTSO_ *tso); - -/* Creating and destroying an adjustor thunk */ -extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr, - char *typeString); -extern void freeHaskellFunctionPtr(void* ptr); - -/* Hpc stuff */ -extern int hs_hpc_module(char *modName, StgWord32 modCount, StgWord32 modHashNo,StgWord64 *tixArr); -// Simple linked list of modules -typedef struct _HpcModuleInfo { - char *modName; // name of module - StgWord32 tickCount; // number of ticks - StgWord32 tickOffset; // offset into a single large .tix Array - StgWord32 hashNo; // Hash number for this module's mix info - StgWord64 *tixArr; // tix Array; local for this module - struct _HpcModuleInfo *next; -} HpcModuleInfo; - -extern HpcModuleInfo *hs_hpc_rootModule(void); - - -#if defined(mingw32_HOST_OS) -extern int rts_InstallConsoleEvent ( int action, StgStablePtr *handler ); -extern void rts_ConsoleHandlerDone ( int ev ); -#else -extern int stg_sig_install (int, int, void *); -#endif - -#if defined(mingw32_HOST_OS) -extern StgInt console_handler; -#else -extern StgInt *signal_handlers; -#endif - -#if defined(mingw32_HOST_OS) -void *getIOManagerEvent (void); -HsWord32 readIOManagerEvent (void); -void sendIOManagerEvent (HsWord32 event); -#else -extern void setIOManagerPipe (int fd); -#endif - -extern void* allocateExec(unsigned int len, void **exec_addr); - -// Breakpoint stuff - -/* ----------------------------------------------------------------------------- - Storage manager stuff exported - -------------------------------------------------------------------------- */ - -extern void performGC(void); -extern void performMajorGC(void); -extern HsInt64 getAllocations( void ); -extern void revertCAFs( void ); -extern void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); -extern void dirty_MVAR(StgRegTable *reg, StgClosure *p); - -#endif /* RTSEXTERNAL_H */ |