Changeset 34746 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 6, 2010 1:23:17 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68551
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r34516 r34746 2122 2122 } 2123 2123 2124 static void ich9pciBusInfo(PPCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent )2124 static void ich9pciBusInfo(PPCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent, bool fRegisters) 2125 2125 { 2126 2126 for (uint32_t iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++) … … 2172 2172 } 2173 2173 } 2174 2175 if (fRegisters) 2176 { 2177 printIndent(pHlp, iIndent + 2); 2178 pHlp->pfnPrintf(pHlp, " PCI registers:\n"); 2179 for (int iReg = 0; iReg < 0x100; ) 2180 { 2181 int iPerLine = 0x10; 2182 Assert (0x100 % iPerLine == 0); 2183 printIndent(pHlp, iIndent + 3); 2184 2185 while (iPerLine-- > 0) 2186 { 2187 pHlp->pfnPrintf(pHlp, "%02x ", pPciDev->config[iReg++]); 2188 } 2189 pHlp->pfnPrintf(pHlp, "\n"); 2190 } 2191 } 2174 2192 } 2175 2193 } … … 2182 2200 { 2183 2201 PPCIBUS pBusSub = PDMINS_2_DATA(pBus->papBridgesR3[iBridge]->pDevIns, PPCIBUS); 2184 ich9pciBusInfo(pBusSub, pHlp, iIndent + 1 );2202 ich9pciBusInfo(pBusSub, pHlp, iIndent + 1, fRegisters); 2185 2203 } 2186 2204 } … … 2198 2216 PPCIBUS pBus = DEVINS_2_PCIBUS(pDevIns); 2199 2217 2200 ich9pciBusInfo(pBus, pHlp, 0); 2218 if (pszArgs == NULL || !strcmp(pszArgs, "basic")) 2219 { 2220 ich9pciBusInfo(pBus, pHlp, 0, false); 2221 } 2222 else if (!strcmp(pszArgs, "verbose")) 2223 { 2224 ich9pciBusInfo(pBus, pHlp, 0, true); 2225 } 2226 else 2227 { 2228 pHlp->pfnPrintf(pHlp, "Invalid argument. Recognized arguments are 'basic', 'verbose'.\n"); 2229 } 2201 2230 } 2202 2231 … … 2422 2451 static void ich9pciResetDevice(PPCIDEVICE pDev) 2423 2452 { 2424 pDev->config[VBOX_PCI_COMMAND] &= ~(VBOX_PCI_COMMAND_IO | VBOX_PCI_COMMAND_MEMORY | 2425 VBOX_PCI_COMMAND_MASTER); 2426 2453 PCIDevSetCommand(pDev, 2454 PCIDevGetCommand(pDev) 2455 & 2456 ~(VBOX_PCI_COMMAND_IO | 2457 VBOX_PCI_COMMAND_MEMORY | 2458 VBOX_PCI_COMMAND_MASTER)); 2459 2460 /* Bridge device has its own reset handler clearing PCI registers */ 2427 2461 if (!PCIIsPci2PciBridge(pDev)) 2428 2462 { 2429 2463 PCIDevSetByte(pDev, VBOX_PCI_CACHE_LINE_SIZE, 0x0); 2430 PCIDevSetByte(pDev, VBOX_PCI_INTERRUPT_LINE, 0x0); 2431 } 2432 else 2433 { 2434 /* @todo: reset devices behind the bridge too */ 2435 } 2436 /* Regions ? */ 2464 PCIDevSetInterruptLine(pDev, 0x0); 2465 } 2466 /* Clear regions too ? */ 2437 2467 } 2438 2468 … … 2456 2486 } 2457 2487 2488 static void ich9pciRelocateDevice(PPCIDEVICE pDev, RTGCINTPTR offDelta) 2489 { 2490 if (pDev) 2491 { 2492 pDev->Int.s.pBusRC += offDelta; 2493 if (pDev->Int.s.pMsixPageRC) 2494 pDev->Int.s.pMsixPageRC += offDelta; 2495 } 2496 } 2497 2458 2498 /** 2459 2499 * @copydoc FNPDMDEVRELOCATE … … 2470 2510 /* Relocate RC pointers for the attached pci devices. */ 2471 2511 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 2472 { 2473 if (pBus->apDevices[i]) 2474 { 2475 pBus->apDevices[i]->Int.s.pBusRC += offDelta; 2476 if (pBus->apDevices[i]->Int.s.pMsixPageRC) 2477 pBus->apDevices[i]->Int.s.pMsixPageRC += offDelta; 2478 } 2479 } 2512 ich9pciRelocateDevice(pBus->apDevices[i], offDelta); 2480 2513 2481 2514 } … … 2616 2649 PCIDevSetByte(&pBus->aPciDev, VBOX_PCI_SECONDARY_BUS, 0); 2617 2650 PCIDevSetByte(&pBus->aPciDev, VBOX_PCI_SUBORDINATE_BUS, 0); 2651 2652 /* PCI-specific reset for each device. */ 2653 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 2654 { 2655 if (pBus->apDevices[i]) 2656 ich9pciResetDevice(pBus->apDevices[i]); 2657 } 2618 2658 } 2619 2659 … … 2629 2669 /* Relocate RC pointers for the attached pci devices. */ 2630 2670 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 2631 { 2632 if (pBus->apDevices[i]) 2633 pBus->apDevices[i]->Int.s.pBusRC += offDelta; 2634 } 2635 2671 ich9pciRelocateDevice(pBus->apDevices[i], offDelta); 2636 2672 } 2637 2673
Note:
See TracChangeset
for help on using the changeset viewer.