Changeset 81804 in vbox
- Timestamp:
- Nov 12, 2019 2:43:17 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134595
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r81803 r81804 127 127 /** Number of outstanding tasks on the port. */ 128 128 volatile uint32_t cOutstandingRequests; 129 130 #if HC_ARCH_BITS == 64 131 uint32_t u32Alignment1; 132 #endif 129 /** The device name. */ 130 char szName[12]; 133 131 } BUSLOGICDEVICE, *PBUSLOGICDEVICE; 134 132 … … 437 435 /** Whether the extended LUN CCB format is enabled for 32 possible logical units. */ 438 436 bool fExtendedLunCCBFormat; 439 440 /** Queue to send tasks to R3. - HC ptr */ 441 R3PTRTYPE(PPDMQUEUE) pNotifierQueueR3; 442 /** Queue to send tasks to R3. - HC ptr */ 443 R0PTRTYPE(PPDMQUEUE) pNotifierQueueR0; 444 /** Queue to send tasks to R3. - RC ptr */ 445 RCPTRTYPE(PPDMQUEUE) pNotifierQueueRC; 446 447 uint32_t Alignment2; 437 bool afAlignment2[2]; 448 438 449 439 /** Critical section protecting access to the interrupt status register. */ … … 2479 2469 if (!ASMAtomicXchgBool(&pBusLogic->fNotificationSent, true)) 2480 2470 { 2481 /* Send new notification to the queue. */ 2482 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pBusLogic->CTX_SUFF(pNotifierQueue)); 2483 AssertMsg(pItem, ("Allocating item for queue failed\n")); 2484 PDMQueueInsert(pBusLogic->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem); 2471 /* Wake up the worker thread. */ 2472 int rc2 = PDMDevHlpSUPSemEventSignal(pDevIns, pBusLogic->hEvtProcess); 2473 AssertRC(rc2); 2485 2474 } 2486 2475 } … … 2840 2829 { 2841 2830 ASMAtomicXchgBool(&pThis->fBiosReqPending, true); 2842 /* Send a notifier to the PDM queue that there are pending requests. */ 2843 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotifierQueue)); 2844 AssertMsg(pItem, ("Allocating item for queue failed\n")); 2845 PDMQueueInsert(pThis->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem); 2831 /* Wake up the worker thread now that there are pending requests. */ 2832 int rc2 = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->hEvtProcess); 2833 AssertRC(rc2); 2846 2834 rc = VINF_SUCCESS; 2847 2835 } … … 2874 2862 { 2875 2863 ASMAtomicXchgBool(&pThis->fBiosReqPending, true); 2876 /* Send a notifier to the PDM queue that there are pending requests. */ 2877 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotifierQueue)); 2878 AssertMsg(pItem, ("Allocating item for queue failed\n")); 2879 PDMQueueInsert(pThis->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem); 2864 /* Wake up the worker thread now taht there are pending requests. */ 2865 int rc2 = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->hEvtProcess); 2866 AssertRC(rc2); 2880 2867 } 2881 2868 else if (RT_FAILURE(rc)) … … 4160 4147 4161 4148 pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 4162 pThis->pNotifierQueueRC = PDMQueueRCPtr(pThis->pNotifierQueueR3);4163 4149 4164 4150 for (uint32_t i = 0; i < BUSLOGIC_MAX_DEVICES; i++) … … 4336 4322 return PDMDEV_SET_ERROR(pDevIns, rc, N_("BusLogic cannot register ISA I/O handlers")); 4337 4323 4338 /* Initialize task queue. */ 4339 rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 5, 0, 4340 buslogicR3NotifyQueueConsumer, true, "BusLogicTask", &pThis->pNotifierQueueR3); 4341 if (RT_FAILURE(rc)) 4342 return rc; 4343 pThis->pNotifierQueueR0 = PDMQueueR0Ptr(pThis->pNotifierQueueR3); 4344 pThis->pNotifierQueueRC = PDMQueueRCPtr(pThis->pNotifierQueueR3); 4345 4324 4325 /* Init the interrupt critsect. */ 4346 4326 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSectIntr, RT_SRC_POS, "BusLogic-Intr#%u", pDevIns->iInstance); 4347 4327 if (RT_FAILURE(rc)) … … 4368 4348 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aDeviceStates); i++) 4369 4349 { 4370 char szName[24];4371 4350 PBUSLOGICDEVICE pDevice = &pThis->aDeviceStates[i]; 4372 4373 char *pszName;4374 if (RTStrAPrintf(&pszName, "Device%u", i) < 0)4375 AssertLogRelFailedReturn(VERR_NO_MEMORY);4376 4351 4377 4352 /* Initialize static parts of the device. */ … … 4391 4366 pDevice->IMediaExPort.pfnMediumEjected = buslogicR3MediumEjected; 4392 4367 pDevice->ILed.pfnQueryStatusLed = buslogicR3DeviceQueryStatusLed; 4368 RTStrPrintf(pDevice->szName, sizeof(pDevice->szName), "Device%u", i); 4393 4369 4394 4370 /* Attach SCSI driver. */ 4395 rc = PDMDevHlpDriverAttach(pDevIns, pDevice->iLUN, &pDevice->IBase, &pDevice->pDrvBase, p szName);4371 rc = PDMDevHlpDriverAttach(pDevIns, pDevice->iLUN, &pDevice->IBase, &pDevice->pDrvBase, pDevice->szName); 4396 4372 if (RT_SUCCESS(rc)) 4397 4373 { … … 4423 4399 pDevice->pDrvMediaEx = NULL; 4424 4400 rc = VINF_SUCCESS; 4425 Log(("BusLogic: no driver attached to device %s\n", szName));4401 Log(("BusLogic: no driver attached to device %s\n", pDevice->szName)); 4426 4402 } 4427 4403 else 4428 4404 { 4429 AssertLogRelMsgFailed(("BusLogic: Failed to attach %s\n", szName));4405 AssertLogRelMsgFailed(("BusLogic: Failed to attach %s\n", pDevice->szName)); 4430 4406 return rc; 4431 4407 }
Note:
See TracChangeset
for help on using the changeset viewer.