VirtualBox

Changeset 104569 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 9, 2024 2:23:46 PM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163108
Message:

DevXHCI: Avoid needless conditionals when toggling the DCS bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevXHCI.cpp

    r104280 r104569  
    29662966                Log2(("Link extra-TD: Ptr=%RGp IOC=%u TC=%u CH=%u\n", xfer.link.rseg_ptr, xfer.link.ioc, xfer.link.toggle, xfer.link.chain));
    29672967                Assert(!xfer.link.chain);
     2968                AssertCompile(XHCI_TRDP_DCS_MASK == 1); /* link.toggle is 0 or 1, can be used as XHCI_TRDP_DCS_MASK */
    29682969                /* Set new TRDP but leave DCS bit alone... */
    29692970                pEpCtx->trdp = (xfer.link.rseg_ptr & XHCI_TRDP_ADDR_MASK) | (pEpCtx->trdp & XHCI_TRDP_DCS_MASK);
    29702971                /* ...and flip the DCS bit if required. Then update the TREP. */
    2971                 if (xfer.link.toggle)
    2972                     pEpCtx->trdp = (pEpCtx->trdp & ~XHCI_TRDP_DCS_MASK) | (pEpCtx->trdp ^ XHCI_TRDP_DCS_MASK);
     2972                pEpCtx->trdp = pEpCtx->trdp ^ xfer.link.toggle;
    29732973                if (!fInFlight)
    29742974                    pEpCtx->trep = pEpCtx->trdp;
     
    39433943                ep_ctx.trep = (xfer.link.rseg_ptr & XHCI_TRDP_ADDR_MASK) | (ep_ctx.trep & XHCI_TRDP_DCS_MASK);
    39443944                /* ...and flip the DCS bit if required. Then update the TREP. */
    3945                 if (xfer.link.toggle)
    3946                     ep_ctx.trep = (ep_ctx.trep & ~XHCI_TRDP_DCS_MASK) | (ep_ctx.trep ^ XHCI_TRDP_DCS_MASK);
     3945                ep_ctx.trep = ep_ctx.trep ^ xfer.link.toggle;
    39473946                rc = xhciR3WriteBackEp(pDevIns, pThis, uSlotID, uDBTarget, &ep_ctx);
    39483947                break;
Note: See TracChangeset for help on using the changeset viewer.

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