Subject: Re: enabling interrupt in cpu_initclocks(9) rather than cpu_configure(9)
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Simon Burge <simonb@NetBSD.org>
List: tech-kern
Date: 11/15/2006 03:14:33
Izumi Tsutsui wrote:

> In article <061021032925.M0108599@mirage.ceres.dti.ne.jp>
> I wrote:
> 
> > uwe@ptc.spbu.ru wrote:
> > 
> > > If this is a problem for some of the arches than may be we should
> > > reconsider the requirements of where MD code should enable the
> > > interrupts?
> > 
> > I checked 4.4BSD Lite2 sources, then I notice:
> > - configure() is called from cpu_startup() (which is called from main())
> > - initclocks() (which will call cpu_initclocks(9)) is called from main()
> > - there are several initialization and functions between cpu_startup()
> >   and initclocks()
> >   (but I'm not sure if there is anything which requires hardware interrupts)
> > 
> > Nowadays, configure() becomes MI and is called from main(),
> > confiugre() calls MD cpu_configure(), and initclocks() is
> > a part of configure() (and it's called right after cpu_configure()),
> > so I guess the requirements noted in the cpu_configure(9) man page
> > have been changed...
> 
> If there is no objection, I'll also change some MIPS ports
> (which use the CPU_INT5 internal clocks) enabling hardware
> interrupts (by _splnone()) in cpu_initclocks(9) rather than
> cpu_configure(9) to avoid clock interrupts (and softclockint)
> until cpu_initclocks(9) is called, as well as macppc.

It looks like this makes little functional difference for most MIPS
ports - initclocks() is called staight after cpu_configure() in
subr_autoconf.c.  Also, this doesn't look like it needs to be limited to
the CPU_INT5-based clocks - it should work for all clock types, right?

Simon.