Changeset 67562 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 22, 2017 2:10:15 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116314
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r65867 r67562 96 96 int iIrq, int iLevel, uint32_t uTagSrc); 97 97 #ifdef IN_RING3 98 static void ich9pcibridgeReset(PPDMDEVINS pDevIns);99 98 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t uBus); 100 99 static void ich9pciBiosInitAllDevicesOnBus(PDEVPCIROOT pPciRoot, uint8_t uBus); … … 135 134 * of our parent passing the device which asserted the interrupt instead of the device of the bridge. 136 135 */ 137 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);136 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 138 137 PPDMPCIDEV pPciDevBus = pPciDev; 139 138 int iIrqPinBridge = iIrq; … … 1462 1461 { 1463 1462 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1464 PDEVPCIBUS 1465 uint32_t 1466 int 1463 PDEVPCIBUS pBus = &pThis->PciBus; 1464 uint32_t u32; 1465 int rc; 1467 1466 1468 1467 /* We ignore this version as there's no saved state with it anyway */ … … 3002 3001 */ 3003 3002 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 3004 PDEVPCIBUS 3003 PDEVPCIBUS pBus = &pPciRoot->PciBus; 3005 3004 /* Zero out everything */ 3006 3005 memset(pPciRoot, 0, sizeof(*pPciRoot)); … … 3181 3180 if (pRegion->size == 0) 3182 3181 continue; 3182 bool const f64Bit = (pRegion->type & ((uint8_t)(PCI_ADDRESS_SPACE_BAR64 | PCI_ADDRESS_SPACE_IO))) 3183 == PCI_ADDRESS_SPACE_BAR64; 3183 3184 3184 3185 ich9pciUnmapRegion(pDev, iRegion); 3186 3187 if (f64Bit) 3188 iRegion++; 3185 3189 } 3186 3190 … … 3209 3213 if (pciDevIsMsiCapable(pDev)) 3210 3214 { 3211 /* Extracted from MsiPciConfigWrite(). */3212 pDev->abConfig[pDev->Int.s.u8MsiCapOffset + VBOX_MSI_CAP_MESSAGE_CONTROL] &= 0x8e;3215 ich9pciSetWord(pDev, pDev->Int.s.u8MsiCapOffset + VBOX_MSI_CAP_MESSAGE_CONTROL, 3216 ich9pciGetWord(pDev, pDev->Int.s.u8MsiCapOffset + VBOX_MSI_CAP_MESSAGE_CONTROL) & 0xff8e); 3213 3217 } 3214 3218 … … 3216 3220 if (pciDevIsMsixCapable(pDev)) 3217 3221 { 3218 /* Extracted from MsixPciConfigWrite(); no side effects. */3219 pDev->abConfig[pDev->Int.s.u8MsixCapOffset + VBOX_MSIX_CAP_MESSAGE_CONTROL + 1] &= 0x3f;3222 ich9pciSetWord(pDev, pDev->Int.s.u8MsixCapOffset + VBOX_MSIX_CAP_MESSAGE_CONTROL, 3223 ich9pciGetWord(pDev, pDev->Int.s.u8MsixCapOffset + VBOX_MSIX_CAP_MESSAGE_CONTROL) & 0x3fff); 3220 3224 } 3221 3225 } … … 3224 3228 3225 3229 /** 3226 * @copydoc FNPDMDEVRESET 3227 */ 3228 static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns) 3229 { 3230 PDEVPCIROOT pPciRoot = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 3231 PDEVPCIBUS pBus = &pPciRoot->PciBus; 3230 * Recursive worker for ich9pciReset. 3231 * 3232 * @param pDevIns ICH9 bridge (root or PCI-to-PCI) instance. 3233 */ 3234 static void ich9pciResetBridge(PPDMDEVINS pDevIns) 3235 { 3236 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 3232 3237 3233 3238 /* PCI-specific reset for each device. */ … … 3241 3246 { 3242 3247 if (pBus->papBridgesR3[iBridge]) 3243 ich9pcibridgeReset(pBus->papBridgesR3[iBridge]->Int.s.CTX_SUFF(pDevIns)); 3244 } 3245 3248 ich9pciResetBridge(pBus->papBridgesR3[iBridge]->Int.s.CTX_SUFF(pDevIns)); 3249 } 3250 3251 /* Reset topology config for non-root bridge. Last thing to do, otherwise 3252 * the secondary and subordinate are instantly unreachable. */ 3253 if (pBus->iBus != 0) 3254 { 3255 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_PRIMARY_BUS, 0); 3256 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS, 0); 3257 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_SUBORDINATE_BUS, 0); 3258 /* Not resetting the address decoders of the bridge to 0, since the 3259 * PCI-to-PCI Bridge spec says that there is no default value. */ 3260 } 3261 } 3262 3263 3264 /** 3265 * @interface_method_impl{PDMDEVREG,pfnReset} 3266 */ 3267 static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns) 3268 { 3269 /* Reset everything under the root bridge. */ 3270 ich9pciResetBridge(pDevIns); 3271 3272 /* Do a fresh Fake PCI BIOS setup. */ 3246 3273 ich9pciFakePCIBIOS(pDevIns); 3247 3274 } … … 3512 3539 } 3513 3540 return VINF_SUCCESS; 3514 }3515 3516 /**3517 * @copydoc FNPDMDEVRESET3518 */3519 static void ich9pcibridgeReset(PPDMDEVINS pDevIns)3520 {3521 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);3522 3523 /* Reset config space to default values. */3524 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_PRIMARY_BUS, 0);3525 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS, 0);3526 ich9pciSetByte(&pBus->PciDev, VBOX_PCI_SUBORDINATE_BUS, 0);3527 3528 /* PCI-specific reset for each device. */3529 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)3530 {3531 if (pBus->apDevices[i])3532 ich9pciResetDevice(pBus->apDevices[i]);3533 }3534 3541 } 3535 3542
Note:
See TracChangeset
for help on using the changeset viewer.