Re: Questions about IO-APIC

Udo Steinberg <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <20120728171119.40334771@x220>
On Sat, 28 Jul 2012 07:44:10 -0700 Chen Tian (CT) wrote:

CT> Thanks for the reply. Then what is the irq number that is assigned to an
CT> io-apic pin? When writing a driver for a PCi device, how can I use the
CT> value in pci irq field to find the right irq no. for this device so I can
CT> call attach function in driver?

I assume you mean the value in the PCI interrupt line field at offset 0x3c
in the configuration space? That value has no meaning when the IOAPIC is used.

What you need to do instead is parse _PRT blocks of the ACPI DSDT table to
figure out which IOAPIC pin each device is connected to. Here's an example:

        Name (AH02, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF,			// PCI address of the device
                0x00,  			// PCI LINK A
                0x00,  
                0x1D   			// IOAPIC GSI 29
            }, 

            Package (0x04)
            {
                0xFFFF,
                0x01,  			// PCI LINK B
                0x00,  
                0x29   			// IOAPIC GSI 41
            }, 

            Package (0x04)
            {
                0xFFFF,
                0x02,  			// PCI LINK C
                0x00,  
                0x28   			// IOAPIC GSI 40
            }, 

            Package (0x04)
            {
                0xFFFF,
                0x03,  			// PCI LINK D
                0x00,  
                0x2A   			// IOAPIC GSI 42
            }
        })   

Depending on which of the PCI interrupt lines (A-D) the device is configured
to use, it will either generate GSI 29, 41, 40, or 42. In this case the
machine has multiple IOAPICs, each with 24 pins, so for example GSI 29 would
be the 6th pin on the second IOAPIC.

Cheers,
Udo

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlAUARcACgkQnhRzXSM7nSnGgACdHplS8gB9TvlNnrUTfudOGa3b
1LgAnRVGSBtcmDVb37TBdRmfJyaa0li8
=WlBS
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.