- Timestamp:
- Jul 27, 2020 6:20:55 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r85007 r85478 471 471 PPDMPCIDEV pPciDev, uint8_t cBridgeDepth, uint8_t *paBridgePositions) 472 472 { 473 uint32_t uPciBiosSpecialVRAM = 0xe0000000; 473 474 uint32_t *paddr; 474 475 int pin, pic_irq; … … 482 483 if (vendor_id != 0xffff) 483 484 { 484 switch (devclass)485 switch (devclass) 485 486 { 486 487 case 0x0101: … … 505 506 } 506 507 break; 507 case 0x0300:508 {509 if (vendor_id != 0x80ee)510 goto default_map;511 /* VGA: map frame buffer to default Bochs VBE address */512 devpciR3BiosInitSetRegionAddress(pDevIns, pBus, pPciDev, 0, 0xe0000000);513 /*514 * Legacy VGA I/O ports are implicitly decoded by a VGA class device. But515 * only the framebuffer (i.e., a memory region) is explicitly registered via516 * devpciR3BiosInitSetRegionAddress, so don't forget to enable I/O decoding.517 */518 devpciR3SetWord(pDevIns, pPciDev, PCI_COMMAND,519 devpciR3GetWord(pPciDev, PCI_COMMAND)520 | PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS);521 break;522 }523 508 case 0x0800: 524 509 /* PIC */ … … 639 624 { 640 625 uint32_t u32Size; 641 uint8_t u8Res sourceType;626 uint8_t u8ResourceType; 642 627 uint32_t u32Address = 0x10 + i * 4; 643 628 644 629 /* Calculate size. */ 645 u8Res sourceType = devpciR3GetByte(pPciDev, u32Address);630 u8ResourceType = devpciR3GetByte(pPciDev, u32Address); 646 631 devpciR3SetDWord(pDevIns, pPciDev, u32Address, UINT32_C(0xffffffff)); 647 632 u32Size = devpciR3GetDWord(pPciDev, u32Address); 648 bool fIsPio = ((u8Res sourceType & PCI_COMMAND_IOACCESS) == PCI_COMMAND_IOACCESS);633 bool fIsPio = ((u8ResourceType & PCI_COMMAND_IOACCESS) == PCI_COMMAND_IOACCESS); 649 634 /* Clear resource information depending on resource type. */ 650 635 if (fIsPio) /* I/O */ … … 669 654 paddr = &pGlobals->uPciBiosIo; 670 655 else 656 { 671 657 paddr = &pGlobals->uPciBiosMmio; 658 bool fPrefetch = (u8ResourceType & ((uint8_t)(PCI_ADDRESS_SPACE_MEM_PREFETCH | PCI_ADDRESS_SPACE_IO))) 659 == PCI_ADDRESS_SPACE_MEM_PREFETCH; 660 661 if (devclass == 0x0300 && (vendor_id == 0x80ee || vendor_id == 0x15ad) && fPrefetch) 662 { 663 /* VGA: map frame buffer to default Bochs VBE address */ 664 paddr = &uPciBiosSpecialVRAM; 665 /* 666 * For VBoxVGA must enable I/O decoding, because legacy 667 * VGA I/O ports are implicitly decoded by a VGA class 668 * device. Not needed for VMSVGA or VBoxSVGA, because 669 * they have an explicit I/O BAR. 670 */ 671 fActiveIORegion = true; 672 } 673 } 672 674 uint32_t uNew = *paddr; 673 675 uNew = (uNew + u32Size - 1) & ~(u32Size - 1);
Note:
See TracChangeset
for help on using the changeset viewer.