Changeset 42200 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 18, 2012 8:11:13 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r42198 r42200 6730 6730 uint32_t u32IOBuffer; 6731 6731 6732 6732 /* Test for correct version. */ 6733 6733 rc = SSMR3GetU32(pSSM, &u32Version); 6734 6734 AssertRCReturn(rc, rc); … … 7578 7578 } 7579 7579 } 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7580 char szName[24]; 7581 RTStrPrintf(szName, sizeof(szName), "Port%d", iLUN); 7582 7583 if ( pAhciPort->pDrvBlockAsync 7584 && !pAhciPort->fATAPI) 7585 { 7586 pAhciPort->fAsyncInterface = true; 7587 } 7588 else 7589 { 7590 pAhciPort->fAsyncInterface = false; 7591 7592 /* Create event semaphore. */ 7593 rc = RTSemEventCreate(&pAhciPort->AsyncIORequestSem); 7594 if (RT_FAILURE(rc)) 7595 { 7596 Log(("%s: Failed to create event semaphore for %s.\n", __FUNCTION__, szName)); 7597 return rc; 7598 } 7599 7600 /* Create the async IO thread. */ 7601 rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPort->pAsyncIOThread, pAhciPort, ahciAsyncIOLoop, ahciAsyncIOLoopWakeUp, 0, 7602 RTTHREADTYPE_IO, szName); 7603 if (RT_FAILURE(rc)) 7604 { 7605 AssertMsgFailed(("%s: Async IO Thread creation for %s failed rc=%d\n", __FUNCTION__, szName, rc)); 7606 return rc; 7607 } 7608 } 7609 7610 /* 7611 * Init vendor product data. 7612 */ 7613 if (RT_SUCCESS(rc)) 7614 rc = ahciR3VpdInit(pDevIns, pAhciPort, szName); 7615 7616 /* Inform the guest about the added device in case of hotplugging. */ 7617 if ( RT_SUCCESS(rc) 7618 && !(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG)) 7619 { 7620 /* 7621 * Initialize registers 7622 */ 7623 ASMAtomicOrU32(&pAhciPort->regCMD, AHCI_PORT_CMD_CPS); 7624 ASMAtomicOrU32(&pAhciPort->regIS, AHCI_PORT_IS_CPDS | AHCI_PORT_IS_PRCS | AHCI_PORT_IS_PCS); 7625 ASMAtomicOrU32(&pAhciPort->regSERR, AHCI_PORT_SERR_X | AHCI_PORT_SERR_N); 7626 7627 if (pAhciPort->fATAPI) 7628 pAhciPort->regSIG = AHCI_PORT_SIG_ATAPI; 7629 else 7630 pAhciPort->regSIG = AHCI_PORT_SIG_DISK; 7631 pAhciPort->regSSTS = (0x01 << 8) | /* Interface is active. */ 7632 (0x02 << 4) | /* Generation 2 (3.0GBps) speed. */ 7633 (0x03 << 0); /* Device detected and communication established. */ 7634 7635 if ( (pAhciPort->regIE & AHCI_PORT_IE_CPDE) 7636 || (pAhciPort->regIE & AHCI_PORT_IE_PCE) 7637 || (pAhciPort->regIE & AHCI_PORT_IE_PRCE)) 7638 ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED); 7639 } 7640 7640 7641 7641 }
Note:
See TracChangeset
for help on using the changeset viewer.