Changeset 2538 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- May 8, 2007 3:04:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r2038 r2538 514 514 static void apic_set_irq(PPCIBUS pBus, PCIDevice *pci_dev, int irq_num1, int level, int acpi_irq) 515 515 { 516 PPCIGLOBALS pGlobals = PCIBUS2PCIGLOBALS(pBus);517 int shift, apic_irq, apic_level;518 uint32_t *p;519 520 516 if (acpi_irq == -1) { 517 int shift, apic_irq, apic_level; 518 uint32_t *p; 519 PPCIGLOBALS pGlobals = PCIBUS2PCIGLOBALS(pBus); 521 520 int uIrqIndex = pci_dev->Int.s.iIrq; 522 521 int irq_num = pci_slot_get_apic_pirq(pci_dev, irq_num1); 522 523 523 p = &pGlobals->pci_apic_irq_levels[irq_num][uIrqIndex >> 5]; 524 524 shift = (uIrqIndex & 0x1f); 525 *p = (*p & ~(1 << shift)) | ( level<< shift);525 *p = (*p & ~(1 << shift)) | ((level & PDM_IRQ_LEVEL_HIGH) << shift); 526 526 apic_irq = irq_num + 0x10; 527 527 apic_level = get_pci_irq_apic_level(pGlobals, irq_num); 528 528 Log3(("apic_set_irq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n", 529 529 HCSTRING(pci_dev->name), irq_num1, level, apic_irq, apic_level, irq_num)); 530 pBus->CTXALLSUFF(pPciHlp)->pfnIoApicSetIrq(CTXSUFF(pBus->pDevIns), apic_irq, apic_level); 531 532 if ((level & PDM_IRQ_LEVEL_FLIP_FLOP) == PDM_IRQ_LEVEL_FLIP_FLOP) { 533 *p = (*p & ~(1 << shift)); 534 apic_level = get_pci_irq_apic_level(pGlobals, irq_num); 535 Log3(("apic_set_irq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n", 536 HCSTRING(pci_dev->name), irq_num1, level, apic_irq, apic_level, irq_num)); 537 pBus->CTXALLSUFF(pPciHlp)->pfnIoApicSetIrq(CTXSUFF(pBus->pDevIns), apic_irq, apic_level); 538 } 530 539 } else { 531 apic_irq = acpi_irq; 532 apic_level = level; 533 Log3(("apic_set_irq: %s: irq_num1=%d level=%d apic_irq=%d apic_level=%d\n", 534 HCSTRING(pci_dev->name), irq_num1, level, apic_irq, apic_level)); 535 } 536 537 pBus->CTXALLSUFF(pPciHlp)->pfnIoApicSetIrq(CTXSUFF(pBus->pDevIns), apic_irq, apic_level); 540 Log3(("apic_set_irq: %s: irq_num1=%d level=%d acpi_irq=%d\n", 541 HCSTRING(pci_dev->name), irq_num1, level, acpi_irq)); 542 pBus->CTXALLSUFF(pPciHlp)->pfnIoApicSetIrq(CTXSUFF(pBus->pDevIns), acpi_irq, level); 543 } 538 544 } 539 545 … … 599 605 pic_irq = pPciDev->config[0x3c]; 600 606 pGlobals->acpi_irq = pic_irq; 601 pGlobals->acpi_irq_level = iLevel ;607 pGlobals->acpi_irq_level = iLevel & PDM_IRQ_LEVEL_HIGH; 602 608 } 603 609 else … … 608 614 p = &pGlobals->pci_irq_levels[irq_num][uIrqIndex >> 5]; 609 615 shift = (uIrqIndex & 0x1f); 610 *p = (*p & ~(1 << shift)) | ( iLevel<< shift);616 *p = (*p & ~(1 << shift)) | ((iLevel & PDM_IRQ_LEVEL_HIGH) << shift); 611 617 612 618 /* now we change the pic irq level according to the piix irq mappings */ 613 619 pic_irq = pbCfg[0x60 + irq_num]; 614 620 if (pic_irq >= 16) 621 { 622 if ((iLevel & PDM_IRQ_LEVEL_FLIP_FLOP) == PDM_IRQ_LEVEL_FLIP_FLOP) 623 *p = (*p & ~(1 << shift)); 615 624 return; 625 } 616 626 } 617 627 … … 632 642 HCSTRING(pPciDev->name), iLevel, iIrq, pic_irq, pic_level)); 633 643 pBus->CTXALLSUFF(pPciHlp)->pfnIsaSetIrq(CTXSUFF(pBus->pDevIns), pic_irq, pic_level); 644 645 /** @todo optimize pci irq flip-flop some rainy day. */ 646 if ((iLevel & PDM_IRQ_LEVEL_FLIP_FLOP) == PDM_IRQ_LEVEL_FLIP_FLOP) 647 pciSetIrq(pDevIns, pPciDev, iIrq, PDM_IRQ_LEVEL_LOW); 634 648 } 635 649
Note:
See TracChangeset
for help on using the changeset viewer.