Re: struct pci-device and irq

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

Reply to
Matt Porter
Loading thread data ...

You might tell which files specificly?

Reply to
Bob888y

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

Reply to
Matt Porter

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.