Changeset 67668 in vbox
- Timestamp:
- Jun 28, 2017 4:28:34 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116476
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/include/VBox/vmm/pdmdev.h ¶
r66270 r67668 610 610 DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)); 611 611 612 /**613 * Called to perform the job of the bios.614 *615 * This is only called for the first PCI Bus - it is expected to616 * service all the PCI buses.617 *618 * @returns VBox status.619 * @param pDevIns Device instance of the first bus.620 * @remarks Caller enters the PDM critical section.621 */622 DECLR3CALLBACKMEMBER(int, pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));623 624 612 /** The name of the SetIrq RC entry point. */ 625 613 const char *pszSetIrqRC; … … 633 621 634 622 /** Current PDMPCIBUSREG version number. */ 635 #define PDM_PCIBUSREG_VERSION PDM_VERSION_MAKE(0xfffe, 6, 0)623 #define PDM_PCIBUSREG_VERSION PDM_VERSION_MAKE(0xfffe, 7, 0) 636 624 637 625 /** -
TabularUnified trunk/src/VBox/Devices/Bus/DevPCI.cpp ¶
r67583 r67668 116 116 uint32_t config_addr; 117 117 118 Log (("pci_data_write:addr=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len));118 LogFunc(("addr=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len)); 119 119 120 120 if (!(pGlobals->uConfigReg & (1 << 31))) { … … 150 150 { 151 151 #ifdef IN_RING3 152 Log (("pci_config_write:%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, val, len));152 LogFunc(("%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, val, len)); 153 153 pci_dev->Int.s.pfnConfigWrite(pci_dev->Int.s.CTX_SUFF(pDevIns), pci_dev, config_addr, val, len); 154 154 #else … … 198 198 #ifdef IN_RING3 199 199 *pu32 = pci_dev->Int.s.pfnConfigRead(pci_dev->Int.s.CTX_SUFF(pDevIns), pci_dev, config_addr, len); 200 Log (("pci_config_read:%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, *pu32, len));200 LogFunc(("%s: addr=%02x val=%08x len=%d\n", pci_dev->pszNameR3, config_addr, *pu32, len)); 201 201 #else 202 202 NOREF(len); … … 249 249 apic_irq = irq_num + 0x10; 250 250 apic_level = get_pci_irq_apic_level(pGlobals, irq_num); 251 Log3 (("apic_set_irq:%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n",251 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n", 252 252 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num)); 253 253 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc); … … 257 257 pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW; 258 258 apic_level = get_pci_irq_apic_level(pGlobals, irq_num); 259 Log3 (("apic_set_irq:%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n",259 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n", 260 260 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num)); 261 261 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc); 262 262 } 263 263 } else { 264 Log3 (("apic_set_irq:%s: irq_num1=%d level=%d iAcpiIrq=%d\n",264 Log3Func(("%s: irq_num1=%d level=%d iAcpiIrq=%d\n", 265 265 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iAcpiIrq)); 266 266 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), iAcpiIrq, iLevel, uTagSrc); … … 288 288 static void pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc) 289 289 { 290 PDEVPCIBUS pBus =&pGlobals->PciBus;290 PDEVPCIBUS pBus = &pGlobals->PciBus; 291 291 uint8_t *pbCfg = pGlobals->Piix3.PIIX3State.dev.abConfig; 292 292 const bool fIsAcpiDevice = pPciDev->abConfig[2] == 0x13 && pPciDev->abConfig[3] == 0x71; … … 364 364 pic_level |= pGlobals->Piix3.iAcpiIrqLevel; 365 365 366 Log3 (("pciSetIrq:%s: iLevel=%d iIrq=%d pic_irq=%d pic_level=%d uTagSrc=%#x\n",366 Log3Func(("%s: iLevel=%d iIrq=%d pic_irq=%d pic_level=%d uTagSrc=%#x\n", 367 367 R3STRING(pPciDev->pszNameR3), iLevel, iIrq, pic_irq, pic_level, uTagSrc)); 368 368 pBus->CTX_SUFF(pPciHlp)->pfnIsaSetIrq(pBus->CTX_SUFF(pDevIns), pic_irq, pic_level, uTagSrc); … … 617 617 if ((pGlobals->uPciBiosIo % _4K) != 0) 618 618 pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, _4K); 619 Log (("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosIo));619 LogFunc(("Aligned I/O start address. New address %#x\n", pGlobals->uPciBiosIo)); 620 620 pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_BASE, (pGlobals->uPciBiosIo >> 8) & 0xf0); 621 621 … … 623 623 if ((pGlobals->uPciBiosMmio % _1M) != 0) 624 624 pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, _1M); 625 Log (("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosMmio));625 LogFunc(("Aligned MMIO start address. New address %#x\n", pGlobals->uPciBiosMmio)); 626 626 pci_config_writew(pGlobals, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pGlobals->uPciBiosMmio >> 16) & UINT32_C(0xffff0)); 627 627 … … 705 705 u32Size = (~u32Size) + 1; 706 706 707 Log2 (("%s: Size of region %u for device %d on bus %d is %u\n", __FUNCTION__, i, uDevFn, uBus, u32Size));707 Log2Func(("Size of region %u for device %d on bus %d is %u\n", i, uDevFn, uBus, u32Size)); 708 708 709 709 if (u32Size) … … 727 727 else 728 728 { 729 Log (("%s: Start address of %s region %u is %#x\n", __FUNCTION__, (fIsPio ? "I/O" : "MMIO"), i, uNew));729 LogFunc(("%s: Start address of %s region %u is %#x\n", (fIsPio ? "I/O" : "MMIO"), i, uNew)); 730 730 pci_set_io_region_addr(pGlobals, uBus, uDevFn, i, uNew); 731 731 if (fIsPio) … … 734 734 fActiveMemRegion = true; 735 735 *paddr = uNew + u32Size; 736 Log2 (("%s: New address is %#x\n", __FUNCTION__, *paddr));736 Log2Func(("New address is %#x\n", *paddr)); 737 737 } 738 738 } … … 772 772 } 773 773 774 /** 775 * Worker for Fake PCI BIOS config, triggered by magic port access by BIOS. 776 * 777 * @returns VBox status code. 778 * 779 * @param pDevIns i440FX device instance. 780 */ 781 static int pciR3FakePCIBIOS(PPDMDEVINS pDevIns) 782 { 783 unsigned i; 784 uint8_t elcr[2] = {0, 0}; 785 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 786 PVM pVM = PDMDevHlpGetVM(pDevIns); Assert(pVM); 787 PVMCPU pVCpu = PDMDevHlpGetVMCPU(pDevIns); Assert(pVM); 788 uint32_t const cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM); 789 uint64_t const cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM); 790 RT_NOREF(cbBelow4GB, cbAbove4GB); 791 792 LogRel(("PCI: setting up resources and interrupts\n")); 793 794 /* 795 * Set the start addresses. 796 */ 797 pGlobals->uPciBiosBus = 0; 798 pGlobals->uPciBiosIo = 0xd000; 799 pGlobals->uPciBiosMmio = UINT32_C(0xf0000000); 800 801 /* 802 * Activate IRQ mappings. 803 */ 804 for (i = 0; i < 4; i++) 805 { 806 uint8_t irq = pci_irqs[i]; 807 /* Set to trigger level. */ 808 elcr[irq >> 3] |= (1 << (irq & 7)); 809 /* Activate irq remapping in PIIX3. */ 810 pci_config_writeb(pGlobals, 0, pGlobals->Piix3.PIIX3State.dev.uDevFn, 0x60 + i, irq); 811 } 812 813 /* Tell to the PIC. */ 814 VBOXSTRICTRC rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d0, elcr[0], sizeof(uint8_t)); 815 if (rcStrict == VINF_SUCCESS) 816 rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d1, elcr[1], sizeof(uint8_t)); 817 if (rcStrict != VINF_SUCCESS) 818 { 819 AssertMsgFailed(("Writing to PIC failed! rcStrict=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); 820 return RT_SUCCESS(rcStrict) ? VERR_INTERNAL_ERROR : VBOXSTRICTRC_VAL(rcStrict); 821 } 822 823 /* 824 * Init the devices. 825 */ 826 for (i = 0; i < 256; i++) 827 { 828 uint8_t aBridgePositions[256]; 829 830 memset(aBridgePositions, 0, sizeof(aBridgePositions)); 831 Log2(("PCI: Initializing device %d (%#x)\n", 832 i, 0x80000000 | (i << 8))); 833 pci_bios_init_device(pGlobals, 0, i, 0, aBridgePositions); 834 } 835 836 return VINF_SUCCESS; 837 } 838 774 839 #endif /* IN_RING3 */ 775 840 … … 782 847 PDMBOTHCBDECL(int) pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 783 848 { 784 Log (("pciIOPortAddressWrite:Port=%#x u32=%#x cb=%d\n", Port, u32, cb));849 LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb)); 785 850 RT_NOREF2(Port, pvUser); 786 851 if (cb == 4) … … 809 874 *pu32 = pThis->uConfigReg; 810 875 PCI_UNLOCK(pDevIns); 811 Log (("pciIOPortAddressRead:Port=%#x cb=%d -> %#x\n", Port, cb, *pu32));876 LogFunc(("Port=%#x cb=%d -> %#x\n", Port, cb, *pu32)); 812 877 return VINF_SUCCESS; 813 878 } 814 879 /* else: 440FX does "pass through to the bus" for other writes, what ever that means. 815 880 * Linux probes for cmd640 using byte writes/reads during ide init. We'll just ignore it. */ 816 Log (("pciIOPortAddressRead:Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb));881 LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb)); 817 882 return VERR_IOM_IOPORT_UNUSED; 818 883 } … … 824 889 PDMBOTHCBDECL(int) pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 825 890 { 826 Log (("pciIOPortDataWrite:Port=%#x u32=%#x cb=%d\n", Port, u32, cb));891 LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb)); 827 892 NOREF(pvUser); 828 893 int rc = VINF_SUCCESS; … … 850 915 int rc = pci_data_read(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), Port, cb, pu32); 851 916 PCI_UNLOCK(pDevIns); 852 Log (("pciIOPortDataRead:Port=%#x cb=%#x -> %#x (%Rrc)\n", Port, cb, *pu32, rc));917 LogFunc(("Port=%#x cb=%#x -> %#x (%Rrc)\n", Port, cb, *pu32, rc)); 853 918 return rc; 854 919 } … … 858 923 859 924 #ifdef IN_RING3 925 926 /** 927 * @callback_method_impl{FNIOMIOPORTOUT, PCI data} 928 */ 929 DECLCALLBACK(int) pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 930 { 931 RT_NOREF2(pvUser, Port); 932 LogFunc(("Port=%#x u32=%#x cb=%d\n", Port, u32, cb)); 933 if (cb == 4) 934 { 935 if (u32 == UINT32_C(19200509)) // Richard Adams 936 { 937 int rc = pciR3FakePCIBIOS(pDevIns); 938 AssertRC(rc); 939 } 940 } 941 942 return VINF_SUCCESS; 943 } 944 945 /** 946 * @callback_method_impl{FNIOMIOPORTIN, PCI data} 947 */ 948 DECLCALLBACK(int) pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 949 { 950 RT_NOREF5(pDevIns, pvUser, Port, pu32, cb); 951 LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", Port, cb)); 952 return VERR_IOM_IOPORT_UNUSED; 953 } 954 860 955 861 956 /* … … 1077 1172 { 1078 1173 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1079 PDEVPCIBUS 1174 PDEVPCIBUS pBus = &pThis->PciBus; 1080 1175 uint32_t u32; 1081 1176 int rc; … … 1122 1217 1123 1218 /* -=-=-=-=-=- PCI Bus Interface Methods (PDMPCIBUSREG) -=-=-=-=-=- */ 1124 1125 /**1126 * @interface_method_impl{PDMPCIBUSREG,pfnFakePCIBIOSR3}1127 */1128 static DECLCALLBACK(int) pciR3FakePCIBIOS(PPDMDEVINS pDevIns)1129 {1130 unsigned i;1131 uint8_t elcr[2] = {0, 0};1132 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);1133 PVM pVM = PDMDevHlpGetVM(pDevIns); Assert(pVM);1134 PVMCPU pVCpu = PDMDevHlpGetVMCPU(pDevIns); Assert(pVM);1135 uint32_t const cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM);1136 uint64_t const cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM);1137 RT_NOREF(cbBelow4GB, cbAbove4GB);1138 1139 /*1140 * Set the start addresses.1141 */1142 pGlobals->uPciBiosBus = 0;1143 pGlobals->uPciBiosIo = 0xd000;1144 pGlobals->uPciBiosMmio = UINT32_C(0xf0000000);1145 1146 /*1147 * Activate IRQ mappings.1148 */1149 for (i = 0; i < 4; i++)1150 {1151 uint8_t irq = pci_irqs[i];1152 /* Set to trigger level. */1153 elcr[irq >> 3] |= (1 << (irq & 7));1154 /* Activate irq remapping in PIIX3. */1155 pci_config_writeb(pGlobals, 0, pGlobals->Piix3.PIIX3State.dev.uDevFn, 0x60 + i, irq);1156 }1157 1158 /* Tell to the PIC. */1159 VBOXSTRICTRC rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d0, elcr[0], sizeof(uint8_t));1160 if (rcStrict == VINF_SUCCESS)1161 rcStrict = IOMIOPortWrite(pVM, pVCpu, 0x4d1, elcr[1], sizeof(uint8_t));1162 if (rcStrict != VINF_SUCCESS)1163 {1164 AssertMsgFailed(("Writing to PIC failed! rcStrict=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));1165 return RT_SUCCESS(rcStrict) ? VERR_INTERNAL_ERROR : VBOXSTRICTRC_VAL(rcStrict);1166 }1167 1168 /*1169 * Init the devices.1170 */1171 for (i = 0; i < 256; i++)1172 {1173 uint8_t aBridgePositions[256];1174 1175 memset(aBridgePositions, 0, sizeof(aBridgePositions));1176 Log2(("PCI: Initializing device %d (%#x)\n",1177 i, 0x80000000 | (i << 8)));1178 pci_bios_init_device(pGlobals, 0, i, 0, aBridgePositions);1179 }1180 1181 return VINF_SUCCESS;1182 }1183 1219 1184 1220 … … 1275 1311 1276 1312 PDMPCIBUSREG PciBusReg; 1277 PDEVPCIBUS 1313 PDEVPCIBUS pBus = &pGlobals->PciBus; 1278 1314 PciBusReg.u32Version = PDM_PCIBUSREG_VERSION; 1279 1315 PciBusReg.pfnRegisterR3 = pciR3MergedRegister; … … 1282 1318 PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks; 1283 1319 PciBusReg.pfnSetIrqR3 = pciSetIrq; 1284 PciBusReg.pfnFakePCIBIOSR3 = pciR3FakePCIBIOS;1285 1320 PciBusReg.pszSetIrqRC = fGCEnabled ? "pciSetIrq" : NULL; 1286 1321 PciBusReg.pszSetIrqR0 = fR0Enabled ? "pciSetIrq" : NULL; … … 1361 1396 return rc; 1362 1397 } 1398 1399 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, pciR3IOPortMagicPCIWrite, pciR3IOPortMagicPCIRead, NULL, NULL, "i440FX (Fake PCI BIOS trigger)") 1400 ; 1401 if (RT_FAILURE(rc)) 1402 return rc; 1403 1363 1404 1364 1405 rc = PDMDevHlpSSMRegisterEx(pDevIns, VBOX_PCI_SAVED_STATE_VERSION, sizeof(*pBus) + 16*128, "pgm", … … 1467 1508 * of our parent passing the device which asserted the interrupt instead of the device of the bridge. 1468 1509 */ 1469 PDEVPCIBUS 1510 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1470 1511 PPDMPCIDEV pPciDevBus = pPciDev; 1471 1512 int iIrqPinBridge = iIrq; … … 1514 1555 if (pPciDev) 1515 1556 { 1516 Log (("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));1557 LogFunc(("%s: addr=%02x val=%08x len=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb)); 1517 1558 pPciDev->Int.s.pfnConfigWrite(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, u32Value, cb); 1518 1559 } … … 1548 1589 { 1549 1590 u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, cb); 1550 Log (("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));1591 LogFunc(("%s: u32Address=%02x u32Value=%08x cb=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb)); 1551 1592 } 1552 1593 } … … 1641 1682 PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks; 1642 1683 PciBusReg.pfnSetIrqR3 = pcibridgeSetIrq; 1643 PciBusReg.pfnFakePCIBIOSR3 = NULL; /* Only needed for the first bus. */1644 1684 PciBusReg.pszSetIrqRC = fGCEnabled ? "pcibridgeSetIrq" : NULL; 1645 1685 PciBusReg.pszSetIrqR0 = fR0Enabled ? "pcibridgeSetIrq" : NULL; -
TabularUnified trunk/src/VBox/Devices/Bus/DevPciIch9.cpp ¶
r67583 r67668 96 96 int iIrq, int iLevel, uint32_t uTagSrc); 97 97 #ifdef IN_RING3 98 static int ich9pciFakePCIBIOS(PPDMDEVINS pDevIns); 98 99 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t uBus); 99 100 static void ich9pciBiosInitAllDevicesOnBus(PDEVPCIROOT pPciRoot, uint8_t uBus); … … 155 156 156 157 158 #ifdef IN_RING3 159 157 160 /** 158 * Port I/O Handler for PCI address OUT operations. 159 * 160 * Emulates writes to Configuration Address Port at 0CF8h for 161 * Configuration Mechanism #1. 161 * Port I/O Handler for Fake PCI BIOS trigger OUT operations at 0410h 162 162 * 163 163 * @returns VBox status code. … … 169 169 * @param cb The value size in bytes. 170 170 */ 171 DECLCALLBACK(int) ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 172 { 173 RT_NOREF2(pvUser, uPort); 174 LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb)); 175 if (cb == 4) 176 { 177 if (u32 == UINT32_C(19200509)) // Richard Adams 178 { 179 int rc = ich9pciFakePCIBIOS(pDevIns); 180 AssertRC(rc); 181 } 182 } 183 184 return VINF_SUCCESS; 185 } 186 187 188 /** 189 * Port I/O Handler for Fake PCI BIOS trigger IN operations at 0410h 190 * 191 * @returns VBox status code. 192 * 193 * @param pDevIns ICH9 device instance. 194 * @param pvUser User argument - ignored. 195 * @param uPort Port number used for the IN operation. 196 * @param pu32 Where to store the result. 197 * @param cb Number of bytes read. 198 */ 199 DECLCALLBACK(int) ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb) 200 { 201 RT_NOREF5(pDevIns, pvUser, uPort, pu32, cb); 202 LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb)); 203 return VERR_IOM_IOPORT_UNUSED; 204 } 205 206 #endif /* IN_RING3 */ 207 208 209 /** 210 * Port I/O Handler for PCI address OUT operations. 211 * 212 * Emulates writes to Configuration Address Port at 0CF8h for 213 * Configuration Mechanism #1. 214 * 215 * @returns VBox status code. 216 * 217 * @param pDevIns ICH9 device instance. 218 * @param pvUser User argument - ignored. 219 * @param uPort Port number used for the OUT operation. 220 * @param u32 The value to output. 221 * @param cb The value size in bytes. 222 */ 171 223 PDMBOTHCBDECL(int) ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 172 224 { 173 LogFlow (("ich9pciIOPortAddressWrite:Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));225 LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb)); 174 226 RT_NOREF2(uPort, pvUser); 175 227 if (cb == 4) … … 217 269 PCI_UNLOCK(pDevIns); 218 270 219 LogFlow (("ich9pciIOPortAddressRead:Port=%#x cb=%d -> %#x\n", uPort, cb, *pu32));271 LogFlowFunc(("Port=%#x cb=%d -> %#x\n", uPort, cb, *pu32)); 220 272 return VINF_SUCCESS; 221 273 } 222 274 223 Log (("ich9pciIOPortAddressRead:Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));275 LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb)); 224 276 return VERR_IOM_IOPORT_UNUSED; 225 277 } … … 269 321 } 270 322 271 Log2(("ich9pciDataWriteAddr: %02x:%02x.%d reg %x(%d) %x %Rrc\n", 272 pAddr->iBus, pAddr->iDeviceFunc >> 3, pAddr->iDeviceFunc & 0x7, pAddr->iRegister, 273 cb, val, rc)); 323 Log2Func(("%02x:%02x.%d reg %x(%d) %x %Rrc\n", 324 pAddr->iBus, pAddr->iDeviceFunc >> 3, pAddr->iDeviceFunc & 0x7, pAddr->iRegister, cb, val, rc)); 274 325 return rc; 275 326 } … … 286 337 static int ich9pciDataWrite(PDEVPCIROOT pPciRoot, uint32_t addr, uint32_t val, int len) 287 338 { 288 LogFlow (("ich9pciDataWrite:config=%08x val=%08x len=%d\n", pPciRoot->uConfigReg, val, len));339 LogFlowFunc(("config=%08x val=%08x len=%d\n", pPciRoot->uConfigReg, val, len)); 289 340 290 341 /* Configuration space mapping enabled? */ … … 317 368 PDMBOTHCBDECL(int) ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb) 318 369 { 319 LogFlow (("ich9pciIOPortDataWrite:Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));370 LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb)); 320 371 NOREF(pvUser); 321 372 int rc = VINF_SUCCESS; … … 388 439 } 389 440 390 Log3(("ich9pciDataReadAddr: %02x:%02x.%d reg %x(%d) gave %x %Rrc\n", 391 pPciAddr->iBus, pPciAddr->iDeviceFunc >> 3, pPciAddr->iDeviceFunc & 0x7, pPciAddr->iRegister, 392 cb, *pu32, rc)); 441 Log3Func(("%02x:%02x.%d reg %x(%d) gave %x %Rrc\n", 442 pPciAddr->iBus, pPciAddr->iDeviceFunc >> 3, pPciAddr->iDeviceFunc & 0x7, pPciAddr->iRegister, cb, *pu32, rc)); 393 443 return rc; 394 444 } … … 405 455 static int ich9pciDataRead(PDEVPCIROOT pPciRoot, uint32_t addr, int cb, uint32_t *pu32) 406 456 { 407 LogFlow (("ich9pciDataRead:config=%x cb=%d\n", pPciRoot->uConfigReg, cb));457 LogFlowFunc(("config=%x cb=%d\n", pPciRoot->uConfigReg, cb)); 408 458 409 459 *pu32 = 0xffffffff; … … 447 497 PCI_UNLOCK(pDevIns); 448 498 449 LogFlow (("ich9pciIOPortDataRead:Port=%#x cb=%#x -> %#x (%Rrc)\n", uPort, cb, *pu32, rc));499 LogFlowFunc(("Port=%#x cb=%#x -> %#x (%Rrc)\n", uPort, cb, *pu32, rc)); 450 500 return rc; 451 501 } … … 510 560 apic_irq = irq_num + 0x10; 511 561 apic_level = pPciRoot->auPciApicIrqLevels[irq_num] != 0; 512 Log3 (("ich9pciApicSetIrq:%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x\n",513 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));562 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x\n", 563 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc)); 514 564 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc); 515 565 … … 523 573 pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW; 524 574 apic_level = pPciRoot->auPciApicIrqLevels[irq_num] != 0; 525 Log3 (("ich9pciApicSetIrq:%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x (flop)\n",526 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));575 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x (flop)\n", 576 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc)); 527 577 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), apic_irq, apic_level, uTagSrc); 528 578 } 529 579 } else { 530 Log3 (("ich9pciApicSetIrq:(forced) %s: irq_num1=%d level=%d acpi_irq=%d uTagSrc=%#x\n",531 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iForcedIrq, uTagSrc));580 Log3Func(("(forced) %s: irq_num1=%d level=%d acpi_irq=%d uTagSrc=%#x\n", 581 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iForcedIrq, uTagSrc)); 532 582 pBus->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pBus->CTX_SUFF(pDevIns), iForcedIrq, iLevel, uTagSrc); 533 583 } … … 608 658 NOREF(pvUser); 609 659 610 Log2 (("ich9pciMcfgMMIOWrite:%RGp(%d) \n", GCPhysAddr, cb));660 Log2Func(("%RGp(%d) \n", GCPhysAddr, cb)); 611 661 612 662 PCI_LOCK(pDevIns, VINF_IOM_R3_MMIO_WRITE); … … 660 710 NOREF(pvUser); 661 711 662 LogFlow (("ich9pciMcfgMMIORead:%RGp(%d) \n", GCPhysAddr, cb));712 LogFlowFunc(("%RGp(%d) \n", GCPhysAddr, cb)); 663 713 664 714 PCI_LOCK(pDevIns, VINF_IOM_R3_MMIO_READ); … … 722 772 /* safe, only needs to go to the config space array */ 723 773 uint32_t uSubordinate = PDMPciDevGetByte(pBridge, VBOX_PCI_SUBORDINATE_BUS); 724 Log3 (("ich9pciFindBridge onbus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, uBus, uSecondary, uSubordinate));774 Log3Func(("bus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, uBus, uSecondary, uSubordinate)); 725 775 if (uBus >= uSecondary && uBus <= uSubordinate) 726 776 return pBridge; … … 828 878 VERR_INVALID_PARAMETER); 829 879 830 Log(("devpciR3CommonIORegionRegister: %s region %d size %RGp type %x\n", 831 pPciDev->pszNameR3, iRegion, cbRegion, enmType)); 880 LogFunc(("%s region %d size %RGp type %x\n", pPciDev->pszNameR3, iRegion, cbRegion, enmType)); 832 881 833 882 /* Make sure that we haven't marked this region as continuation of 64-bit region. */ … … 979 1028 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 980 1029 981 LogFlowFunc((" :pDevIns=%p uBus=%d uDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, u32Value, cb));1030 LogFlowFunc(("pDevIns=%p uBus=%d uDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, u32Value, cb)); 982 1031 983 1032 /* If the current bus is not the target bus search for the bus which contains the device. */ … … 999 1048 if (pPciDev) 1000 1049 { 1001 Log (("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));1050 LogFunc(("%s: addr=%02x val=%08x len=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb)); 1002 1051 pPciDev->Int.s.pfnConfigWrite(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, u32Value, cb); 1003 1052 } … … 1010 1059 uint32_t u32Value; 1011 1060 1012 LogFlowFunc((" :pDevIns=%p uBus=%d uDevice=%d u32Address=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, cb));1061 LogFlowFunc(("pDevIns=%p uBus=%d uDevice=%d u32Address=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, cb)); 1013 1062 1014 1063 /* If the current bus is not the target bus search for the bus which contains the device. */ … … 1033 1082 { 1034 1083 u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev->Int.s.CTX_SUFF(pDevIns), pPciDev, u32Address, cb); 1035 Log (("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->pszNameR3, u32Address, u32Value, cb));1084 LogFunc(("%s: u32Address=%02x u32Value=%08x cb=%d\n", pPciDev->pszNameR3, u32Address, u32Value, cb)); 1036 1085 } 1037 1086 else … … 1569 1618 { 1570 1619 pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, _4K); 1571 Log (("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosIo));1620 LogFunc(("Aligned I/O start address. New address %#x\n", pPciRoot->uPciBiosIo)); 1572 1621 } 1573 1622 ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_BASE, (pPciRoot->uPciBiosIo >> 8) & 0xf0, 1); … … 1577 1626 { 1578 1627 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M); 1579 Log (("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosMmio));1628 LogFunc(("Aligned MMIO start address. New address %#x\n", pPciRoot->uPciBiosMmio)); 1580 1629 } 1581 1630 ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pPciRoot->uPciBiosMmio >> 16) & UINT32_C(0xffff0), 2); … … 1717 1766 cbRegSize64 = cbRegSize32; 1718 1767 } 1719 Log2 (("%s: Size of region %u for device %d on bus %d is %lld\n", __FUNCTION__, iRegion, uDevFn, uBus, cbRegSize64));1768 Log2Func(("%s: Size of region %u for device %d on bus %d is %lld\n", iRegion, uDevFn, uBus, cbRegSize64)); 1720 1769 1721 1770 if (cbRegSize64) … … 1822 1871 cbRegSize64 = cbRegSize32; 1823 1872 } 1824 Log2 (("%s: Size of region %u for device %d on bus %d is %lld\n", __FUNCTION__, iRegion, uDevFn, uBus, cbRegSize64));1873 Log2Func(("%s: Size of region %u for device %d on bus %d is %lld\n", iRegion, uDevFn, uBus, cbRegSize64)); 1825 1874 1826 1875 if (cbRegSize64) … … 2185 2234 2186 2235 /* safe, only needs to go to the config space array */ 2187 Log2 (("ich9pciBiosInitBridgeTopology:for bus %p: primary=%d secondary=%d subordinate=%d\n",2236 Log2Func(("for bus %p: primary=%d secondary=%d subordinate=%d\n", 2188 2237 pBus, 2189 2238 PDMPciDevGetByte(pBridgeDev, VBOX_PCI_PRIMARY_BUS), … … 2197 2246 2198 2247 /** 2199 * @interface_method_impl{PDMPCIBUSREG,pfnFakePCIBIOSR3} 2200 */ 2201 static DECLCALLBACK(int) ich9pciFakePCIBIOS(PPDMDEVINS pDevIns) 2248 * Worker for Fake PCI BIOS config 2249 * 2250 * @returns VBox status code. 2251 * 2252 * @param pDevIns ICH9 device instance. 2253 */ 2254 static int ich9pciFakePCIBIOS(PPDMDEVINS pDevIns) 2202 2255 { 2203 2256 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); … … 2205 2258 uint32_t const cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM); 2206 2259 uint64_t const cbAbove4GB = MMR3PhysGetRamSizeAbove4GB(pVM); 2260 2261 LogRel(("PCI: setting up topology, resources and interrupts\n")); 2207 2262 2208 2263 /** @todo r=klaus this needs to do the same elcr magic as DevPCI.cpp, as the BIOS can't be trusted to do the right thing. Of course it's more difficult than with the old code, as there are bridges to be handled. The interrupt routing needs to be taken into account. Also I highly suspect that the chipset has 8 interrupt lines which we might be able to use for handling things on the root bus better (by treating them as devices on the mainboard). */ … … 2278 2333 if ( pciDevIsMsiCapable(pPciDev) 2279 2334 && uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset < (uint32_t)pPciDev->Int.s.u8MsiCapSize ) 2280 Log2 (("devpciR3CommonDefaultConfigRead:MSI CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));2335 Log2Func(("MSI CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue)); 2281 2336 else if ( pciDevIsMsixCapable(pPciDev) 2282 2337 && uAddress - (uint32_t)pPciDev->Int.s.u8MsixCapOffset < (uint32_t)pPciDev->Int.s.u8MsixCapSize) 2283 Log2 (("devpciR3CommonDefaultConfigRead:MSI-X CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));2338 Log2Func(("MSI-X CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue)); 2284 2339 #endif 2285 2340 } … … 2456 2511 { 2457 2512 PCIIORegion *pRegion = &pPciDev->Int.s.aIORegions[iRegion]; 2458 Log3 (("devpciR3WriteBarByte:region=%d off=%d val=%#x size=%#llx\n", iRegion, off, bVal, pRegion->size));2513 Log3Func(("region=%d off=%d val=%#x size=%#llx\n", iRegion, off, bVal, pRegion->size)); 2459 2514 Assert(off <= 3); 2460 2515 … … 2484 2539 bVal = (bOld & bMask) | (bVal & ~bMask); 2485 2540 2486 Log3 (("devpciR3WriteBarByte:%x changed to %x\n", bOld, bVal));2541 Log3Func(("%x changed to %x\n", bOld, bVal)); 2487 2542 2488 2543 /* safe, only needs to go to the config space array */ … … 3041 3096 PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks; 3042 3097 PciBusReg.pfnSetIrqR3 = ich9pciSetIrq; 3043 PciBusReg.pfnFakePCIBIOSR3 = ich9pciFakePCIBIOS;3044 3098 PciBusReg.pszSetIrqRC = fGCEnabled ? "ich9pciSetIrq" : NULL; 3045 3099 PciBusReg.pszSetIrqR0 = fR0Enabled ? "ich9pciSetIrq" : NULL; … … 3114 3168 } 3115 3169 3170 rc = PDMDevHlpIOPortRegister(pDevIns, 0x0410, 1, NULL, ich9pciR3IOPortMagicPCIWrite, ich9pciR3IOPortMagicPCIRead, NULL, NULL, "ICH9 (Fake PCI BIOS trigger)"); 3171 if (RT_FAILURE(rc)) 3172 return rc; 3173 3116 3174 if (pPciRoot->u64PciConfigMMioAddress != 0) 3117 3175 { … … 3267 3325 static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns) 3268 3326 { 3327 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 3328 3269 3329 /* Reset everything under the root bridge. */ 3270 3330 ich9pciResetBridge(pDevIns); … … 3373 3433 pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 3374 3434 /** @todo r=klaus figure out how to extend this to allow PCIe config space 3375 * extension, which increases the config space fro rm 256 bytes to 4K. */3435 * extension, which increases the config space from 256 bytes to 4K. */ 3376 3436 pBus->papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pBus->apDevices)); 3377 3437 AssertLogRelReturn(pBus->papBridgesR3, VERR_NO_MEMORY); … … 3384 3444 PciBusReg.pfnSetConfigCallbacksR3 = devpciR3CommonSetConfigCallbacks; 3385 3445 PciBusReg.pfnSetIrqR3 = ich9pcibridgeSetIrq; 3386 PciBusReg.pfnFakePCIBIOSR3 = NULL; /* Only needed for the first bus. */3387 3446 PciBusReg.pszSetIrqRC = fGCEnabled ? "ich9pcibridgeSetIrq" : NULL; 3388 3447 PciBusReg.pszSetIrqR0 = fR0Enabled ? "ich9pcibridgeSetIrq" : NULL; -
TabularUnified trunk/src/VBox/Devices/PC/BIOS/pcibios.inc ¶
r60422 r67668 96 96 push bp 97 97 mov bp, sp 98 ifdef VBOX 99 mov eax,19200509 100 mov dx,410h 101 out dx, eax 102 else 103 ; This incomplete PCI resource setup code is less functional than the PCI 104 ; resource assignment created by the fake PCI BIOS and is therefore disabled. 105 ; Blindly enabling everything on the root bus (including bus mastering!) can 106 ; only be called buggy. It causes the trouble with AMD PCNet which it then 107 ; tries to work around, but that still contains a race. 98 108 mov eax, 0E0000000h ; base for memory init 99 109 push eax … … 111 121 jz next_pci_dev 112 122 113 ifndef VBOX ; This currently breaks restoring a previously saved state. */123 ifndef VBOX ; This currently breaks restoring a previously saved state. 114 124 mov dl, 4 ; disable i/o and memory space access 115 125 call pcibios_init_sel_reg … … 201 211 cmp bx, 0100h 202 212 jne pci_init_io_loop1 213 endif ; !VBOX 203 214 mov sp, bp 204 215 pop bp … … 230 241 mov ax, 0F000h 231 242 mov ds, ax 243 ifndef VBOX 244 ; this code works OK, but it's unnecessary effort since the fake PCI BIOS 245 ; already configured the IRQ lines and the ELCR correctly 232 246 mov dx, 04D0h ;; reset ELCR1 + ELCR2 233 247 mov al, 0 … … 282 296 mov dl, 3Ch 283 297 call pcibios_init_sel_reg 284 mov dx, PCI_CFG2 + 1 ; TODO: was #0x0cfd - is that right?298 mov dx, PCI_CFG2 + 1 ; access config space at 3Dh 285 299 in al, dx 286 300 and al, 7 … … 332 346 pop bx 333 347 pci_init_end: 348 endif 334 349 pop bp 335 350 pop ds -
TabularUnified trunk/src/VBox/VMM/VMMR3/PDM.cpp ¶
r67583 r67668 1645 1645 } 1646 1646 1647 /*1648 * Run Fake PCI BIOS after reset.1649 */1650 if (fAtReset && pVM->pdm.s.aPciBuses[0].pDevInsR3)1651 {1652 pdmLock(pVM);1653 int rc = pVM->pdm.s.aPciBuses[0].pfnFakePCIBIOSR3(pVM->pdm.s.aPciBuses[0].pDevInsR3);1654 pdmUnlock(pVM);1655 if (RT_FAILURE(rc))1656 AssertMsgFailed(("PCI BIOS fake failed rc=%Rrc\n", rc));1657 }1658 1659 1660 1647 LogFlow(("PDMR3MemSetup: returns void\n")); 1661 1648 } -
TabularUnified trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp ¶
r65338 r67668 2613 2613 #if PDM_DEVHLPR3_VERSION >= PDM_VERSION_MAKE_PP(0xffe7, 20, 0) 2614 2614 LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, " 2615 ".pfnSetIrqR3=%p, .p fnFakePCIBIOSR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p piBus=%p\n",2615 ".pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p piBus=%p\n", 2616 2616 pDevIns->pReg->szName, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->pfnRegisterR3, 2617 pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pfnFakePCIBIOSR3, 2618 pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, 2619 ppPciHlpR3, piBus)); 2617 pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, 2618 pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3, piBus)); 2620 2619 #else 2621 2620 LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, " 2622 ".pfnSetIrqR3=%p, .p fnFakePCIBIOSR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p\n",2621 ".pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p\n", 2623 2622 pDevIns->pReg->szName, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->pfnRegisterR3, 2624 pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->p fnFakePCIBIOSR3,2625 pPciBusReg->pszSetIrqR C, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3));2623 pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, 2624 pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3)); 2626 2625 #endif 2627 2626 … … 2637 2636 if ( !pPciBusReg->pfnRegisterR3 2638 2637 || !pPciBusReg->pfnIORegionRegisterR3 2639 || !pPciBusReg->pfnSetIrqR3 2640 || (!pPciBusReg->pfnFakePCIBIOSR3 && !pVM->pdm.s.aPciBuses[0].pDevInsR3)) /* Only the first bus needs to do the BIOS work. */ 2638 || !pPciBusReg->pfnSetIrqR3) 2641 2639 { 2642 2640 Assert(pPciBusReg->pfnRegisterR3); 2643 2641 Assert(pPciBusReg->pfnIORegionRegisterR3); 2644 2642 Assert(pPciBusReg->pfnSetIrqR3); 2645 Assert(pPciBusReg->pfnFakePCIBIOSR3);2646 2643 LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER)); 2647 2644 return VERR_INVALID_PARAMETER; … … 2738 2735 pPciBus->pfnSetConfigCallbacksR3 = pPciBusReg->pfnSetConfigCallbacksR3; 2739 2736 pPciBus->pfnSetIrqR3 = pPciBusReg->pfnSetIrqR3; 2740 pPciBus->pfnFakePCIBIOSR3 = pPciBusReg->pfnFakePCIBIOSR3;2741 2737 2742 2738 Log(("PDM: Registered PCI bus device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns)); -
TabularUnified trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp ¶
r64626 r67668 424 424 425 425 /* 426 * 427 * PCI BIOS Fake and Init Complete. 428 * 429 */ 430 if (pVM->pdm.s.aPciBuses[0].pDevInsR3) 431 { 432 pdmLock(pVM); 433 rc = pVM->pdm.s.aPciBuses[0].pfnFakePCIBIOSR3(pVM->pdm.s.aPciBuses[0].pDevInsR3); 434 pdmUnlock(pVM); 435 if (RT_FAILURE(rc)) 436 { 437 AssertMsgFailed(("PCI BIOS fake failed rc=%Rrc\n", rc)); 438 return rc; 439 } 440 } 441 426 * Iterate thru the device instances and work the callback. 427 */ 442 428 for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3) 443 429 { -
TabularUnified trunk/src/VBox/VMM/include/PDMInternal.h ¶
r64655 r67668 641 641 DECLR3CALLBACKMEMBER(void, pfnSetConfigCallbacksR3,(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PFNPCICONFIGREAD pfnRead, 642 642 PPFNPCICONFIGREAD ppfnReadOld, PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld)); 643 /** @copydoc PDMPCIBUSREG::pfnFakePCIBIOSR3 */644 DECLR3CALLBACKMEMBER(int, pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));645 643 646 644 /** Pointer to the PIC device instance - R0. */
Note:
See TracChangeset
for help on using the changeset viewer.