Subject: Re: Bummer - NetBSD 2.1 panic - si_refs - update
To: Michael Lorenz <macallan@netbsd.org>
From: Allen Briggs <briggs@netbsd.org>
List: port-macppc
Date: 01/31/2007 16:24:58
On Wed, Jan 31, 2007 at 02:11:50PM -0500, Michael Lorenz wrote:
> I had a further look at macppc's interrupt handling ( pretty much the 
> last non-OpenPIC part I didn't mess with yet ) - first, splhigh doesn't 
> block all interrupts, it explicitly allows IPL_SERIAL and I'm not quite 
> sure what else, the hierarchy enforcement looks weird to say the least.

IPL_SERIAL is an exception to the rule so that serial ports with
very small FIFOs have a prayer of working at high speeds on slower
systems.  Serial drivers (often?) have two portions: the minimal
parts that run at IPL_SERIAL to service the hardware and load/drain
software queues, and the more extensive bits that run at IPL_SOFTSERIAL
and service the software queues.  So IPL_SERIAL is really high priority,
but what you do at IPL_SERIAL is supposed to be ~trivial.

So it's a hack whose function outweighs its lack of form.

> I think in a couple days I'll have something ready that makes 
> interrupts on macppc behave as described in spl(9). If there's any 
> additional documentation on this please let me know. I had a look at 
> other archs' interrupt hierarchies ( sparc(64), shark, prep and a few 
> others ) and they all differ from spl(9) in more or less creative ways, 
> many appear to be derived from macppc. So which one is considered 
> canonical if any?

i386, alpha, and hp300 are some that I'd consider more or less canonical
for different reasons.  Generally, I think you want to follow the
general structure in spl(9), but with exceptions as necessary for
function--like the hard-serial priority.

-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com