Changeset 105209 in vbox for trunk/src/VBox/Devices/USB
- Timestamp:
- Jul 9, 2024 7:19:57 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevEHCI.cpp
r104838 r105209 162 162 RTGCPHYS TdAddr; 163 163 /** A copy of the TD. */ 164 uint32_t TdCopy[1 6];164 uint32_t TdCopy[18]; 165 165 } VUSBURBHCITDINT; 166 166 … … 527 527 /** @} */ 528 528 529 /* ITD with extra padding to add 8th 'Buffer' entry. The PG member of529 /* ITD with extra padding to add 8th and 9th 'Buffer' entry. The PG member of 530 530 * EHCI_ITD_TRANSACTION can contain values in the 0-7 range, but only values 531 531 * 0-6 are valid. The extra padding is added to avoid cluttering the code 532 532 * with range checks; ehciR3ReadItd() initializes the pad with a safe value. 533 533 * The EHCI 1.0 specification explicitly says using PG value of 7 yields 534 * undefined behavior. 534 * undefined behavior. Two pad entries are needed because initial PG value 535 * of 7 (already 'wrong') can cross to the next page (8). 535 536 */ 536 537 typedef struct 537 538 { 538 EHCI_ITD itd; 539 EHCI_BUFFER_PTR pad; 539 EHCI_TD_PTR Next; 540 EHCI_ITD_TRANSACTION Transaction[EHCI_NUM_ITD_TRANSACTIONS]; 541 union 542 { 543 EHCI_ITD_MISC Misc; 544 EHCI_BUFFER_PTR Buffer[EHCI_NUM_ITD_PAGES + 2]; 545 } Buffer; 540 546 } EHCI_ITD_PAD, *PEHCI_ITD_PAD; 541 AssertCompileSize(EHCI_ITD_PAD, 0x4 4);547 AssertCompileSize(EHCI_ITD_PAD, 0x48); 542 548 543 549 /** @name Split Transaction Isochronous Transfer Descriptor (siTD) … … 1472 1478 { 1473 1479 ehciGetDWords(pDevIns, GCPhys, (uint32_t *)pPItd, sizeof(EHCI_ITD) >> 2); 1474 pPItd->pad.Pointer = 0xFFFFF; /* Direct accesses at the last page under 4GB (ROM). */ 1480 pPItd->Buffer.Buffer[7].Pointer = 0xFFFFF; /* Direct ill-defined accesses to the last page under 4GB (ROM). */ 1481 pPItd->Buffer.Buffer[8].Pointer = 0xFFFFF; 1475 1482 } 1476 1483 … … 1480 1487 } 1481 1488 1482 DECLINLINE(void) ehciR3WriteItd(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, PEHCI_ITD pItd)1489 DECLINLINE(void) ehciR3WriteItd(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, PEHCI_ITD_PAD pItd) 1483 1490 { 1484 1491 /** @todo might need to be careful about write order in async io thread */ … … 1491 1498 Assert(!(offWrite % sizeof(uint32_t))); 1492 1499 1493 ehciPutDWords(pDevIns, GCPhys + offWrite, (uint32_t *)pItd + offDWordsWrite, (sizeof( *pItd) >> 2) - offDWordsWrite);1500 ehciPutDWords(pDevIns, GCPhys + offWrite, (uint32_t *)pItd + offDWordsWrite, (sizeof(EHCI_ITD) >> 2) - offDWordsWrite); 1494 1501 } 1495 1502 … … 1759 1766 /* Read the whole ITD */ 1760 1767 EHCI_ITD_PAD PaddedItd; 1761 PEHCI_ITD pItd = &PaddedItd.itd;1768 PEHCI_ITD_PAD pItd = &PaddedItd; 1762 1769 ehciR3ReadItd(pDevIns, GCPhys, &PaddedItd); 1763 1770 … … 2029 2036 * @param pItd The ITD pointer. 2030 2037 */ 2031 static bool ehciR3ItdHasUrbBeenCanceled(PEHCICC pThisCC, PVUSBURB pUrb, PEHCI_ITD pItd)2038 static bool ehciR3ItdHasUrbBeenCanceled(PEHCICC pThisCC, PVUSBURB pUrb, PEHCI_ITD_PAD pItd) 2032 2039 { 2033 2040 RT_NOREF(pThisCC); … … 2253 2260 /* Read the whole ITD */ 2254 2261 EHCI_ITD_PAD PaddedItd; 2255 PEHCI_ITD pItd = &PaddedItd.itd;2262 PEHCI_ITD_PAD pItd = &PaddedItd; 2256 2263 ehciR3ReadItd(pDevIns, pUrb->paTds[0].TdAddr, &PaddedItd); 2257 2264 … … 2324 2331 ehciPhysWrite(pDevIns, GCPhysBuf, pb, cb1); 2325 2332 if ((pg + 1) >= EHCI_NUM_ITD_PAGES) 2326 LogRelMax(10, ("EHCI: Crossing to undefined page %d in iTD at %RGp on completion.\n", pg + 1, pUrb->paTds[0].TdAddr));2333 LogRelMax(10, ("EHCI: Crossing to nonstandard page %d in iTD at %RGp on completion.\n", pg + 1, pUrb->paTds[0].TdAddr)); 2327 2334 2328 2335 GCPhysBuf = (RTGCPHYS)pItd->Buffer.Buffer[pg + 1].Pointer << EHCI_BUFFER_PTR_SHIFT; … … 2791 2798 */ 2792 2799 static bool ehciR3SubmitITD(PPDMDEVINS pDevIns, PEHCI pThis, PEHCICC pThisCC, 2793 PEHCI_ITD pItd, RTGCPHYS ITdAddr, const unsigned iFrame)2800 PEHCI_ITD_PAD pItd, RTGCPHYS ITdAddr, const unsigned iFrame) 2794 2801 { 2795 2802 /* … … 2876 2883 ehciPhysRead(pDevIns, GCPhysBuf, &pUrb->abData[curOffset], cb1); 2877 2884 if ((pg + 1) >= EHCI_NUM_ITD_PAGES) 2878 LogRelMax(10, ("EHCI: Crossing to undefined page %d in iTD at %RGp on submit.\n", pg + 1, pUrb->paTds[0].TdAddr));2885 LogRelMax(10, ("EHCI: Crossing to nonstandard page %d in iTD at %RGp on submit.\n", pg + 1, pUrb->paTds[0].TdAddr)); 2879 2886 2880 2887 GCPhysBuf = (RTGCPHYS)pItd->Buffer.Buffer[pg + 1].Pointer << EHCI_BUFFER_PTR_SHIFT; … … 2933 2940 bool fAnyActive = false; 2934 2941 EHCI_ITD_PAD PaddedItd; 2935 PEHCI_ITD pItd = &PaddedItd.itd;2942 PEHCI_ITD_PAD pItd = &PaddedItd; 2936 2943 2937 2944 if (ehciR3IsTdInFlight(pThisCC, GCPhys)) … … 2954 2961 * the last page below 4GB (which is ROM, not writable). 2955 2962 */ 2956 LogRelMax(10, ("EHCI: Illegalpage value %d in iTD at %RGp.\n", pItd->Transaction[i].PG, (RTGCPHYS)GCPhys));2963 LogRelMax(10, ("EHCI: Nonstandard page value %d in iTD at %RGp.\n", pItd->Transaction[i].PG, (RTGCPHYS)GCPhys)); 2957 2964 } 2958 2965
Note:
See TracChangeset
for help on using the changeset viewer.