Changeset 33687 in vbox
- Timestamp:
- Nov 2, 2010 1:05:01 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 added
- 3 edited
-
Devices/Bus/DevPciIch9.cpp (modified) (9 diffs)
-
Main/BusAssignmentManager.cpp (added)
-
Main/ConsoleImpl2.cpp (modified) (18 diffs)
-
Main/Makefile.kmk (modified) (1 diff)
-
Main/include/BusAssignmentManager.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r33606 r33687 253 253 { 254 254 PPCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PPCIGLOBALS); 255 255 256 PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE); 256 257 pThis->uConfigReg = u32 & ~3; /* Bits 0-1 are reserved and we silently clear them */ 257 258 PCI_UNLOCK(pDevIns); 258 259 } 260 259 261 return VINF_SUCCESS; 260 262 } … … 311 313 pBridgeDevice->Int.s.pfnBridgeConfigWrite(pBridgeDevice->pDevIns, pAddr->iBus, pAddr->iDeviceFunc, pAddr->iRegister, val, cb); 312 314 } 315 else 316 { 317 // do nothing, bridge not found 318 } 313 319 #else 314 320 rc = rcReschedule; … … 360 366 static void ich9pciNoMem(void* ptr, int cb) 361 367 { 362 memset(ptr, 0xff, cb); 368 for (int i = 0; i < cb; i++) 369 ((uint8_t*)ptr)[i] = 0xff; 363 370 } 364 371 … … 448 455 } 449 456 450 static int ich9pciDataRead(PPCIGLOBALS pGlobals, uint32_t addr, int len, uint32_t *pu32)457 static int ich9pciDataRead(PPCIGLOBALS pGlobals, uint32_t addr, int cb, uint32_t *pu32) 451 458 { 452 459 PciAddress aPciAddr; 453 460 454 LogFlow(("ich9pciDataRead: config=%x len=%d\n", pGlobals->uConfigReg, len)); 461 LogFlow(("ich9pciDataRead: config=%x cb=%d\n", pGlobals->uConfigReg, cb)); 462 463 *pu32 = 0xffffffff; 455 464 456 465 if (!(pGlobals->uConfigReg & (1 << 31))) … … 463 472 ich9pciStateToPciAddr(pGlobals, addr, &aPciAddr); 464 473 465 return ich9pciDataReadAddr(pGlobals, &aPciAddr, len, pu32, VINF_IOM_HC_IOPORT_READ);474 return ich9pciDataReadAddr(pGlobals, &aPciAddr, cb, pu32, VINF_IOM_HC_IOPORT_READ); 466 475 } 467 476 … … 1038 1047 } 1039 1048 else 1040 ich9pciNoMem(&u32Value, cb);1049 ich9pciNoMem(&u32Value, 4); 1041 1050 } 1042 1051 else … … 1050 1059 } 1051 1060 else 1052 ich9pciNoMem(&u32Value, cb);1061 ich9pciNoMem(&u32Value, 4); 1053 1062 } 1054 1063 … … 1979 1988 }, 1980 1989 /* Disable, if we may wish to have multiple AHCI controllers */ 1981 #if 11982 1990 { 1983 1991 "ahci", 31, 2 /* SATA controller */ 1984 1992 }, 1985 #endif1986 1993 { 1987 1994 "smbus", 31, 3 /* System Management Bus */ … … 2021 2028 2022 2029 int iStartPos = 0; 2023 2024 /* We add bridges starting slot 22 */2025 if (!strcmp(pszName, "ich9pcibridge"))2026 {2027 iStartPos = 22 * 8;2028 }2029 2030 2030 2031 /* Otherwise when assigning a slot, we need to make sure all its functions are available */ -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r33606 r33687 108 108 109 109 #include "DHCPServerRunner.h" 110 #include "BusAssignmentManager.h" 110 111 111 112 #if defined(RT_OS_DARWIN) … … 467 468 { 468 469 LogFlowFuncEnter(); 469 /* Note: hardcoded assumption about number of slots; see rom bios */ 470 bool afPciDeviceNo[32] = {false}; 470 PciBusAddress PciAddr; 471 471 bool fFdcEnabled = false; 472 472 BOOL fIs64BitGuest = false; … … 547 547 u64McfgBase = _4G - cbRamHole; 548 548 } 549 550 ComPtr<BusAssignmentManager> BusMgr = 551 BusAssignmentManager::getInstance(chipsetType); 549 552 550 553 ULONG cCpus = 1; … … 879 882 InsertConfigNode(pDev, "0", &pInst); 880 883 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 884 PciAddr = PciBusAddress(0, 24, 0); 885 hrc = BusMgr->assignPciDevice("ich9pcibridge", pInst, PciAddr); H(); 881 886 882 887 InsertConfigNode(pDev, "1", &pInst); 883 888 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 889 PciAddr = PciBusAddress(0, 25, 0); 890 hrc = BusMgr->assignPciDevice("ich9pcibridge", pInst, PciAddr); H(); 884 891 } 885 892 … … 1049 1056 InsertConfigNode(pDev, "0", &pInst); 1050 1057 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1051 InsertConfigInteger(pInst, "PCIDeviceNo", 2); 1052 Assert(!afPciDeviceNo[2]); 1053 afPciDeviceNo[2] = true; 1054 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 1058 1059 PciAddr = PciBusAddress(0, 2, 0); 1060 hrc = BusMgr->assignPciDevice("vga", pInst, PciAddr); H(); 1055 1061 InsertConfigNode(pInst, "Config", &pCfg); 1056 1062 ULONG cVRamMBs; … … 1319 1325 case StorageControllerType_LsiLogic: 1320 1326 { 1321 // InsertConfigInteger(pCtlInst, "PCIBusNo", 1); 1322 InsertConfigInteger(pCtlInst, "PCIDeviceNo", 20); 1323 Assert(!afPciDeviceNo[20]); 1324 afPciDeviceNo[20] = true; 1325 InsertConfigInteger(pCtlInst, "PCIFunctionNo", 0); 1327 PciAddr = PciBusAddress(1, 20, 0); 1328 hrc = BusMgr->assignPciDevice("lsilogic", pCtlInst, PciAddr); H(); 1329 1326 1330 1327 1331 /* Attach the status driver */ … … 1339 1343 case StorageControllerType_BusLogic: 1340 1344 { 1341 InsertConfigInteger(pCtlInst, "PCIDeviceNo", 21); 1342 Assert(!afPciDeviceNo[21]); 1343 afPciDeviceNo[21] = true; 1344 InsertConfigInteger(pCtlInst, "PCIFunctionNo", 0); 1345 PciAddr = PciBusAddress(0, 21, 0); 1346 hrc = BusMgr->assignPciDevice("buslogic", pCtlInst, PciAddr); H(); 1345 1347 1346 1348 /* Attach the status driver */ … … 1358 1360 case StorageControllerType_IntelAhci: 1359 1361 { 1360 InsertConfigInteger(pCtlInst, "PCIDeviceNo", 13); 1361 Assert(!afPciDeviceNo[13]); 1362 afPciDeviceNo[13] = true; 1363 InsertConfigInteger(pCtlInst, "PCIFunctionNo", 0); 1362 PciAddr = PciBusAddress(0, 13, 0); 1363 hrc = BusMgr->assignPciDevice("ahci", pCtlInst, PciAddr); H(); 1364 1364 1365 1365 ULONG cPorts = 0; … … 1406 1406 * IDE (update this when the main interface changes) 1407 1407 */ 1408 InsertConfigInteger(pCtlInst, "PCIDeviceNo", 1); 1409 Assert(!afPciDeviceNo[1]); 1410 afPciDeviceNo[1] = true; 1411 InsertConfigInteger(pCtlInst, "PCIFunctionNo", 1); 1408 PciAddr = PciBusAddress(0, 1, 1); 1409 hrc = BusMgr->assignPciDevice("ide", pCtlInst, PciAddr); H(); 1412 1410 InsertConfigString(pCfg, "Type", controllerString(enmCtrlType)); 1413 1411 … … 1454 1452 case StorageControllerType_LsiLogicSas: 1455 1453 { 1456 InsertConfigInteger(pCtlInst, "PCIDeviceNo", 22); 1457 Assert(!afPciDeviceNo[22]); 1458 afPciDeviceNo[22] = true; 1459 InsertConfigInteger(pCtlInst, "PCIFunctionNo", 0); 1454 PciAddr = PciBusAddress(0, 22, 0); 1455 hrc = BusMgr->assignPciDevice("lsilogicsas", pCtlInst, PciAddr); H(); 1460 1456 1461 1457 InsertConfigString(pCfg, "ControllerType", "SAS1068"); … … 1591 1587 iPciDeviceNo = 3; 1592 1588 #endif 1593 InsertConfigInteger(pInst, "PCIDeviceNo", iPciDeviceNo); 1594 Assert(!afPciDeviceNo[iPciDeviceNo]); 1595 afPciDeviceNo[iPciDeviceNo] = true; 1596 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 1589 PciAddr = PciBusAddress(0, iPciDeviceNo, 0); 1590 hrc = BusMgr->assignPciDevice(pszAdapterName, pInst, PciAddr); H(); 1591 1597 1592 InsertConfigNode(pInst, "Config", &pCfg); 1598 1593 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ … … 1819 1814 InsertConfigNode(pInst, "Config", &pCfg); 1820 1815 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1821 InsertConfigInteger(pInst, "PCIDeviceNo", 4); 1822 Assert(!afPciDeviceNo[4]); 1823 afPciDeviceNo[4] = true; 1824 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 1816 PciAddr = PciBusAddress(0, 4, 0); 1817 hrc = BusMgr->assignPciDevice("VMMDev", pInst, PciAddr); H(); 1818 1825 1819 Bstr hwVersion; 1826 1820 hrc = pMachine->COMGETTER(HardwareVersion)(hwVersion.asOutParam()); H(); … … 1883 1877 InsertConfigNode(pDev, "0", &pInst); 1884 1878 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1885 InsertConfigInteger(pInst, "PCIDeviceNo", 5); 1886 Assert(!afPciDeviceNo[5]); 1887 afPciDeviceNo[5] = true; 1888 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 1879 PciAddr = PciBusAddress(0, 5, 0); 1880 hrc = BusMgr->assignPciDevice("ichac97", pInst, PciAddr); H(); 1889 1881 InsertConfigNode(pInst, "Config", &pCfg); 1890 1882 break; … … 1910 1902 InsertConfigNode(pDev, "0", &pInst); 1911 1903 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1912 InsertConfigInteger(pInst, "PCIDeviceNo", 5); 1913 Assert(!afPciDeviceNo[5]); 1914 afPciDeviceNo[5] = true; 1915 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 1904 PciAddr = PciBusAddress(0, 5, 0); 1905 hrc = BusMgr->assignPciDevice("hda", pInst, PciAddr); H(); 1916 1906 InsertConfigNode(pInst, "Config", &pCfg); 1917 1907 } … … 2012 2002 InsertConfigNode(pInst, "Config", &pCfg); 2013 2003 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 2014 InsertConfigInteger(pInst, "PCIDeviceNo", 6); 2015 Assert(!afPciDeviceNo[6]); 2016 afPciDeviceNo[6] = true; 2017 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 2018 2004 PciAddr = PciBusAddress(0, 6, 0); 2005 hrc = BusMgr->assignPciDevice("usb-ohci", pInst, PciAddr); H(); 2019 2006 InsertConfigNode(pInst, "LUN#0", &pLunL0); 2020 2007 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); … … 2040 2027 InsertConfigNode(pInst, "Config", &pCfg); 2041 2028 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 2042 InsertConfigInteger(pInst, "PCIDeviceNo", 11); 2043 Assert(!afPciDeviceNo[11]); 2044 afPciDeviceNo[11] = true; 2045 InsertConfigInteger(pInst, "PCIFunctionNo", 0); 2029 PciAddr = PciBusAddress(0, 11, 0); 2030 hrc = BusMgr->assignPciDevice("usb-ohci", pInst, PciAddr); H(); 2046 2031 2047 2032 InsertConfigNode(pInst, "LUN#0", &pLunL0); … … 2302 2287 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 2303 2288 InsertConfigNode(pInst, "Config", &pCfg); 2289 PciAddr = PciBusAddress(0, 7, 0); 2290 hrc = BusMgr->assignPciDevice("acpi", pInst, PciAddr); H(); 2291 2304 2292 InsertConfigInteger(pCfg, "RamSize", cbRam); 2305 2293 InsertConfigInteger(pCfg, "RamHoleSize", cbRamHole); … … 2332 2320 InsertConfigInteger(pCfg, "ShowCpu", fShowCpu); 2333 2321 InsertConfigInteger(pCfg, "CpuHotPlug", fCpuHotPlug); 2334 InsertConfigInteger(pInst, "PCIDeviceNo", 7);2335 Assert(!afPciDeviceNo[7]);2336 afPciDeviceNo[7] = true;2337 InsertConfigInteger(pInst, "PCIFunctionNo", 0);2338 2322 2339 2323 InsertConfigNode(pInst, "LUN#0", &pLunL0); -
trunk/src/VBox/Main/Makefile.kmk
r33627 r33687 636 636 VMMDevInterface.cpp \ 637 637 EventImpl.cpp \ 638 BusAssignmentManager.cpp \ 638 639 $(VBOX_AUTOGEN_EVENT_CPP) \ 639 640 $(VBOX_XML_SCHEMADEFS_CPP) \
Note:
See TracChangeset
for help on using the changeset viewer.

