Subject: Re: ci_isources confusion?
To: None <port-amd64@NetBSD.org>
From: =?ISO-8859-1?Q?Edgar_Fu=DF?= <ef@math.uni-bonn.de>
List: port-amd64
Date: 03/24/2007 12:07:08
> I'm not sure what the issue is you think you're seeing.
Probably I'm just misguided.

> The macro "num" argument is used to get the right intrsource  
> structure,
> which contains all the needed hardware information.
As I (mis)read the source, the two code fragments generated by the  
invocations of
   INTRSTUB(legacy,0,...)
and
   INTRSTUB(ioapic_level,0,...)
will both have num=0. So the INTRSTUB macro will generate code  
equivalent to
   register struct intr_source *r14 = curcpu()->ci_isources[0];

> Note that while the "num" argument is passed to the mask/unmask  
> macros,
> it isn't actually used there, because only the information
> from struct intrsource is used.
Yes, but they are "passed" r14.
Now, the ioapic_mask macro will do something like
   register struct pic *rdi = r14->is_pic;
   register int rsi = r14->is_pin;
But which PIC will rdi point to?