Changeset 328 for GPL/trunk/lib32/pci.c


Ignore:
Timestamp:
Mar 30, 2008, 8:59:18 AM (17 years ago)
Author:
Brendan Oakley
Message:

Added option for ACPI support provided by Pavel, requires AcpiDrv.lib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/lib32/pci.c

    r289 r328  
    5454#define PCI_CONFIG_DATA         0xCFC
    5555
     56#ifdef ACPI
     57APIRET APIENTRY ACPIFindPCIDevice(ULONG Bus, ULONG Dev, ULONG Fun, ULONG *PicIRQ, ULONG *ApicIRQ, ULONG *Hdl, char *Component);
     58#endif
    5659
    5760//******************************************************************************
     
    134137                            struct pci_dev near *pcidev, int idx)
    135138{
     139#ifdef ACPI
     140    APIRET           rc;
     141#endif
    136142    int         resNo, addr, found = 0;
    137143    u32         devNr, busNr, funcNr, detectedId, pciId, cfgaddrreg, temp, temp2;
     144#ifdef ACPI
     145    ULONG            temp1,temp3; //PS++
     146#endif
    138147    u8          headerType;
    139148
     
    220229                        // IRQ and PIN
    221230                        pci_read_config_dword(pcidev, PCI_INTERRUPT_LINE, &temp);
     231#ifdef ACPI
     232                        temp2 = temp3 = 0;
     233                        rc = ACPIFindPCIDevice( (ULONG)busNr,                        // Bus
     234                                                (ULONG)devNr,                        // Dev
     235                                                (ULONG)(pcidev->devfn >> 8) & 7,     // Function
     236                                                &temp1,                              // PIC IRQ
     237                                                &temp3,                              // APIC IRQ
     238                                                NULL,                                // ACPI handle to finding device
     239                                                "Uniaud32");                         // Name for acpi log
     240                        if (!rc)
     241                        {
     242                        // Check APIC IRQ, if we have /SMP /APIC, must be set
     243                        if (temp3)
     244                           temp = (temp & (~0xff)) | (temp3 & 0xff);
     245                        // Check PIC IRQ
     246                        else if (temp1)
     247                                 temp = (temp & (~0xff)) | (temp1 & 0xff);
     248                        dprintf(("pci_query_device: IRQs ACPI PIC%d APIC%d", temp1, temp3));
     249                        }
     250#endif /* ACPI */
    222251                        if( (u8)temp && (u8)temp != 0xff )
    223252                        {
Note: See TracChangeset for help on using the changeset viewer.