Changeset 78908 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Jun 1, 2019 12:23:46 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131028
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r77183 r78908 405 405 /** Pointer to the attached driver's extended interface. */ 406 406 R3PTRTYPE(PPDMIMEDIAEX) pDrvMediaEx; 407 /** Port description. */ 408 R3PTRTYPE(char *) pszDesc; 407 409 /** The base interface. */ 408 410 PDMIBASE IBase; … … 416 418 PDMLED Led; 417 419 420 #if HC_ARCH_BITS == 64 418 421 uint32_t u32Alignment3; 422 #endif 419 423 420 424 /** Async IO Thread. */ … … 2459 2463 * handling 2nd DWORD failures on split accesses correctly. */ 2460 2464 int rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/, 2461 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_ ONLY_DWORD_QWORD,2465 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING, 2462 2466 ahciMMIOWrite, ahciMMIORead, "AHCI"); 2463 2467 if (RT_FAILURE(rc)) … … 5686 5690 * required as well as optional. 5687 5691 */ 5688 rc = PDMDevHlpDriverAttach(pDevIns, pAhciPort->iLUN, &pAhciPort->IBase, &pAhciPort->pDrvBase, NULL);5692 rc = PDMDevHlpDriverAttach(pDevIns, pAhciPort->iLUN, &pAhciPort->IBase, &pAhciPort->pDrvBase, pAhciPort->pszDesc); 5689 5693 if (RT_SUCCESS(rc)) 5690 5694 rc = ahciR3ConfigureLUN(pDevIns, pAhciPort); … … 5699 5703 else 5700 5704 { 5701 char szName[24];5702 RTStrPrintf(szName, sizeof(szName), "Port%d", iLUN);5703 5704 5705 rc = SUPSemEventCreate(pThis->pSupDrvSession, &pAhciPort->hEvtProcess); 5705 5706 if (RT_FAILURE(rc)) … … 5709 5710 /* Create the async IO thread. */ 5710 5711 rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPort->pAsyncIOThread, pAhciPort, ahciAsyncIOLoop, ahciAsyncIOLoopWakeUp, 0, 5711 RTTHREADTYPE_IO, szName);5712 RTTHREADTYPE_IO, pAhciPort->pszDesc); 5712 5713 if (RT_FAILURE(rc)) 5713 5714 return rc; … … 5717 5718 */ 5718 5719 if (RT_SUCCESS(rc)) 5719 rc = ahciR3VpdInit(pDevIns, pAhciPort, szName);5720 rc = ahciR3VpdInit(pDevIns, pAhciPort, pAhciPort->pszDesc); 5720 5721 5721 5722 /* Inform the guest about the added device in case of hotplugging. */ … … 5852 5853 pAhciPort->hEvtProcess = NIL_SUPSEMEVENT; 5853 5854 } 5855 5856 if (pAhciPort->pszDesc) 5857 RTStrFree(pAhciPort->pszDesc); 5854 5858 } 5855 5859 … … 6113 6117 for (i = 0; i < pThis->cPortsImpl; i++) 6114 6118 { 6115 char *pszName; 6116 if (RTStrAPrintf(&pszName, "Port%u", i) <= 0) 6119 PAHCIPort pAhciPort = &pThis->ahciPort[i]; 6120 6121 if (RTStrAPrintf(&pAhciPort->pszDesc, "Port%u", i) <= 0) 6117 6122 AssertLogRelFailedReturn(VERR_NO_MEMORY); 6118 6123 6119 PAHCIPort pAhciPort = &pThis->ahciPort[i];6120 6124 /* 6121 6125 * Init interfaces. … … 6134 6138 6135 6139 /* Query per port configuration options if available. */ 6136 PCFGMNODE pCfgPort = CFGMR3GetChild(pDevIns->pCfg, p szName);6140 PCFGMNODE pCfgPort = CFGMR3GetChild(pDevIns->pCfg, pAhciPort->pszDesc); 6137 6141 if (pCfgPort) 6138 6142 { … … 6146 6150 * Attach the block driver 6147 6151 */ 6148 rc = PDMDevHlpDriverAttach(pDevIns, pAhciPort->iLUN, &pAhciPort->IBase, &pAhciPort->pDrvBase, p szName);6152 rc = PDMDevHlpDriverAttach(pDevIns, pAhciPort->iLUN, &pAhciPort->IBase, &pAhciPort->pDrvBase, pAhciPort->pszDesc); 6149 6153 if (RT_SUCCESS(rc)) 6150 6154 { … … 6152 6156 if (RT_FAILURE(rc)) 6153 6157 { 6154 Log(("%s: Failed to configure the %s.\n", __FUNCTION__, p szName));6158 Log(("%s: Failed to configure the %s.\n", __FUNCTION__, pAhciPort->pszDesc)); 6155 6159 return rc; 6156 6160 } … … 6163 6167 * Init vendor product data. 6164 6168 */ 6165 rc = ahciR3VpdInit(pDevIns, pAhciPort, p szName);6169 rc = ahciR3VpdInit(pDevIns, pAhciPort, pAhciPort->pszDesc); 6166 6170 if (RT_FAILURE(rc)) 6167 6171 return rc; … … 6173 6177 6174 6178 rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPort->pAsyncIOThread, pAhciPort, ahciAsyncIOLoop, 6175 ahciAsyncIOLoopWakeUp, 0, RTTHREADTYPE_IO, p szName);6179 ahciAsyncIOLoopWakeUp, 0, RTTHREADTYPE_IO, pAhciPort->pszDesc); 6176 6180 if (RT_FAILURE(rc)) 6177 6181 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 6178 N_("AHCI: Failed to create worker thread %s"), p szName);6182 N_("AHCI: Failed to create worker thread %s"), pAhciPort->pszDesc); 6179 6183 } 6180 6184 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) … … 6182 6186 pAhciPort->pDrvBase = NULL; 6183 6187 rc = VINF_SUCCESS; 6184 LogRel(("AHCI: %s: No driver attached\n", p szName));6188 LogRel(("AHCI: %s: No driver attached\n", pAhciPort->pszDesc)); 6185 6189 } 6186 6190 else 6187 6191 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 6188 N_("AHCI: Failed to attach drive to %s"), p szName);6192 N_("AHCI: Failed to attach drive to %s"), pAhciPort->pszDesc); 6189 6193 } 6190 6194
Note:
See TracChangeset
for help on using the changeset viewer.