Subject: Re: ci_isources confusion?
To: =?ISO-8859-1?Q?Edgar_Fu=DF?= <ef@math.uni-bonn.de>
From: Frank van der Linden <fvdl@netbsd.org>
List: port-amd64
Date: 03/24/2007 11:01:40
Edgar Fuß wrote:
> Either I'm confused again or there's some confusion regarding the 
> usage of ci_isources in the IOAPIC case.
>
> As I understand it, the index into struct cpuinfo's ci_isources is 
> just some "slot" number with no relation to any IRQ number or the like.
>
> However, in sys/arch/amd64/amd64/vectors.S, in the INTRSTUB macro, the 
> macros "num" argument (which is per-IOAPIC) is used as an index to 
> that table to calculate %r14 as a pointer to the relevant struct 
> intrsource. From that pointer, the ioapic_mask and ioapic_unmasc 
> macros (in sys/arch/amd64/include/i82093reg.h) get the pic an pin 
> number. I don't understand why those must actually correspond to the 
> IOAPIC interrupt we're just servicing.
>
> But it can't be that broken as it appears to me. I must be missing 
> something.
I'm not sure what the issue is you think you're seeing. You're right, 
the index into ci_isources is a slot number, and does not necessarily 
have a relation to any pin numbers.

The macro "num" argument is used to get the right intrsource structure, 
which contains all the needed hardware information. 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.

- Frank