From b5b8ae092870b992b42123431be3cc2830af0e72 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 31 Mar 2005 08:59:35 +0000 Subject: [PATCH] [project @ 2005-03-31 08:59:34 by simonmar] Make getourtimeofday() return lnat instead of nat, and propagate changes. --- ghc/rts/Itimer.c | 9 ++++----- ghc/rts/Itimer.h | 2 +- ghc/rts/Schedule.h | 4 ++-- ghc/rts/Select.c | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ghc/rts/Itimer.c b/ghc/rts/Itimer.c index 50be88d..d4592c7 100644 --- a/ghc/rts/Itimer.c +++ b/ghc/rts/Itimer.c @@ -196,13 +196,12 @@ unblock_vtalrm_signal(void) /* gettimeofday() takes around 1us on our 500MHz PIII. Since we're * only calling it 50 times/s, it shouldn't have any great impact. */ -nat +lnat getourtimeofday(void) { struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); - // cast to nat because nat may be 64 bit when int is only 32 bit - return ((nat)tv.tv_sec * TICK_FREQUENCY + - (nat)tv.tv_usec * TICK_FREQUENCY / 1000000); + // cast to lnat because nat may be 64 bit when int is only 32 bit + return ((lnat)tv.tv_sec * TICK_FREQUENCY + + (lnat)tv.tv_usec * TICK_FREQUENCY / 1000000); } - diff --git a/ghc/rts/Itimer.h b/ghc/rts/Itimer.h index 47fbbb6..222baf5 100644 --- a/ghc/rts/Itimer.h +++ b/ghc/rts/Itimer.h @@ -11,7 +11,7 @@ extern int startTicker( nat ms, TickProc handle_tick); extern int stopTicker ( void ); -extern nat getourtimeofday ( void ); +extern lnat getourtimeofday ( void ); #if 0 /* unused */ extern void block_vtalrm_signal ( void ); diff --git a/ghc/rts/Schedule.h b/ghc/rts/Schedule.h index ddc7f56..bd744f0 100644 --- a/ghc/rts/Schedule.h +++ b/ghc/rts/Schedule.h @@ -82,7 +82,7 @@ void awaitEvent(rtsBool wait); /* In Select.c */ * Called from STG : NO * Locks assumed : sched_mutex */ -rtsBool wakeUpSleepingThreads(nat); /* In Select.c */ +rtsBool wakeUpSleepingThreads(lnat); /* In Select.c */ /* wakeBlockedWorkerThread() * @@ -134,7 +134,7 @@ extern int RTS_VAR(context_switch); extern rtsBool RTS_VAR(interrupted); /* In Select.c */ -extern nat RTS_VAR(timestamp); +extern lnat RTS_VAR(timestamp); /* Thread queues. * Locks required : sched_mutex diff --git a/ghc/rts/Select.c b/ghc/rts/Select.c index 418e48c..67ba589 100644 --- a/ghc/rts/Select.c +++ b/ghc/rts/Select.c @@ -35,7 +35,7 @@ #endif /* last timestamp */ -nat timestamp = 0; +lnat timestamp = 0; /* There's a clever trick here to avoid problems when the time wraps * around. Since our maximum delay is smaller than 31 bits of ticks @@ -49,7 +49,7 @@ nat timestamp = 0; * (idea due to Andy Gill). */ rtsBool -wakeUpSleepingThreads(nat ticks) +wakeUpSleepingThreads(lnat ticks) { StgTSO *tso; rtsBool flag = rtsFalse; -- 1.7.10.4