Subject: Re: setting interrupts and other things.
To: Anders Magnusson <ragge@ludd.luth.se>
From: Matt Thomas <matt@3am-software.com>
List: port-vax
Date: 11/26/1999 21:33:21
At 01:35 PM 11/21/99 , Anders Magnusson wrote:
> > The VAX port bus interfaces need bus specific but VAX independent 
> > mechanisms to establish and disestablish interrupts.  Even the MI
> > qbus code uses scb_vecalloc which is just wrong.  There should be 
> > qbus_intr_establish and qbus_intr_disestablish calls (as well as
> > vsbus_intr_establish and vsbus_intr_disestablish).  
> > 
>Agreed. It is just not converted yet.
>
> > IMO, that the current method of doing interrupt probing in 
> > the probe routine is evil.  That is inherently platform specific
> > and some devices are difficult to get to trigger an interrupt.
> > 
>Not agree. For the qbus/unibus, it is not a problem to generate
>interrupts, merely it is needed for both the probing of device and
>for assigning the correct interrupt vector. It is not platform-specific
>either; it's a proberty of the bus.

BTW, you *can't* set the interrupt routine in the probe routine.
(as I've been doing the new idsptch code).  To pass context to the
interrupt routine, you usually supply the ptr to the softc.  that
doesn't exist yet in the probe routine.  

Hence you need to do it the attach routine.  

>For the vsbus, the interrupt autodetection is ugly, but I don't have
>any idea about how to solve the problem. Both vectors and maskbits
>may be different even inside the same type of machines, so there must
>be a way to find this out at runtime. If you have any suggestions how
>to make it better, tell me. The current way of doing it seems to work
>quite well after all.

But don't do it in the probe.  Do it in the attach routine.
-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message