- Timestamp:
- Nov 16, 2017 7:52:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r69500 r69721 1427 1427 } 1428 1428 1429 1430 /** 1431 * Updates the data in the given page cache if the given guest physical address is currently contained 1432 * in the cache. 1433 * 1434 * @returns nothing. 1435 * @param pPageCache The page cache to update. 1436 * @param GCPhys The guest physical address needing the update. 1437 * @param pvBuf Pointer to the buffer to update the page cache with. 1438 * @param cbBuf Number of bytes to update. 1439 */ 1440 static void ohciPhysCacheUpdate(POHCIPAGECACHE pPageCache, RTGCPHYS GCPhys, const void *pvBuf, size_t cbBuf) 1441 { 1442 const RTGCPHYS GCPhysPage = PAGE_ADDRESS(GCPhys); 1443 1444 if (GCPhysPage == pPageCache->GCPhysReadCacheAddr) 1445 { 1446 uint32_t offPage = GCPhys & PAGE_OFFSET_MASK; 1447 memcpy(&pPageCache->au8PhysReadCache[offPage], pvBuf, RT_MIN(PAGE_SIZE - offPage, cbBuf)); 1448 } 1449 } 1450 1429 1451 static void ohciReadEdCached(POHCI pThis, uint32_t EdAddr, POHCIED pEd) 1430 1452 { … … 1435 1457 { 1436 1458 ohciPhysReadCacheRead(pThis, pThis->pCacheTD, TdAddr, pTd, sizeof(*pTd)); 1459 } 1460 1461 1462 /** 1463 * Update any cached ED data with the given endpoint descriptor at the given address. 1464 * 1465 * @returns nothing. 1466 * @param pThis The OHCI instance data. 1467 * @param EdAddr Endpoint descriptor address. 1468 * @param pEd The endpoint descriptor which got updated. 1469 */ 1470 DECLINLINE(void) ohciCacheEdUpdate(POHCI pThis, RTGCPHYS32 EdAddr, PCOHCIED pEd) 1471 { 1472 ohciPhysCacheUpdate(pThis->pCacheED, EdAddr, pEd, sizeof(*pEd)); 1473 } 1474 1475 1476 /** 1477 * Update any cached TD data with the given transfer descriptor at the given address. 1478 * 1479 * @returns nothing. 1480 * @param pThis The OHCI instance data. 1481 * @param TdAddr Transfer descriptor address. 1482 * @param pTd The transfer descriptor which got updated. 1483 */ 1484 DECLINLINE(void) ohciCacheTdUpdate(POHCI pThis, RTGCPHYS32 TdAddr, PCOHCITD pTd) 1485 { 1486 ohciPhysCacheUpdate(pThis->pCacheTD, TdAddr, pTd, sizeof(*pTd)); 1437 1487 } 1438 1488 … … 1571 1621 1572 1622 ohciPutDWords(pThis, EdAddr, (uint32_t *)pEd, sizeof(*pEd) >> 2); 1623 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 1624 ohciCacheEdUpdate(pThis, EdAddr, pEd); 1625 #endif 1573 1626 } 1574 1627 … … 1602 1655 # endif 1603 1656 ohciPutDWords(pThis, TdAddr, (uint32_t *)pTd, sizeof(*pTd) >> 2); 1657 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 1658 ohciCacheTdUpdate(pThis, TdAddr, pTd); 1659 #endif 1604 1660 } 1605 1661
Note:
See TracChangeset
for help on using the changeset viewer.