X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FRts.h;h=32e48d2896bd61908699c9b59c27d92bc634c457;hb=4321b11328a3371fb18636d63211d2bf2b7e62fc;hp=b649e0b4d029a4e3eba9b514b6d984609f479e78;hpb=ed4cd6d403d932026f38608f81c3a8872e38b2ce;p=ghc-hetmet.git diff --git a/ghc/includes/Rts.h b/ghc/includes/Rts.h index b649e0b..32e48d2 100644 --- a/ghc/includes/Rts.h +++ b/ghc/includes/Rts.h @@ -1,5 +1,7 @@ /* ----------------------------------------------------------------------------- - * $Id: Rts.h,v 1.5 1999/01/26 11:12:57 simonm Exp $ + * $Id: Rts.h,v 1.15 2001/11/25 03:56:39 sof Exp $ + * + * (c) The GHC Team, 1998-1999 * * Top-level include file for the RTS itself * @@ -8,13 +10,17 @@ #ifndef RTS_H #define RTS_H -#ifndef NO_REGS -#define NO_REGS /* don't define fixed registers */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef IN_STG_CODE +#define IN_STG_CODE 0 #endif #include "Stg.h" /* ----------------------------------------------------------------------------- - Miscellaneous garbage + RTS Exit codes -------------------------------------------------------------------------- */ #if ! defined(EXIT_SUCCESS) || ! defined(EXIT_FAILURE) @@ -25,30 +31,46 @@ #define EXIT_FAILURE 1 #endif +/* 255 is allegedly used by dynamic linkers to report linking failure */ +#define EXIT_INTERNAL_ERROR 254 +#define EXIT_DEADLOCK 253 +#define EXIT_INTERRUPTED 252 +#define EXIT_HEAPOVERFLOW 251 +#define EXIT_KILLED 250 + +/* ----------------------------------------------------------------------------- + Miscellaneous garbage + -------------------------------------------------------------------------- */ + /* declarations for runtime flags/values */ #define MAX_RTS_ARGS 32 /* ----------------------------------------------------------------------------- - Useful typedefs + Assertions and Debuggery -------------------------------------------------------------------------- */ -typedef unsigned int nat; /* at least 32 bits (like int) */ -typedef unsigned long lnat; /* at least 32 bits */ -typedef unsigned long long ullong; /* at least 32 bits */ - -typedef enum { - rtsFalse = 0, - rtsTrue -} rtsBool; +#define IF_RTSFLAGS(c,s) if (RtsFlags.c) { s; } /* ----------------------------------------------------------------------------- Assertions and Debuggery -------------------------------------------------------------------------- */ -#ifndef DEBUG +#ifdef DEBUG +#define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; } +#else #define IF_DEBUG(c,s) doNothing() +#endif + +#if defined(GRAN) && defined(DEBUG) +#define IF_GRAN_DEBUG(c,s) if (RtsFlags.GranFlags.Debug.c) { s; } #else -#define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; } +#define IF_GRAN_DEBUG(c,s) doNothing() +#endif + +#if defined(PAR) && defined(DEBUG) +#define IF_PAR_DEBUG(c,s) if (RtsFlags.ParFlags.Debug.c) { s; } +#else +#define IF_PAR_DEBUG(c,s) doNothing() #endif /* ----------------------------------------------------------------------------- @@ -72,17 +94,13 @@ typedef enum { Useful macros and inline functions -------------------------------------------------------------------------- */ -/* - * Use this on the RHS of macros which expand to nothing - * to make sure that the macro can be used in a context which - * demands a non-empty statement. - */ - -#define doNothing() do { } while (0) - #define stg_min(a,b) ({typeof(a) _a = (a), _b = (b); _a <= _b ? _a : _b; }) #define stg_max(a,b) ({typeof(a) _a = (a), _b = (b); _a <= _b ? _b : _a; }) -#define UNUSED __attribute__((unused)) +/* -------------------------------------------------------------------------- */ + +#ifdef __cplusplus +} +#endif -#endif RTS_H +#endif /* RTS_H */