summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc/rts/BlockAlloc.c6
-rw-r--r--ghc/rts/BlockAlloc.h4
-rw-r--r--ghc/rts/Capability.c2
-rw-r--r--ghc/rts/Exception.h4
-rw-r--r--ghc/rts/GC.c45
-rw-r--r--ghc/rts/GCCompact.c28
-rw-r--r--ghc/rts/GCCompact.h8
-rw-r--r--ghc/rts/Interpreter.c6
-rw-r--r--ghc/rts/LdvProfile.c4
-rw-r--r--ghc/rts/Printer.c4
-rw-r--r--ghc/rts/ProfHeap.c12
-rw-r--r--ghc/rts/RetainerSet.c4
-rw-r--r--ghc/rts/RtsAPI.c10
-rw-r--r--ghc/rts/RtsFlags.c4
-rw-r--r--ghc/rts/RtsUtils.h7
-rw-r--r--ghc/rts/Schedule.c20
-rw-r--r--ghc/rts/Schedule.h16
-rw-r--r--ghc/rts/Sparks.c10
-rw-r--r--ghc/rts/Stable.c6
-rw-r--r--ghc/rts/Storage.h36
-rw-r--r--ghc/rts/StoragePriv.h4
21 files changed, 119 insertions, 121 deletions
diff --git a/ghc/rts/BlockAlloc.c b/ghc/rts/BlockAlloc.c
index 8e09d0cc5c..63da2a2b63 100644
--- a/ghc/rts/BlockAlloc.c
+++ b/ghc/rts/BlockAlloc.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.16 2003/02/18 05:47:53 sof Exp $
+ * $Id: BlockAlloc.c,v 1.17 2003/11/12 17:49:05 sof Exp $
*
* (c) The GHC Team 1998-2000
*
@@ -44,7 +44,7 @@ void initBlockAllocator(void)
Allocation
-------------------------------------------------------------------------- */
-static inline void
+STATIC_INLINE void
initGroup(nat n, bdescr *head)
{
bdescr *bd;
@@ -194,7 +194,7 @@ allocMegaGroup(nat n)
* pointer to the newly enlarged group p.
*/
-static inline bdescr *
+STATIC_INLINE bdescr *
coalesce(bdescr *p)
{
bdescr *bd, *q;
diff --git a/ghc/rts/BlockAlloc.h b/ghc/rts/BlockAlloc.h
index 504e954c98..32db94805a 100644
--- a/ghc/rts/BlockAlloc.h
+++ b/ghc/rts/BlockAlloc.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.h,v 1.9 2001/05/03 16:32:55 simonmar Exp $
+ * $Id: BlockAlloc.h,v 1.10 2003/11/12 17:49:06 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -28,7 +28,7 @@ extern void freeChain(bdescr *p);
#define WORDS_PER_MBLOCK (BLOCKS_PER_MBLOCK * BLOCK_SIZE_W)
-static inline nat
+INLINE_HEADER nat
round_to_mblocks(nat words)
{
if (words > WORDS_PER_MBLOCK) {
diff --git a/ghc/rts/Capability.c b/ghc/rts/Capability.c
index d748aee7e6..a1c7ea3269 100644
--- a/ghc/rts/Capability.c
+++ b/ghc/rts/Capability.c
@@ -208,7 +208,7 @@ void releaseCapability(Capability* cap
fprintf(stderr,"worker thread (%p): released capability\n",
osThreadId()));
#endif
- return;
+ return;
}
#if defined(RTS_SUPPORTS_THREADS)
diff --git a/ghc/rts/Exception.h b/ghc/rts/Exception.h
index a2e0027d22..291ad20b6b 100644
--- a/ghc/rts/Exception.h
+++ b/ghc/rts/Exception.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Exception.h,v 1.6 2003/07/12 00:11:20 sof Exp $
+ * $Id: Exception.h,v 1.7 2003/11/12 17:49:07 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
@@ -14,7 +14,7 @@ extern const StgRetInfoTable stg_unblockAsyncExceptionszh_ret_info;
* indefinitely). Interruptible threads can be sent an exception with
* killThread# even if they have async exceptions blocked.
*/
-static __inline__ int
+INLINE_HEADER int
interruptible(StgTSO *t)
{
switch (t->why_blocked) {
diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c
index 0a65b327d3..fbc494686a 100644
--- a/ghc/rts/GC.c
+++ b/ghc/rts/GC.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.162 2003/10/24 11:45:40 simonmar Exp $
+ * $Id: GC.c,v 1.163 2003/11/12 17:49:07 sof Exp $
*
* (c) The GHC Team 1998-2003
*
@@ -190,31 +190,31 @@ static rtsBool mark_stack_overflowed;
static bdescr *oldgen_scan_bd;
static StgPtr oldgen_scan;
-static inline rtsBool
+STATIC_INLINE rtsBool
mark_stack_empty(void)
{
return mark_sp == mark_stack;
}
-static inline rtsBool
+STATIC_INLINE rtsBool
mark_stack_full(void)
{
return mark_sp >= mark_splim;
}
-static inline void
+STATIC_INLINE void
reset_mark_stack(void)
{
mark_sp = mark_stack;
}
-static inline void
+STATIC_INLINE void
push_mark_stack(StgPtr p)
{
*mark_sp++ = p;
}
-static inline StgPtr
+STATIC_INLINE StgPtr
pop_mark_stack(void)
{
return *--mark_sp;
@@ -1294,6 +1294,7 @@ traverse_weak_ptr_list(void)
default:
barf("traverse_weak_ptr_list");
+ return rtsTrue;
}
}
@@ -1413,7 +1414,7 @@ mark_root(StgClosure **root)
*root = evacuate(*root);
}
-static __inline__ void
+STATIC_INLINE void
upd_evacuee(StgClosure *p, StgClosure *dest)
{
// Source object must be in from-space:
@@ -1425,7 +1426,7 @@ upd_evacuee(StgClosure *p, StgClosure *dest)
}
-static __inline__ StgClosure *
+STATIC_INLINE StgClosure *
copy(StgClosure *src, nat size, step *stp)
{
P_ to, from, dest;
@@ -1531,7 +1532,7 @@ copyPart(StgClosure *src, nat size_to_reserve, nat size_to_copy, step *stp)
-------------------------------------------------------------------------- */
-static inline void
+STATIC_INLINE void
evacuate_large(StgPtr p)
{
bdescr *bd = Bdescr(p);
@@ -2215,7 +2216,7 @@ scavenge_large_srt_bitmap( StgLargeSRT *large_srt )
* srt field in the info table. That's ok, because we'll
* never dereference it.
*/
-static inline void
+STATIC_INLINE void
scavenge_srt (StgClosure **srt, nat srt_bitmap)
{
nat bitmap;
@@ -2255,7 +2256,7 @@ scavenge_srt (StgClosure **srt, nat srt_bitmap)
}
-static inline void
+STATIC_INLINE void
scavenge_thunk_srt(const StgInfoTable *info)
{
StgThunkInfoTable *thunk_info;
@@ -2264,7 +2265,7 @@ scavenge_thunk_srt(const StgInfoTable *info)
scavenge_srt((StgClosure **)thunk_info->srt, thunk_info->i.srt_bitmap);
}
-static inline void
+STATIC_INLINE void
scavenge_fun_srt(const StgInfoTable *info)
{
StgFunInfoTable *fun_info;
@@ -2273,7 +2274,7 @@ scavenge_fun_srt(const StgInfoTable *info)
scavenge_srt((StgClosure **)fun_info->srt, fun_info->i.srt_bitmap);
}
-static inline void
+STATIC_INLINE void
scavenge_ret_srt(const StgInfoTable *info)
{
StgRetInfoTable *ret_info;
@@ -2315,7 +2316,7 @@ scavengeTSO (StgTSO *tso)
in PAPs.
-------------------------------------------------------------------------- */
-static inline StgPtr
+STATIC_INLINE StgPtr
scavenge_arg_block (StgFunInfoTable *fun_info, StgClosure **args)
{
StgPtr p;
@@ -2350,7 +2351,7 @@ scavenge_arg_block (StgFunInfoTable *fun_info, StgClosure **args)
return p;
}
-static inline StgPtr
+STATIC_INLINE StgPtr
scavenge_PAP (StgPAP *pap)
{
StgPtr p;
@@ -3673,7 +3674,7 @@ scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, nat size )
}
}
-static inline StgPtr
+STATIC_INLINE StgPtr
scavenge_small_bitmap (StgPtr p, nat size, StgWord bitmap)
{
while (size > 0) {
@@ -4221,20 +4222,20 @@ done_traversing:
void *gap_start, *next_gap_start, *gap_end;
nat chunk_size;
- next_gap_start = (void *)gap + sizeof(StgUpdateFrame);
+ next_gap_start = (void *)((unsigned char*)gap + sizeof(StgUpdateFrame));
sp = next_gap_start;
while ((StgPtr)gap > tso->sp) {
// we're working in *bytes* now...
gap_start = next_gap_start;
- gap_end = gap_start - gap->gap_size * sizeof(W_);
+ gap_end = (void*) ((unsigned char*)gap_start - gap->gap_size * sizeof(W_));
gap = gap->next_gap;
- next_gap_start = (void *)gap + sizeof(StgUpdateFrame);
+ next_gap_start = (void *)((unsigned char*)gap + sizeof(StgUpdateFrame));
- chunk_size = gap_end - next_gap_start;
- sp -= chunk_size;
+ chunk_size = (unsigned char*)gap_end - (unsigned char*)next_gap_start;
+ (unsigned char*)sp -= chunk_size;
memmove(sp, next_gap_start, chunk_size);
}
@@ -4295,7 +4296,7 @@ printMutableList(generation *gen)
fputc('\n', stderr);
}
-static inline rtsBool
+STATIC_INLINE rtsBool
maybeLarge(StgClosure *closure)
{
StgInfoTable *info = get_itbl(closure);
diff --git a/ghc/rts/GCCompact.c b/ghc/rts/GCCompact.c
index 958a564d5b..860c5318ad 100644
--- a/ghc/rts/GCCompact.c
+++ b/ghc/rts/GCCompact.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: GCCompact.c,v 1.17 2003/10/22 11:11:59 simonmar Exp $
+ * $Id: GCCompact.c,v 1.18 2003/11/12 17:49:07 sof Exp $
*
* (c) The GHC Team 2001
*
@@ -21,9 +21,8 @@
// Turn off inlining when debugging - it obfuscates things
#ifdef DEBUG
-#define INLINE
-#else
-#define INLINE inline
+# undef STATIC_INLINE
+# define STATIC_INLINE static
#endif
/* -----------------------------------------------------------------------------
@@ -48,7 +47,7 @@
except for the info pointer.
-------------------------------------------------------------------------- */
-static INLINE void
+STATIC_INLINE void
thread( StgPtr p )
{
StgPtr q = (StgPtr)*p;
@@ -71,7 +70,7 @@ thread( StgPtr p )
}
}
-static INLINE void
+STATIC_INLINE void
unthread( StgPtr p, StgPtr free )
{
StgPtr q = (StgPtr)*p, r;
@@ -85,7 +84,7 @@ unthread( StgPtr p, StgPtr free )
*p = (StgWord)q;
}
-static INLINE StgInfoTable *
+STATIC_INLINE StgInfoTable *
get_threaded_info( StgPtr p )
{
StgPtr q = (P_)GET_INFO((StgClosure *)p);
@@ -100,7 +99,7 @@ get_threaded_info( StgPtr p )
// A word-aligned memmove will be faster for small objects than libc's or gcc's.
// Remember, the two regions *might* overlap, but: to <= from.
-static INLINE void
+STATIC_INLINE void
move(StgPtr to, StgPtr from, nat size)
{
for(; size > 0; --size) {
@@ -108,7 +107,7 @@ move(StgPtr to, StgPtr from, nat size)
}
}
-static INLINE nat
+STATIC_INLINE nat
obj_sizeW( StgClosure *p, StgInfoTable *info )
{
switch (info->type) {
@@ -184,7 +183,7 @@ thread_static( StgClosure* p )
}
}
-static INLINE void
+STATIC_INLINE void
thread_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, nat size )
{
nat i, b;
@@ -207,7 +206,7 @@ thread_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, nat size )
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_arg_block (StgFunInfoTable *fun_info, StgClosure **args)
{
StgPtr p;
@@ -355,7 +354,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_PAP (StgPAP *pap)
{
StgPtr p;
@@ -399,7 +398,7 @@ thread_PAP (StgPAP *pap)
return p;
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_AP_STACK (StgAP_STACK *ap)
{
thread((StgPtr)&ap->fun);
@@ -480,7 +479,7 @@ update_fwd_large( bdescr *bd )
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_obj (StgInfoTable *info, StgPtr p)
{
switch (info->type) {
@@ -610,6 +609,7 @@ thread_obj (StgInfoTable *info, StgPtr p)
default:
barf("update_fwd: unknown/strange object %d", (int)(info->type));
+ return NULL;
}
}
diff --git a/ghc/rts/GCCompact.h b/ghc/rts/GCCompact.h
index 4de4bf3293..c70993712a 100644
--- a/ghc/rts/GCCompact.h
+++ b/ghc/rts/GCCompact.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: GCCompact.h,v 1.2 2001/07/30 13:06:18 simonmar Exp $
+ * $Id: GCCompact.h,v 1.3 2003/11/12 17:49:07 sof Exp $
*
* (c) The GHC Team 1998-1999
*
@@ -7,7 +7,7 @@
*
* ---------------------------------------------------------------------------*/
-static inline void
+INLINE_HEADER void
mark(StgPtr p, bdescr *bd)
{
nat offset_within_block = p - bd->start; // in words
@@ -17,7 +17,7 @@ mark(StgPtr p, bdescr *bd)
*bitmap_word |= bit_mask;
}
-static inline void
+INLINE_HEADER void
unmark(StgPtr p, bdescr *bd)
{
nat offset_within_block = p - bd->start; // in words
@@ -27,7 +27,7 @@ unmark(StgPtr p, bdescr *bd)
*bitmap_word &= ~bit_mask;
}
-static inline int
+INLINE_HEADER int
is_marked(StgPtr p, bdescr *bd)
{
nat offset_within_block = p - bd->start; // in words
diff --git a/ghc/rts/Interpreter.c b/ghc/rts/Interpreter.c
index 888f3b8f2d..cc18059f22 100644
--- a/ghc/rts/Interpreter.c
+++ b/ghc/rts/Interpreter.c
@@ -63,13 +63,13 @@
return (retcode);
-static inline StgPtr
+STATIC_INLINE StgPtr
allocate_UPD (int n_words)
{
return allocate(stg_max(sizeofW(StgHeader)+MIN_UPD_SIZE, n_words));
}
-static inline StgPtr
+STATIC_INLINE StgPtr
allocate_NONUPD (int n_words)
{
return allocate(stg_max(sizeofW(StgHeader)+MIN_NONUPD_SIZE, n_words));
@@ -1212,7 +1212,7 @@ run_BCO:
#endif
// And restart the thread again, popping the RET_DYN frame.
- cap = (Capability *)((void *)resumeThread(tok,rtsFalse) - sizeof(StgFunTable));
+ cap = (Capability *)((void *)((unsigned char*)resumeThread(tok,rtsFalse) - sizeof(StgFunTable)));
LOAD_STACK_POINTERS;
Sp += ret_dyn_size;
diff --git a/ghc/rts/LdvProfile.c b/ghc/rts/LdvProfile.c
index 31777e5557..7db8903831 100644
--- a/ghc/rts/LdvProfile.c
+++ b/ghc/rts/LdvProfile.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: LdvProfile.c,v 1.5 2003/02/22 04:51:51 sof Exp $
+ * $Id: LdvProfile.c,v 1.6 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
@@ -94,7 +94,7 @@ LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p )
* closure. Returns the size of the closure, including the profiling
* header portion, so that the caller can find the next closure.
* ----------------------------------------------------------------------- */
-static inline nat
+STATIC_INLINE nat
processHeapClosureForDead( StgClosure *c )
{
nat size;
diff --git a/ghc/rts/Printer.c b/ghc/rts/Printer.c
index 92c9548fe3..9f36146c41 100644
--- a/ghc/rts/Printer.c
+++ b/ghc/rts/Printer.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.61 2003/10/16 20:54:12 sof Exp $
+ * $Id: Printer.c,v 1.62 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 1994-2000.
*
@@ -72,7 +72,7 @@ void printObj( StgClosure *obj )
printClosure(obj);
}
-static inline void
+STATIC_INLINE void
printStdObjHdr( StgClosure *obj, char* tag )
{
fprintf(stderr,"%s(",tag);
diff --git a/ghc/rts/ProfHeap.c b/ghc/rts/ProfHeap.c
index a5cddfd1ab..837591bf46 100644
--- a/ghc/rts/ProfHeap.c
+++ b/ghc/rts/ProfHeap.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: ProfHeap.c,v 1.49 2003/10/24 14:45:38 stolz Exp $
+ * $Id: ProfHeap.c,v 1.50 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 1998-2003
*
@@ -72,7 +72,7 @@ typedef struct _counter {
struct _counter *next;
} counter;
-static inline void
+STATIC_INLINE void
initLDVCtr( counter *ctr )
{
ctr->c.ldv.prim = 0;
@@ -177,7 +177,7 @@ static char *type_names[] = {
* the band to which this closure's heap space is attributed in the
* heap profile.
* ------------------------------------------------------------------------- */
-static inline void *
+STATIC_INLINE void *
closureIdentity( StgClosure *p )
{
switch (RtsFlags.ProfFlags.doHeapProfile) {
@@ -215,14 +215,14 @@ closureIdentity( StgClosure *p )
* Profiling type predicates
* ----------------------------------------------------------------------- */
#ifdef PROFILING
-static inline rtsBool
+STATIC_INLINE rtsBool
doingLDVProfiling( void )
{
return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV
|| RtsFlags.ProfFlags.bioSelector != NULL);
}
-static inline rtsBool
+STATIC_INLINE rtsBool
doingRetainerProfiling( void )
{
return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER
@@ -304,7 +304,7 @@ LDV_recordDead( StgClosure *c, nat size )
/* --------------------------------------------------------------------------
* Initialize censuses[era];
* ----------------------------------------------------------------------- */
-static inline void
+STATIC_INLINE void
initEra(Census *census)
{
census->hash = allocHashTable();
diff --git a/ghc/rts/RetainerSet.c b/ghc/rts/RetainerSet.c
index 6834676daf..45b74b08a4 100644
--- a/ghc/rts/RetainerSet.c
+++ b/ghc/rts/RetainerSet.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: RetainerSet.c,v 1.4 2003/03/25 17:58:49 sof Exp $
+ * $Id: RetainerSet.c,v 1.5 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
@@ -52,7 +52,7 @@ RetainerSet rs_MANY = {
/* -----------------------------------------------------------------------------
* calculate the size of a RetainerSet structure
* -------------------------------------------------------------------------- */
-static inline size_t
+STATIC_INLINE size_t
sizeofRetainerSet( int elems )
{
return (sizeof(RetainerSet) + elems * sizeof(retainer));
diff --git a/ghc/rts/RtsAPI.c b/ghc/rts/RtsAPI.c
index 8d1cfd9986..2052f3d4f0 100644
--- a/ghc/rts/RtsAPI.c
+++ b/ghc/rts/RtsAPI.c
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.49 2003/10/01 10:49:07 wolfgang Exp $
+ * $Id: RtsAPI.c,v 1.50 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 1998-2001
*
@@ -76,10 +76,10 @@ rts_mkInt32 (HsInt32 i)
HaskellObj
rts_mkInt64 (HsInt64 i)
{
- long long *tmp;
+ llong *tmp;
StgClosure *p = (StgClosure *)allocate(CONSTR_sizeW(0,2));
SET_HDR(p, I64zh_con_info, CCS_SYSTEM);
- tmp = (long long*)&(p->payload[0]);
+ tmp = (llong*)&(p->payload[0]);
*tmp = (StgInt64)i;
return p;
}
@@ -126,12 +126,12 @@ rts_mkWord32 (HsWord32 w)
HaskellObj
rts_mkWord64 (HsWord64 w)
{
- unsigned long long *tmp;
+ ullong *tmp;
StgClosure *p = (StgClosure *)allocate(CONSTR_sizeW(0,2));
/* see mk_Int8 comment */
SET_HDR(p, W64zh_con_info, CCS_SYSTEM);
- tmp = (unsigned long long*)&(p->payload[0]);
+ tmp = (ullong*)&(p->payload[0]);
*tmp = (StgWord64)w;
return p;
}
diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c
index 6de188a1b2..1793104674 100644
--- a/ghc/rts/RtsFlags.c
+++ b/ghc/rts/RtsFlags.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.71 2003/10/31 16:48:45 sof Exp $
+ * $Id: RtsFlags.c,v 1.72 2003/11/12 17:49:09 sof Exp $
*
* (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
@@ -457,7 +457,7 @@ usage_text[] = {
0
};
-static inline rtsBool
+STATIC_INLINE rtsBool
strequal(const char *a, const char * b)
{
return(strcmp(a, b) == 0);
diff --git a/ghc/rts/RtsUtils.h b/ghc/rts/RtsUtils.h
index 2adcf355a7..4f2b296981 100644
--- a/ghc/rts/RtsUtils.h
+++ b/ghc/rts/RtsUtils.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: RtsUtils.h,v 1.18 2003/09/26 12:11:18 panne Exp $
+ * $Id: RtsUtils.h,v 1.19 2003/11/12 17:49:10 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -13,7 +13,7 @@ extern void *stgReallocBytes(void *p, int n, char *msg);
extern void *stgCallocBytes(int n, int m, char *msg);
extern void stgFree(void* p);
-extern void barf(char *s, ...) __attribute__((__noreturn__)) ;
+extern void barf(char *s, ...) GNU_ATTRIBUTE(__noreturn__);
extern void belch(char *s, ...);
extern void prog_belch(char *s, ...);
@@ -26,9 +26,6 @@ extern void resetNonBlockingFd(int fd);
extern nat stg_strlen(char *str);
-/*Defined in Main.c, but made visible here*/
-extern void stg_exit(int n) __attribute__((noreturn));
-
char *time_str(void);
char *ullong_format_string(ullong, char *, rtsBool);
diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c
index 787f8ae8c9..07e1ab40fe 100644
--- a/ghc/rts/Schedule.c
+++ b/ghc/rts/Schedule.c
@@ -1,5 +1,5 @@
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.179 2003/10/05 20:18:36 panne Exp $
+ * $Id: Schedule.c,v 1.180 2003/11/12 17:49:10 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
@@ -960,7 +960,7 @@ schedule( StgMainThread *mainThread USED_WHEN_RTS_SUPPORTS_THREADS,
/* in a GranSim setup the TSO stays on the run queue */
t = CurrentTSO;
/* Take a thread from the run queue. */
- t = POP_RUN_QUEUE(); // take_off_run_queue(t);
+ POP_RUN_QUEUE(t); // take_off_run_queue(t);
IF_DEBUG(gran,
fprintf(stderr, "GRAN: About to run current thread, which is\n");
@@ -1067,7 +1067,7 @@ schedule( StgMainThread *mainThread USED_WHEN_RTS_SUPPORTS_THREADS,
ASSERT(run_queue_hd != END_TSO_QUEUE);
/* Take a thread from the run queue, if we have work */
- t = POP_RUN_QUEUE(); // take_off_run_queue(END_TSO_QUEUE);
+ POP_RUN_QUEUE(t); // take_off_run_queue(END_TSO_QUEUE);
IF_DEBUG(sanity,checkTSO(t));
/* ToDo: write something to the log-file
@@ -1113,7 +1113,7 @@ schedule( StgMainThread *mainThread USED_WHEN_RTS_SUPPORTS_THREADS,
/* grab a thread from the run queue */
ASSERT(run_queue_hd != END_TSO_QUEUE);
- t = POP_RUN_QUEUE();
+ POP_RUN_QUEUE(t);
// Sanity check the thread we're about to run. This can be
// expensive if there is lots of thread switching going on...
IF_DEBUG(sanity,checkTSO(t));
@@ -1764,7 +1764,7 @@ suspendThread( StgRegTable *reg,
/* assume that *reg is a pointer to the StgRegTable part
* of a Capability.
*/
- cap = (Capability *)((void *)reg - sizeof(StgFunTable));
+ cap = (Capability *)((void *)((unsigned char*)reg - sizeof(StgFunTable)));
ACQUIRE_LOCK(&sched_mutex);
@@ -2759,7 +2759,7 @@ threadStackOverflow(StgTSO *tso)
if (tso->stack_size >= tso->max_stack_size) {
IF_DEBUG(gc,
- belch("@@ threadStackOverflow of TSO %d (%p): stack too large (now %ld; max is %ld",
+ belch("@@ threadStackOverflow of TSO %d (%p): stack too large (now %ld; max is %ld)",
tso->id, tso, tso->stack_size, tso->max_stack_size);
/* If we're debugging, just print out the top of the stack */
printStackChunk(tso->sp, stg_min(tso->stack+tso->stack_size,
@@ -2831,12 +2831,12 @@ threadStackOverflow(StgTSO *tso)
------------------------------------------------------------------------ */
#if defined(GRAN)
-static inline void
+STATIC_INLINE void
unblockCount ( StgBlockingQueueElement *bqe, StgClosure *node )
{
}
#elif defined(PAR)
-static inline void
+STATIC_INLINE void
unblockCount ( StgBlockingQueueElement *bqe, StgClosure *node )
{
/* write RESUME events to log file and
@@ -2972,7 +2972,7 @@ unblockOneLocked(StgTSO *tso)
#endif
#if defined(GRAN) || defined(PAR)
-inline StgBlockingQueueElement *
+INLINE_ME StgBlockingQueueElement *
unblockOne(StgBlockingQueueElement *bqe, StgClosure *node)
{
ACQUIRE_LOCK(&sched_mutex);
@@ -2981,7 +2981,7 @@ unblockOne(StgBlockingQueueElement *bqe, StgClosure *node)
return bqe;
}
#else
-inline StgTSO *
+INLINE_ME StgTSO *
unblockOne(StgTSO *tso)
{
ACQUIRE_LOCK(&sched_mutex);
diff --git a/ghc/rts/Schedule.h b/ghc/rts/Schedule.h
index da4a010226..3dcfcf491e 100644
--- a/ghc/rts/Schedule.h
+++ b/ghc/rts/Schedule.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Schedule.h,v 1.41 2003/10/01 10:57:43 wolfgang Exp $
+ * $Id: Schedule.h,v 1.42 2003/11/12 17:49:11 sof Exp $
*
* (c) The GHC Team 1998-1999
*
@@ -258,17 +258,17 @@ void labelThread(StgPtr tso, char *label);
/* Pop the first thread off the runnable queue.
*/
-#define POP_RUN_QUEUE() \
- ({ StgTSO *t = run_queue_hd; \
- if (t != END_TSO_QUEUE) { \
- run_queue_hd = t->link; \
- t->link = END_TSO_QUEUE; \
+#define POP_RUN_QUEUE(pt) \
+ do { StgTSO *__tmp_t = run_queue_hd; \
+ if (__tmp_t != END_TSO_QUEUE) { \
+ run_queue_hd = __tmp_t->link; \
+ __tmp_t->link = END_TSO_QUEUE; \
if (run_queue_hd == END_TSO_QUEUE) { \
run_queue_tl = END_TSO_QUEUE; \
} \
} \
- t; \
- })
+ pt = __tmp_t; \
+ } while(0)
/* Add a thread to the end of the blocked queue.
*/
diff --git a/ghc/rts/Sparks.c b/ghc/rts/Sparks.c
index 4b447b6292..21dbdc98bb 100644
--- a/ghc/rts/Sparks.c
+++ b/ghc/rts/Sparks.c
@@ -1,5 +1,5 @@
/* ---------------------------------------------------------------------------
- * $Id: Sparks.c,v 1.6 2003/03/25 17:58:50 sof Exp $
+ * $Id: Sparks.c,v 1.7 2003/11/12 17:49:11 sof Exp $
*
* (c) The GHC Team, 2000
*
@@ -526,10 +526,10 @@ activateSpark (rtsEvent *event, rtsSparkQ spark)
Granularity info transformers.
Applied to the GRAN_INFO field of a spark.
*/
-static inline nat ID(nat x) { return(x); };
-static inline nat INV(nat x) { return(-x); };
-static inline nat IGNORE(nat x) { return (0); };
-static inline nat RAND(nat x) { return ((random() % MAX_RAND_PRI) + 1); }
+STATIC_INLINE nat ID(nat x) { return(x); };
+STATIC_INLINE nat INV(nat x) { return(-x); };
+STATIC_INLINE nat IGNORE(nat x) { return (0); };
+STATIC_INLINE nat RAND(nat x) { return ((random() % MAX_RAND_PRI) + 1); }
/* NB: size_info and par_info are currently unused (what a shame!) -- HWL */
//@cindex newSpark
diff --git a/ghc/rts/Stable.c b/ghc/rts/Stable.c
index 30a603a8ae..c047469cf5 100644
--- a/ghc/rts/Stable.c
+++ b/ghc/rts/Stable.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Stable.c,v 1.26 2003/06/24 13:45:49 stolz Exp $
+ * $Id: Stable.c,v 1.27 2003/11/12 17:49:11 sof Exp $
*
* (c) The GHC Team, 1998-2002
*
@@ -117,7 +117,7 @@ static HashTable *addrToStableHash = NULL;
#define INIT_SPT_SIZE 64
-static inline void
+STATIC_INLINE void
initFreeList(snEntry *table, nat n, snEntry *free)
{
snEntry *p;
@@ -197,7 +197,7 @@ lookupStableName(StgPtr p)
}
}
-static inline void
+STATIC_INLINE void
freeStableName(snEntry *sn)
{
ASSERT(sn->sn_obj == NULL);
diff --git a/ghc/rts/Storage.h b/ghc/rts/Storage.h
index c938fd8244..fb84740f08 100644
--- a/ghc/rts/Storage.h
+++ b/ghc/rts/Storage.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.52 2003/04/22 16:25:12 simonmar Exp $
+ * $Id: Storage.h,v 1.53 2003/11/12 17:49:11 sof Exp $
*
* (c) The GHC Team, 1998-2002
*
@@ -63,7 +63,7 @@ extern StgPtr allocate ( nat n );
extern StgPtr allocatePinned ( nat n );
extern lnat allocated_bytes ( void );
-static inline rtsBool
+INLINE_HEADER rtsBool
doYouWantToGC( void )
{
return (alloc_blocks >= alloc_blocks_lim);
@@ -129,7 +129,7 @@ extern Mutex sm_mutex;
/* ToDo: shouldn't recordMutable and recordOldToNewPtrs acquire some
* kind of lock in the SMP case?
*/
-static inline void
+INLINE_HEADER void
recordMutable(StgMutClosure *p)
{
bdescr *bd;
@@ -147,7 +147,7 @@ recordMutable(StgMutClosure *p)
}
}
-static inline void
+INLINE_HEADER void
recordOldToNewPtrs(StgMutClosure *p)
{
bdescr *bd;
@@ -287,7 +287,7 @@ recordOldToNewPtrs(StgMutClosure *p)
}
#if defined(TICKY_TICKY) || defined(PROFILING)
-static inline void
+INLINE_HEADER void
updateWithPermIndirection(const StgInfoTable *info, StgClosure *p1, StgClosure *p2)
{
bdescr *bd;
@@ -363,53 +363,53 @@ void revertCAFs( void );
Macros for calculating how big a closure will be (used during allocation)
-------------------------------------------------------------------------- */
-static __inline__ StgOffset PAP_sizeW ( nat n_args )
+INLINE_HEADER StgOffset PAP_sizeW ( nat n_args )
{ return sizeofW(StgPAP) + n_args; }
-static __inline__ StgOffset AP_STACK_sizeW ( nat size )
+INLINE_HEADER StgOffset AP_STACK_sizeW ( nat size )
{ return sizeofW(StgAP_STACK) + size; }
-static __inline__ StgOffset CONSTR_sizeW( nat p, nat np )
+INLINE_HEADER StgOffset CONSTR_sizeW( nat p, nat np )
{ return sizeofW(StgHeader) + p + np; }
-static __inline__ StgOffset THUNK_SELECTOR_sizeW ( void )
+INLINE_HEADER StgOffset THUNK_SELECTOR_sizeW ( void )
{ return sizeofW(StgHeader) + MIN_UPD_SIZE; }
-static __inline__ StgOffset BLACKHOLE_sizeW ( void )
+INLINE_HEADER StgOffset BLACKHOLE_sizeW ( void )
{ return sizeofW(StgHeader) + MIN_UPD_SIZE; }
/* --------------------------------------------------------------------------
Sizes of closures
------------------------------------------------------------------------*/
-static __inline__ StgOffset sizeW_fromITBL( const StgInfoTable* itbl )
+INLINE_HEADER StgOffset sizeW_fromITBL( const StgInfoTable* itbl )
{ return sizeofW(StgClosure)
+ sizeofW(StgPtr) * itbl->layout.payload.ptrs
+ sizeofW(StgWord) * itbl->layout.payload.nptrs; }
-static __inline__ StgOffset ap_stack_sizeW( StgAP_STACK* x )
+INLINE_HEADER StgOffset ap_stack_sizeW( StgAP_STACK* x )
{ return AP_STACK_sizeW(x->size); }
-static __inline__ StgOffset pap_sizeW( StgPAP* x )
+INLINE_HEADER StgOffset pap_sizeW( StgPAP* x )
{ return PAP_sizeW(x->n_args); }
-static __inline__ StgOffset arr_words_sizeW( StgArrWords* x )
+INLINE_HEADER StgOffset arr_words_sizeW( StgArrWords* x )
{ return sizeofW(StgArrWords) + x->words; }
-static __inline__ StgOffset mut_arr_ptrs_sizeW( StgMutArrPtrs* x )
+INLINE_HEADER StgOffset mut_arr_ptrs_sizeW( StgMutArrPtrs* x )
{ return sizeofW(StgMutArrPtrs) + x->ptrs; }
-static __inline__ StgWord tso_sizeW ( StgTSO *tso )
+INLINE_HEADER StgWord tso_sizeW ( StgTSO *tso )
{ return TSO_STRUCT_SIZEW + tso->stack_size; }
-static __inline__ StgWord bco_sizeW ( StgBCO *bco )
+INLINE_HEADER StgWord bco_sizeW ( StgBCO *bco )
{ return bco->size; }
/* -----------------------------------------------------------------------------
Sizes of stack frames
-------------------------------------------------------------------------- */
-static inline StgWord stack_frame_sizeW( StgClosure *frame )
+INLINE_HEADER StgWord stack_frame_sizeW( StgClosure *frame )
{
StgRetInfoTable *info;
diff --git a/ghc/rts/StoragePriv.h b/ghc/rts/StoragePriv.h
index 556c6129db..84a8fde8d5 100644
--- a/ghc/rts/StoragePriv.h
+++ b/ghc/rts/StoragePriv.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: StoragePriv.h,v 1.24 2002/12/19 14:33:23 simonmar Exp $
+ * $Id: StoragePriv.h,v 1.25 2003/11/12 17:49:11 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -62,7 +62,7 @@ extern lnat calcAllocated ( void );
extern lnat calcLive ( void );
extern lnat calcNeeded ( void );
-static inline void
+INLINE_HEADER void
dbl_link_onto(bdescr *bd, bdescr **list)
{
bd->link = *list;