Mike Pumford | 3 Aug 2006 01:09
Picon
Picon

timecounters was Re:Fixes for acorn32 build after GCC4 upgrade

Ben Harris wrote:

> That will only work so long as timer 1 isn't being used to provide a 
> properly randomised statclock, which it really should be made to do.  It 
> would be better to build something based on timer 0, using the 
> interrupt-pending bit and the hardclock handler to emulate the high-order 
> bits of the timecounter.
> 
Okay, I've now done this (apart from the interrupt pending bit part) 
modelled on the i8254 timer from i386. I don't think the i8254 code 
actually utilises the interrupt pending flag either.

Not done much testing of the patch but ntpd doesn't seem too upset and 
the system still seems to keep reasonable time. Don't know if there are 
any other timecounter tests I can do.

Patch is attached to this message.

Next up a delay() function that doesn't rely on a ridiculously 
inaccurate for loop.

Mike
Index: sys/arch/acorn32/include/types.h
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/include/types.h,v
retrieving revision 1.3
diff -u -r1.3 types.h
--- sys/arch/acorn32/include/types.h	28 Feb 2002 03:17:24 -0000	1.3
(Continue reading)

Ben Harris | 5 Aug 2006 18:20
Picon

Re: timecounters was Re:Fixes for acorn32 build after GCC4 upgrade

On Thu, 3 Aug 2006, Mike Pumford wrote:

> Ben Harris wrote:
> 
> > That will only work so long as timer 1 isn't being used to provide a
> > properly randomised statclock, which it really should be made to do.  It
> > would be better to build something based on timer 0, using the
> > interrupt-pending bit and the hardclock handler to emulate the high-order
> > bits of the timecounter.
> > 
> Okay, I've now done this (apart from the interrupt pending bit part) modelled
> on the i8254 timer from i386. I don't think the i8254 code actually utilises
> the interrupt pending flag either.

In case you hadn't noticed, I've committed that.  I suspect there may be 
circumstances where not checking the interrupt-pending flag will cause it 
to give the wrong answer, but they're likely to be very rare.

--

-- 
Ben Harris                                                   <bjh21 <at> NetBSD.org>
Portmaster, NetBSD/acorn26           <URL:http://www.NetBSD.org/Ports/acorn26/>

Mike Pumford | 5 Aug 2006 20:52
Picon
Picon

Re: timecounters was Re:Fixes for acorn32 build after GCC4 upgrade

Ben Harris wrote:

> In case you hadn't noticed, I've committed that.  I suspect there may be 
> circumstances where not checking the interrupt-pending flag will cause it 
> to give the wrong answer, but they're likely to be very rare.
> 
I did notice thanks for doing that. I thought there was probably a good 
reason for taking the int-pending flag into consideration which is why I 
  left some TODO comments in there as a reminder to myself to revisit it 
later.

Mike


Gmane