Ignore:
Timestamp:
Jul 14, 2010, 10:34:40 PM (15 years ago)
Author:
David Azarewicz
Message:

OSS32_Initialize changes, code cleanups

File:
1 edited

Legend:

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

    r458 r516  
    5555#define PCI_CONFIG_DATA         0xCFC
    5656
    57 #ifdef ACPI 
    58 APIRET APIENTRY ACPIFindPCIDevice(ULONG Bus, ULONG Dev, ULONG Fun, ULONG *PicIRQ, ULONG *ApicIRQ, ULONG *Hdl, char *Component); 
    59 #endif 
     57#ifdef ACPI
     58APIRET APIENTRY ACPIFindPCIDevice(ULONG Bus, ULONG Dev, ULONG Fun, ULONG *PicIRQ, ULONG *ApicIRQ, ULONG *Hdl, char *Component);
     59#endif
    6060
    6161//******************************************************************************
     
    135135//******************************************************************************
    136136//******************************************************************************
    137 #ifdef ACPI 
     137#ifdef ACPI
    138138struct SaveIRQForSlot
    139139{
     
    141141    BYTE   LowIRQ;
    142142    BYTE   HighIRQ;
    143     BYTE   Pin;   
     143    BYTE   Pin;
    144144};
    145145extern struct SaveIRQForSlot sISRHigh[];
     
    150150                            struct pci_dev near *pcidev, int idx)
    151151{
    152 #ifdef ACPI
    153     APIRET           rc;
    154 #endif
    155152    int         resNo, addr, found = 0;
    156153    u32         devNr, busNr, funcNr, detectedId, pciId, cfgaddrreg, temp, temp2;
    157 #ifdef ACPI
    158     ULONG            temp1,temp3; //PS++
    159 #endif
     154#ifdef ACPI
     155    APIRET           rc;
     156    ULONG            temp1,temp3; //PS++
     157#endif
    160158    u8          headerType;
    161159
     
    242240                        // IRQ and PIN
    243241                        pci_read_config_dword(pcidev, PCI_INTERRUPT_LINE, &temp);
    244 #ifdef ACPI 
     242#ifdef ACPI
    245243                        sISRHigh[SaveIRQCounter].Pin  = (temp >> 8) & 0xf;
    246                         temp2 = temp3 = 0; 
    247                         rc = ACPIFindPCIDevice( (ULONG)busNr,                        // Bus 
    248                                                 (ULONG)devNr,                        // Dev 
    249                                                 (ULONG)(pcidev->devfn >> 8) & 7,     // Function 
    250                                                 &temp1,                              // PIC IRQ 
    251                                                 &temp3,                              // APIC IRQ 
    252                                                 NULL,                                // ACPI handle to finding device 
    253                                                 "Uniaud32");                         // Name for acpi log 
    254                         if (!rc) 
    255                         { 
    256                         // Check APIC IRQ, if we have /SMP /APIC, must be set 
    257                         if (temp1) 
    258                            temp = (temp & (~0xff)) | (temp1 & 0xff); 
    259                         // Check PIC IRQ 
    260                         else if (temp3) 
    261                                  temp = (temp & (~0xff)) | (temp3 & 0xff); 
    262                         dprintf(("pci_query_device: IRQs ACPI PIC%d APIC%d", temp1, temp3)); 
     244                        temp2 = temp3 = 0;
     245                        rc = ACPIFindPCIDevice( (ULONG)busNr,                        // Bus
     246                                                (ULONG)devNr,                        // Dev
     247                                                (ULONG)(pcidev->devfn >> 8) & 7,     // Function
     248                                                &temp1,                              // PIC IRQ
     249                                                &temp3,                              // APIC IRQ
     250                                                NULL,                                // ACPI handle to finding device
     251                                                "Uniaud32");                         // Name for acpi log
     252                        if (!rc)
     253                        {
     254                        // Check APIC IRQ, if we have /SMP /APIC, must be set
     255                        if (temp1)
     256                           temp = (temp & (~0xff)) | (temp1 & 0xff);
     257                        // Check PIC IRQ
     258                        else if (temp3)
     259                                 temp = (temp & (~0xff)) | (temp3 & 0xff);
     260                        dprintf(("pci_query_device: IRQs ACPI PIC%d APIC%d", temp1, temp3));
    263261                        sISRHigh[SaveIRQCounter].LowIRQ  = temp1;
    264262                        sISRHigh[SaveIRQCounter].HighIRQ = temp3;
    265                         } 
    266 #endif /* ACPI */ 
     263                        }
     264#endif /* ACPI */
    267265                        if( (u8)temp && (u8)temp != 0xff )
    268266                        {
Note: See TracChangeset for help on using the changeset viewer.