Subject: Re: hardclock(9) for cobalt
To: None <port-cobalt@netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-cobalt
Date: 08/02/2004 00:41:09
In article <20040801.221246.74749108.kiyohara@kk.iij4u.or.jp>
kiyohara@kk.iij4u.or.jp wrote:

> > The problem is that softclock is _scheduled_ (not called yet
> > at that time) in hardclock(9) before softclock_si is initialized
> > (i.e. softclock is established) in sys/kern/kern_clock.c:initclocks().
> > Then it may occur if there is any device which uses callout(9).
> 
> I also think so.
> Can I do?

According to cobalt/machdep.c:cpu_intr() and GT-64111 manual
(though cobalt actually uses GT64011), bit 8 on 0x14000c18 is
tested so cobalt uses Timer0 for hardclock(9).

I guess you could control the timer by Timer/Counter control
register (offset 0x864), so you can disable it somewhere
during cpu_configure(9) and enable it again in cpu_initclocks(9).

Maybe we should attach the timer as usual device and initialize
it in the attachment, and functions which enable the timer that
will be called from cpu_initclocks(9) should also be registered
in the attachment (like mvme68k or news68k ;-).
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp