ACPIFindPCIDevice: Difference between revisions
Appearance
Created page with "Find PCI device by Bus:Dev:Fun ==Syntax== APIRET APIENTRY ACPIFindPCIDevice(UINT32 Bus, UINT32 Dev, UINT32 Fun, UINT32 *PicIRQ, UINT32 *ApicIRQ, ACPI_HANDLE *Hdl, char *Comp..." |
m →Links |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
<PRE> | <PRE> | ||
temp2 = temp3 = 0; | |||
rc = ACPIFindPCIDevice( (ULONG)busNr, // Bus | |||
(ULONG)devNr, // Dev | |||
(ULONG)(pcidev->devfn >> 8) & 7, // Function | |||
&temp1, // PIC IRQ | |||
&temp3, // APIC IRQ | |||
NULL, // ACPI handle to finding device | |||
"Uniaud32"); // Name for acpi log | |||
if (!rc) | |||
{ | |||
// Check APIC IRQ, if we have /SMP /APIC, must be set | |||
if (temp3) | |||
temp = (temp & (~0xff)) | (temp3 & 0xff); | |||
// Check PIC IRQ | |||
else if (temp1) | |||
temp = (temp & (~0xff)) | (temp1 & 0xff); | |||
dprintf(("pci_query_device: IRQs ACPI PIC%d APIC%d set:0x%x", temp1, temp3,temp)); | |||
} | |||
</PRE> | </PRE> | ||
[[Category: | [[Category:ACPI32]] |
Latest revision as of 09:13, 29 May 2025
Find PCI device by Bus:Dev:Fun
Syntax
APIRET APIENTRY ACPIFindPCIDevice(UINT32 Bus, UINT32 Dev, UINT32 Fun, UINT32 *PicIRQ, UINT32 *ApicIRQ, ACPI_HANDLE *Hdl, char *Component)
Parameters
- Bus
- PCI Bus
- Dev
- PCI Device
- Fun
- PCI Finction
- Component
- Name of caller for acpica$ log
- Hdl
- Finding handle for device
- PicIRQ
- IRQ in PIC mode or boot stage
- ApicIRQ
- IRQ in APIC mode or zero if problem or PIC mode
Example
temp2 = temp3 = 0; rc = ACPIFindPCIDevice( (ULONG)busNr, // Bus (ULONG)devNr, // Dev (ULONG)(pcidev->devfn >> 8) & 7, // Function &temp1, // PIC IRQ &temp3, // APIC IRQ NULL, // ACPI handle to finding device "Uniaud32"); // Name for acpi log if (!rc) { // Check APIC IRQ, if we have /SMP /APIC, must be set if (temp3) temp = (temp & (~0xff)) | (temp3 & 0xff); // Check PIC IRQ else if (temp1) temp = (temp & (~0xff)) | (temp1 & 0xff); dprintf(("pci_query_device: IRQs ACPI PIC%d APIC%d set:0x%x", temp1, temp3,temp)); }