VirtualBox

Changeset 20159 in vbox


Ignore:
Timestamp:
May 29, 2009 3:30:41 PM (16 years ago)
Author:
vboxsync
Message:

DevPCI: Fixed missing restore of register 0x38 (unknown).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r20156 r20159  
    13641364static void pciR3CommonRestoreConfig(PPCIDEVICE pDev, uint8_t const *pbSrcConfig, bool fIsBridge)
    13651365{
    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     */
    13681370    static const struct PciField
    13691371    {
     
    13891391        { 0x10, 4, 1, 3, "BASE_ADDRESS_0" },
    13901392        { 0x14, 4, 1, 3, "BASE_ADDRESS_1" },
    1391         { 0x18, 4, 1, 3, "BASE_ADDRESS_2" },
     1393        { 0x18, 4, 1, 1, "BASE_ADDRESS_2" },
    13921394        { 0x18, 1, 1, 2, "PRIMARY_BUS" },       // fWritable = ??
    13931395        { 0x19, 1, 1, 2, "SECONDARY_BUS" },     // fWritable = ??
     
    14131415        { 0x32, 2, 1, 2, "IO_LIMIT_UPPER16" },  // fWritable = ?!
    14141416        { 0x34, 4, 0, 3, "CAPABILITY_LIST" },   // fWritable = !? cb=!?
     1417        { 0x38, 4, 1, 1, "???" },               // ???
    14151418        { 0x38, 4, 1, 2, "ROM_ADDRESS_BR" },    // fWritable = !? cb=!? fBridge=!?
    14161419        { 0x3c, 1, 1, 3, "INTERRUPT_LINE" },    // fBridge=??
     
    14251428    };
    14261429
     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     */
    14271460    uint8_t const fBridge = fIsBridge ? 2 : 1;
    14281461    uint8_t *pbDstConfig = &pDev->config[0];
     
    14721505
    14731506    /*
    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.
    14781512     */
    14791513    for (uint32_t off = 0x40; off < sizeof(pDev->config); off++)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette