Ignore:
Timestamp:
Apr 1, 2008, 10:54:17 AM (17 years ago)
Author:
Paul Smedley
Message:

Add ACPI support, make OSS compatability stuff build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.0/lib32/pci.c

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