From 1b233f02b31b194227619933b122616c4a580c1d Mon Sep 17 00:00:00 2001 From: bencollins Date: Fri, 10 Aug 2001 03:50:27 -0400 Subject: [silo @ 43] Fix teck counting for javastation, from Pete Zaitcev # --- ChangeLog | 5 +++++ second/timer.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a83864..4eaf6c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 9 23:49:39 EDT 2001 Ben Collins + + * second/timer.c: Fix tick counting for javastation, but + Pete Zaitcev + Mon Jun 18 12:14:58 EDT 2001 Ben Collins * silo/silo.c: Fix suggested options to genromfs, patch from Pieter diff --git a/second/timer.c b/second/timer.c index 053c4fd..839c71c 100644 --- a/second/timer.c +++ b/second/timer.c @@ -269,9 +269,15 @@ int get_ticks (void) switch (architecture) { case sun4c: i = sun4c_timer->count10; break; case sun4m: i = sun4m_timer->count; break; - case sun4p: i = sun4p_lda(PCIC_PHYSADDR+PCIC_SYS_COUNT); - i >>= 2; /* PROLL does this and its timing is sure right */ - break; + case sun4p: + i = sun4p_lda(PCIC_PHYSADDR+PCIC_SYS_COUNT) & 0x7FFFFFFF; + if (i >= lasti) + ticks += i - lasti; + else + ticks += (0x7FFFFFFF - lasti) + i; + lasti = i; + /* 1 increment every 4 CPU clocks (@ 100MHz) */ + return (int) (ticks / 250000); case sun4d: /* I cannot get the normal sun4d timer working during bootstrapping, so unfortunately I can give just a 1000ms precision. */ -- cgit 1.2.3-korg