|
From: David B. <dav...@us...> - 2005-01-19 07:59:08
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13271 Modified Files: Tag: sidewinder-branch FastTimes.c Log Message: catching up with HEAD Index: FastTimes.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/FastTimes.c,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** FastTimes.c 17 Jan 2005 01:19:21 -0000 1.5.4.1 --- FastTimes.c 19 Jan 2005 07:58:56 -0000 1.5.4.2 *************** *** 1,3 **** - /* $Id$ */ --- 1,2 ---- *************** *** 92,97 **** static double gScaleMSec = 1.0 / 1000000.0; /* 1 / ( nsec / msec) */ ! static __asm__ UnsignedWide PollRTC(void); ! static __asm__ UnsignedWide PollTBR(void); static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName); --- 91,101 ---- static double gScaleMSec = 1.0 / 1000000.0; /* 1 / ( nsec / msec) */ ! #if (! TARGET_API_MAC_CARBON) ! ! static __asm__ UnsignedWide PollRTC(void); ! static __asm__ UnsignedWide PollTBR(void); ! ! #endif ! static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName); *************** *** 176,183 **** for(tick = TickCount() + 1; tick > TickCount(); ) ; #else for(tick = MyLMGetTicks() + 1; tick > MyLMGetTicks(); ) ; - #endif /* TARGET_API_MAC_CARBON */ /* Poll the selected timer and prepare it (since we have time) */ --- 180,198 ---- for(tick = TickCount() + 1; tick > TickCount(); ) ; + + /* Poll the selected timer and prepare it (since we have time) */ + wide = (*gA2NS)((*gUpTime)()); + usec1 = WideTo64bit(wide); + + /* Wait for the exact 60th tick to roll over */ + while(tick + 60 > TickCount()) + ; + + /* Poll the selected timer again and prepare it */ + wide = (*gA2NS)((*gUpTime)()); + usec2 = WideTo64bit(wide); #else for(tick = MyLMGetTicks() + 1; tick > MyLMGetTicks(); ) ; /* Poll the selected timer and prepare it (since we have time) */ *************** *** 187,197 **** /* Wait for the exact 60th tick to roll over */ - #if TARGET_API_MAC_CARBON - while(tick + 60 > TickCount()) - ; - #else while(tick + 60 > MyLMGetTicks()) ; - #endif /* TARGET_API_MAC_CARBON */ /* Poll the selected timer again and prepare it */ --- 202,207 ---- *************** *** 199,203 **** ((gUseRTC) ? PollRTC() : PollTBR()); usec2 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide); ! /* Calculate a scale value that will give microseconds per second. Remember, there are actually 60.15 ticks in a second, not 60. */ --- 209,214 ---- ((gUseRTC) ? PollRTC() : PollTBR()); usec2 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide); ! #endif /* TARGET_API_MAC_CARBON */ ! /* Calculate a scale value that will give microseconds per second. Remember, there are actually 60.15 ticks in a second, not 60. */ *************** *** 234,237 **** --- 245,251 ---- usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5; } + + #if (! TARGET_API_MAC_CARBON) + else if (gUseTBR) { /* On a recent PowerPC, we poll the TBR directly */ *************** *** 244,247 **** --- 258,264 ---- usec = (double) RTCToNano(wide) * gScaleUSec + 0.5; } + + #endif /* TARGET_API_MAC_CARBON */ + else #endif /* TARGET_CPU_PPC */ *************** *** 276,279 **** --- 293,299 ---- msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5; } + + #if (! TARGET_API_MAC_CARBON) + else if (gUseTBR) { /* On a recent PowerPC, we poll the TBR directly */ *************** *** 286,289 **** --- 306,312 ---- msec = (double) RTCToNano(wide) * gScaleMSec + 0.5; } + + #endif /* ! TARGET_API_MAC_CARBON */ + else #endif /* TARGET_CPU_PPC */ *************** *** 315,318 **** --- 338,343 ---- method = "\pUpTime()"; } + + #if (! TARGET_API_MAC_CARBON) else if (gUseTBR) { /* On a recent PowerPC, we poll the TBR directly */ *************** *** 323,326 **** --- 348,353 ---- method = "\pPowerPC RTC"; } + #endif + else #endif /* TARGET_CPU_PPC */ *************** *** 338,341 **** --- 365,370 ---- #if TARGET_CPU_PPC + #if (! TARGET_API_MAC_CARBON) + __asm__ static UnsignedWide PollRTC_() { entry PollRTC /* Avoid CodeWarrior glue */ *************** *** 368,371 **** --- 397,402 ---- blr } + + #endif /* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ |