Subject: Re: hardclock(9) for cobalt
To: None <port-cobalt@netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-cobalt
Date: 07/30/2004 00:13:14
In article <000701c474ff$6d424a80$0d00a8c0@paq5>
locore32@gaea.ocn.ne.jp wrote:

> KIYOHARA Takashi kiyohara@kk.iij4u.or.jp discovered;
> 
> > As for cobalt, hardclock(9) is called before initclock() is called. Since
> > softclock_si is NULL if callout_reset(9) (or etc...) is called at this
> > time, it will carry out panic.
> 
> It' looks a plain error.
> No interrupt service routine should be called before the entire
> configuration stage is well done and kernel gets ready to serve.

I don't know which timer is used on cobalt for hardclock(),
but I can't see any initialization of such timer under arch/cobalt.
So I guess it is configured by firmware and timer interrupts are
enabled just after _splnone() at the end of cpu_configure(),
which is done before initclocks() is called.

The correct solution is to stop/initialize the timer
during/before cpu_configure() and start it in cpu_initclocks().

If there is no info about the timer on cobalt, we could check if
cpu_initclocks() has been called on calling hardclock()
in cpu_intr() for workaround.
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp