Changeset 42104 in vbox
- Timestamp:
- Jul 11, 2012 11:30:58 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r42099 r42104 6886 6886 } 6887 6887 } 6888 rc = SSMR3GetU32(pSSM, &u32); 6889 if (RT_FAILURE(rc)) 6890 return rc; 6891 AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 6888 6892 } 6889 6893 … … 7486 7490 } 7487 7491 } 7492 char szName[24]; 7493 RTStrPrintf(szName, sizeof(szName), "Port%d", iLUN); 7494 7495 if ( pAhciPort->pDrvBlockAsync 7496 && !pAhciPort->fATAPI) 7497 { 7498 pAhciPort->fAsyncInterface = true; 7499 } 7500 else 7501 { 7502 pAhciPort->fAsyncInterface = false; 7503 7504 /* Create event semaphore. */ 7505 rc = RTSemEventCreate(&pAhciPort->AsyncIORequestSem); 7506 if (RT_FAILURE(rc)) 7507 { 7508 Log(("%s: Failed to create event semaphore for %s.\n", __FUNCTION__, szName)); 7509 return rc; 7510 } 7511 7512 /* Create the async IO thread. */ 7513 rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPort->pAsyncIOThread, pAhciPort, ahciAsyncIOLoop, ahciAsyncIOLoopWakeUp, 0, 7514 RTTHREADTYPE_IO, szName); 7515 if (RT_FAILURE(rc)) 7516 { 7517 AssertMsgFailed(("%s: Async IO Thread creation for %s failed rc=%d\n", __FUNCTION__, szName, rc)); 7518 return rc; 7519 } 7520 } 7521 7522 /* 7523 * Init vendor product data. 7524 */ 7525 if (RT_SUCCESS(rc)) 7526 rc = ahciR3VpdInit(pDevIns, pAhciPort, szName); 7527 7528 /* Inform the guest about the added device in case of hotplugging. */ 7529 if ( RT_SUCCESS(rc) 7530 && !(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG)) 7531 { 7532 /* 7533 * Initialize registers 7534 */ 7535 ASMAtomicOrU32(&pAhciPort->regCMD, AHCI_PORT_CMD_CPS); 7536 ASMAtomicOrU32(&pAhciPort->regIS, AHCI_PORT_IS_CPDS | AHCI_PORT_IS_PRCS | AHCI_PORT_IS_PCS); 7537 ASMAtomicOrU32(&pAhciPort->regSERR, AHCI_PORT_SERR_X | AHCI_PORT_SERR_N); 7538 7539 if (pAhciPort->fATAPI) 7540 pAhciPort->regSIG = AHCI_PORT_SIG_ATAPI; 7541 else 7542 pAhciPort->regSIG = AHCI_PORT_SIG_DISK; 7543 pAhciPort->regSSTS = (0x01 << 8) | /* Interface is active. */ 7544 (0x02 << 4) | /* Generation 2 (3.0GBps) speed. */ 7545 (0x03 << 0); /* Device detected and communication established. */ 7546 7547 if ( (pAhciPort->regIE & AHCI_PORT_IE_CPDE) 7548 || (pAhciPort->regIE & AHCI_PORT_IE_PCE) 7549 || (pAhciPort->regIE & AHCI_PORT_IE_PRCE)) 7550 ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED); 7551 } 7552 7488 7553 } 7489 7554
Note:
See TracChangeset
for help on using the changeset viewer.