Changeset 27734 in vbox
- Timestamp:
- Mar 26, 2010 12:20:00 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r27276 r27734 490 490 /** The revision string for SCSI INQUIRY commands. */ 491 491 char szInquiryRevision[AHCI_ATAPI_INQUIRY_REVISION_LENGTH+1]; 492 493 uint32_t Alignment7;492 /** Error counter */ 493 uint32_t cErrors; 494 494 495 495 } AHCIPort; … … 4159 4159 4160 4160 /* Allocate new buffers and SG lists. */ 4161 pAhciPortTaskState->pvBufferUnaligned = RTMem Alloc(pAhciPortTaskState->cbSGBuffers);4161 pAhciPortTaskState->pvBufferUnaligned = RTMemPageAlloc(pAhciPortTaskState->cbSGBuffers); 4162 4162 if (!pAhciPortTaskState->pvBufferUnaligned) 4163 4163 return VERR_NO_MEMORY; … … 5097 5097 case ATA_SMART: 5098 5098 case ATA_NV_CACHE: 5099 case ATA_READ_LOG_EXT: 5099 5100 pAhciPortTaskState->uATARegError = ABRT_ERR; 5100 5101 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR; … … 5524 5525 pAhciPort->Led.Actual.s.fReading = 0; 5525 5526 if (RT_FAILURE(rc)) 5526 AssertMsgFailed(("%s: Failed to read data %Rrc\n", __FUNCTION__, rc));5527 break; 5527 5528 5528 5529 STAM_REL_COUNTER_ADD(&pAhciPort->StatBytesRead, cbProcess); … … 5535 5536 pAhciPort->Led.Actual.s.fWriting = 0; 5536 5537 if (RT_FAILURE(rc)) 5537 AssertMsgFailed(("%s: Failed to write data %Rrc\n", __FUNCTION__, rc));5538 break; 5538 5539 5539 5540 STAM_REL_COUNTER_ADD(&pAhciPort->StatBytesWritten, cbProcess); … … 5549 5550 STAM_PROFILE_STOP(&pAhciPort->StatProfileReadWrite, b); 5550 5551 5552 /* Log the error. */ 5553 if ( RT_FAILURE(rc) 5554 && pAhciPort->cErrors++ < MAX_LOG_REL_ERRORS) 5555 { 5556 LogRel(("AHCI#%u: %s at offset %llu (%u bytes left) returned rc=%Rrc\n", 5557 pAhciPort->iLUN, 5558 iTxDir == PDMBLOCKTXDIR_FROM_DEVICE 5559 ? "Read" 5560 : "Write", 5561 uOffset, cbTransfer, rc)); 5562 } 5563 5551 5564 /* Cleanup. */ 5552 rc= ahciScatterGatherListDestroy(pAhciPort, pAhciPortTaskState);5553 if (RT_FAILURE(rc ))5565 int rc2 = ahciScatterGatherListDestroy(pAhciPort, pAhciPortTaskState); 5566 if (RT_FAILURE(rc2)) 5554 5567 AssertMsgFailed(("Destroying task list failed rc=%Rrc\n", rc)); 5555 5568 5556 5569 if (RT_LIKELY(!pAhciPort->fPortReset)) 5557 5570 { 5558 pAhciPortTaskState->cmdHdr.u32PRDBC = pAhciPortTaskState->cbTransfer; 5559 pAhciPortTaskState->uATARegError = 0; 5560 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_SEEK; 5571 pAhciPortTaskState->cmdHdr.u32PRDBC = pAhciPortTaskState->cbTransfer - cbTransfer; 5572 if (RT_FAILURE(rc)) 5573 { 5574 pAhciPortTaskState->uATARegError = ID_ERR; 5575 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR; 5576 } 5577 else 5578 { 5579 pAhciPortTaskState->uATARegError = 0; 5580 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_SEEK; 5581 } 5561 5582 /* Write updated command header into memory of the guest. */ 5562 5583 PDMDevHlpPhysWrite(pAhciPort->CTX_SUFF(pDevIns), pAhciPortTaskState->GCPhysCmdHdrAddr, … … 5598 5619 ahciLog(("%s: After uActReadPos=%u\n", __FUNCTION__, pAhciPort->uActReadPos)); 5599 5620 cTasksToProcess--; 5600 if (!cTasksToProcess) 5621 5622 /* If we encountered an error notify the guest and continue with the next task. */ 5623 if (RT_FAILURE(rc)) 5624 { 5625 if (uQueuedTasksFinished && RT_LIKELY(!pAhciPort->fPortReset)) 5626 ahciSendSDBFis(pAhciPort, uQueuedTasksFinished, pAhciPortTaskState, true); 5627 5628 uQueuedTasksFinished = 0; 5629 } 5630 else if (!cTasksToProcess) 5601 5631 cTasksToProcess = ASMAtomicXchgU32(&pAhciPort->uActTasksActive, 0); 5602 5632 } … … 5619 5649 pAhciPort->StatIORequestsPerSecond.c = uIOsPerSec; 5620 5650 } 5621 } 5651 } /* While running */ 5622 5652 5623 5653 if (pAhci->fSignalIdle) -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r27628 r27734 1210 1210 GEN_CHECK_OFF(AHCIPort, szInquiryRevision); 1211 1211 GEN_CHECK_OFF(AHCIPort, szInquiryRevision[AHCI_ATAPI_INQUIRY_REVISION_LENGTH]); 1212 GEN_CHECK_OFF(AHCIPort, cErrors); 1212 1213 1213 1214 GEN_CHECK_SIZE(AHCI);
Note:
See TracChangeset
for help on using the changeset viewer.