Subject: Re: shared mips softintr code (reviced)
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Simon Burge <simonb@wasabisystems.com>
List: port-mips
Date: 05/25/2003 16:52:17
Hi Izumi,

Izumi Tsutsui wrote:

> In article <030428211309.M0103555@mirage.ceres.dti.ne.jp>
> I wrote:
> 
> > Ok, I've made a new patch for arc and newsmips with shared
> > mips/mips/softintr.c and mips/include/softintr.h
> > for a start point (works on both NEC-JC94 and NWS-5000).
> 
> I've updated the patch for shared mips softintr code:
> http://www.ceres.dti.ne.jp/~tsutsui/netbsd/mips-softintr-20030524.diff
> 
> This patch includes changes for more other mips ports:
> 
> algor:    tested only P4032 compiles
> arc:      tested and working on NEC-J96A
> cobalt:   not changed (does not have generic softintr yet)
> evbmips:  tested only MALTA compiles
> hpcmips:  tested only GENERIC compiles
> mipsco:   tested only GENERIC compiles
> newsmips: tested and working on NWS-3470D and NWS-5000X
> playstation2: not changed (does not use MIPS_SOFT_INT* for softintr)
> pmax:     tested and working on 3MIN
> sbmips:   not changed (there are MD hooks for softintr)
> sgimips:  tested only GENERIC compiles
> 
> If there is no objection, I'll commit MI mips softintr files
> (mips/*/softintr.[ch]) and changes for working ports
> (arc, newsmips and pmax).

Cool!

Tested on evbmips (PB1000), and works fine there.  I'll switch sbmips
over once you've committed this code.

A couple of suggestions:

 - Call the ipl_si_to_sr array mips_ipl_si_to_sr.

 - Use softintr_slock in softintr_init and softintr_disestablish
   (see evbmips for example).  We should also use the simple lock in
   softintr_dispatch too (see alpha, x86 for example).  I'm not 100%
   sure if we need _both_ splhigh and the simplelock - it seems that
   other ports do, but I thought one of the ideas of using locks was
   that we don't need to use the spl*() calls anymore...

One other minor nit, you don't need to do "#ifdef _KERNEL" if the head
file (softintr.h) isn't installed in /usr/include.

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/