Changeset 20159 in vbox
- Timestamp:
- May 29, 2009 3:30:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r20156 r20159 1364 1364 static void pciR3CommonRestoreConfig(PPCIDEVICE pDev, uint8_t const *pbSrcConfig, bool fIsBridge) 1365 1365 { 1366 /* This table defines the fields for normal devices and bridge devices, and 1367 the order in which they need to be restored. */ 1366 /* 1367 * This table defines the fields for normal devices and bridge devices, and 1368 * the order in which they need to be restored. 1369 */ 1368 1370 static const struct PciField 1369 1371 { … … 1389 1391 { 0x10, 4, 1, 3, "BASE_ADDRESS_0" }, 1390 1392 { 0x14, 4, 1, 3, "BASE_ADDRESS_1" }, 1391 { 0x18, 4, 1, 3, "BASE_ADDRESS_2" },1393 { 0x18, 4, 1, 1, "BASE_ADDRESS_2" }, 1392 1394 { 0x18, 1, 1, 2, "PRIMARY_BUS" }, // fWritable = ?? 1393 1395 { 0x19, 1, 1, 2, "SECONDARY_BUS" }, // fWritable = ?? … … 1413 1415 { 0x32, 2, 1, 2, "IO_LIMIT_UPPER16" }, // fWritable = ?! 1414 1416 { 0x34, 4, 0, 3, "CAPABILITY_LIST" }, // fWritable = !? cb=!? 1417 { 0x38, 4, 1, 1, "???" }, // ??? 1415 1418 { 0x38, 4, 1, 2, "ROM_ADDRESS_BR" }, // fWritable = !? cb=!? fBridge=!? 1416 1419 { 0x3c, 1, 1, 3, "INTERRUPT_LINE" }, // fBridge=?? … … 1425 1428 }; 1426 1429 1430 #ifdef RT_STRICT 1431 /* Check that we've got full register coverage. */ 1432 uint32_t bmDevice[0x40 / 32]; 1433 uint32_t bmBridge[0x40 / 32]; 1434 RT_ZERO(bmDevice); 1435 RT_ZERO(bmBridge); 1436 for (uint32_t i = 0; i < RT_ELEMENTS(s_aFields); i++) 1437 { 1438 uint8_t off = s_aFields[i].off; 1439 uint8_t cb = s_aFields[i].cb; 1440 uint8_t f = s_aFields[i].fBridge; 1441 while (cb-- > 0) 1442 { 1443 if (f & 1) AssertMsg(!ASMBitTest(bmDevice, off), ("%#x\n", off)); 1444 if (f & 2) AssertMsg(!ASMBitTest(bmBridge, off), ("%#x\n", off)); 1445 if (f & 1) ASMBitSet(bmDevice, off); 1446 if (f & 2) ASMBitSet(bmBridge, off); 1447 off++; 1448 } 1449 } 1450 for (uint32_t off = 0; off < 0x40; off++) 1451 { 1452 AssertMsg(ASMBitTest(bmDevice, off), ("%#x\n", off)); 1453 AssertMsg(ASMBitTest(bmBridge, off), ("%#x\n", off)); 1454 } 1455 #endif 1456 1457 /* 1458 * Loop thru the fields covering the 64 bytes of standard registers. 1459 */ 1427 1460 uint8_t const fBridge = fIsBridge ? 2 : 1; 1428 1461 uint8_t *pbDstConfig = &pDev->config[0]; … … 1472 1505 1473 1506 /* 1474 * The device dependent registers. We will not use ConfigWrite here as we 1475 * have no clue about the size of the registers, so the device is 1476 * responsible for correctly restoring functionality governed by these 1477 * registers. 1507 * The device dependent registers. 1508 * 1509 * We will not use ConfigWrite here as we have no clue about the size 1510 * of the registers, so the device is responsible for correctly 1511 * restoring functionality governed by these registers. 1478 1512 */ 1479 1513 for (uint32_t off = 0x40; off < sizeof(pDev->config); off++)
Note:
See TracChangeset
for help on using the changeset viewer.