Subject: Re: VAX port needs virtualized interrupt levels
To: None <thorpej@zembu.com>
From: Anders Magnusson <ragge@ludd.luth.se>
List: port-vax
Date: 04/15/2001 12:38:36
> This is mostly a warning message...
> 
> The VAX port is seriously broken :-)
> 
> I notices this while working on my splimp purge (there will be a message
> posted to tech-kern shortly about this).  But the short version is that
> the VAX port was using splimp to block Unibus interrupts when it really
> should be using e.g. splnet, splbio, etc. as the symbolic names for the
> interrupt levels, and using some other mechanism to map them to the actual
> hardware interrupt level.
> 
> I.e. this:
> 
> #define splbio()        _splraise(IPL_BIO)              /* IPL15 */
> #define splnet()        _splraise(IPL_NET)              /* IPL15 */
> #define spltty()        _splraise(IPL_TTY)              /* IPL15 */
> 
> should be replaced with something like this:
> 
> #define splbio()        _splraise(hp300_ipls[HP300_IPL_BIO])
> #define splnet()        _splraise(hp300_ipls[HP300_IPL_NET])
> #define spltty()        _splraise(hp300_ipls[HP300_IPL_TTY])
> 
> (Example from the hp300 port, obviously.)
> 
I looked at this, but I really don't understand what is broken (except for
some leftovers of splimp() maybe).

The VAX arch has a very well-defined interrupt hierarchy, for external
devices it is like this:

BR4 (spl4(), IPL14, ...): line printers, A/D converters, tty output
BR5 (spl5(), IPL15, ...): block devices (disk, tape), tty input, network
BR6 (spl6(), IPL16, ...): card readers, digital I/O cards
BR7 (spl7(), IPL17, ...): external RT clocks 

This is always true and will always work if those levels are used.

BUT: (this is probably what may have confused). The Qbus will always
interrupt at IPL17 and may be lowered manually. For example, a disk
controller will interrupt at IPL17 but can be lowered to IPL15 (because
it is its interrupt level) in the interrupt routine and cannot
be interrupted by another disk interrupt, even if the interrupt 
comes at IPL17. This is odd but works fine.

-- Ragge