Re: struct pci-device and irq

Aug 22, 2003 2 Replies


I want to knwo how this is implemented in Linux. When a struct pci_device *dev


>is returned by the kernel (after having found that a pci device the driver
>registered for), the field dev->irq, is that original hardware irq# or some
>number Linux uses, maybe different from the original irq#?
>I am asking this question, because someother RTOSs might define their own irq#
>that is not necessary the hardware irq#, which in somecase is convenient, for
>soem platform that has a interrupt controler, like mpc860. In that case, the OS
>can give much more "irq# numbers" to the applications by adding that portion of
>chacking interrupt control software into the OS.

Yes, it's a "Linux interrupt number". It's an abstraction. If it is the same as the "hardware interrupt" value then it is that way for convenience or coincidence.


Since you mentioned a PPC CPU, you might want to look in arch/ppc/* and observe the many board ports that make use of PCI IRQ map tables to map IDSELs to Linux interrupt numbers. Likewise, a Linux interrupt number is mapped to a hardware PIC "value" in the various examples of PIC code.


-Matt


You might tell which files specificly?

Too numerous to list. Let's take a Spruce as an example:

arch/ppc/platforms/spruce_pci.c arch/ppc/platforms/cpc700_pic.c

-Matt

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required