Changeset 4718 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 12, 2007 8:56:28 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r4706 r4718 892 892 uint32_t cbLimit, cbTransfer; 893 893 894 cbLimit = s->uATARegLCyl | (s->uATARegHCyl << 8); 894 if (s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE) 895 cbLimit = 0xfffe; 896 else 897 cbLimit = s->uATARegLCyl | (s->uATARegHCyl << 8); 895 898 Log2(("%s: byte count limit=%d\n", __FUNCTION__, cbLimit)); 896 899 if (cbLimit == 0xffff) 897 900 cbLimit--; 898 cbTransfer = s->cbTotalTransfer;901 cbTransfer = RT_MIN(s->cbTotalTransfer, s->iIOBufferEnd - s->iIOBufferCur); 899 902 if (cbTransfer > cbLimit) 900 903 { … … 1618 1621 uint32_t cbTransfer, cSectors; 1619 1622 1620 s->iSourceSink = ATAFN_SS_NULL;1621 1623 Assert(s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE); 1622 1624 cbTransfer = RT_MIN(s->cbTotalTransfer, s->cbIOBuffer); … … 1676 1678 * transfer size. But the I/O buffer size limits what can actually be 1677 1679 * done in one transfer, so set the actual value of the buffer end. */ 1678 s->iIOBufferEnd = cbTransfer; 1680 s->cbElementaryTransfer = cbTransfer; 1681 if (cbTransfer >= s->cbTotalTransfer) 1682 s->iSourceSink = ATAFN_SS_NULL; 1679 1683 atapiCmdOK(s); 1680 1684 s->iATAPILBA += cSectors; … … 1836 1840 * transfer size. But the I/O buffer size limits what can actually be 1837 1841 * done in one transfer, so set the actual value of the buffer end. */ 1838 s-> iIOBufferEnd= cbTransfer;1842 s->cbElementaryTransfer = cbTransfer; 1839 1843 if (s->aATAPICmd[0] == SCSI_INQUIRY) 1840 1844 { … … 3695 3699 if (s->cbTotalTransfer && s->iIOBufferCur > s->iIOBufferEnd) 3696 3700 { 3697 LogRel(("PIIX3 ATA: LUN#%d: %s data in the middle of a PIO transfer - VERY SLOW\n", s->iLUN, s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE ? " storing" : "loading"));3701 LogRel(("PIIX3 ATA: LUN#%d: %s data in the middle of a PIO transfer - VERY SLOW\n", s->iLUN, s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE ? "loading" : "storing")); 3698 3702 /* Any guest OS that triggers this case has a pathetic ATA driver. 3699 3703 * In a real system it would block the CPU via IORDY, here we do it … … 3749 3753 } 3750 3754 3751 if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE || s->iSourceSink != ATAFN_SS_NULL) 3755 if ( s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE 3756 || ( s->iSourceSink != ATAFN_SS_NULL 3757 && s->iIOBufferCur >= s->iIOBufferEnd)) 3752 3758 { 3753 3759 /* Need to continue the transfer in the async I/O thread. This is … … 3762 3768 else 3763 3769 { 3764 /* E verything finished (though maybe a couple of chunks need to be3765 * transferred, but all without source/sink callback). */3770 /* Either everything finished (though some data might still be pending) 3771 * or some data is pending before the next read is due. */ 3766 3772 3767 3773 /* Continue a previously started transfer. */
Note:
See TracChangeset
for help on using the changeset viewer.