Changeset 81745 in vbox for trunk/src/VBox
- Timestamp:
- Nov 7, 2019 8:55:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r81591 r81745 199 199 /** Flag whether the R0 part of the device is enabled. */ 200 200 bool fR0Enabled; 201 bool afPaddingMinus1[2+4]; 201 202 202 203 /** The state the controller is currently in. */ … … 214 215 /** Flag whether the diagnostic address and RW registers are enabled. */ 215 216 bool fDiagRegsEnabled; 216 217 /** Queue to send tasks to R3. - R3 ptr */218 R3PTRTYPE(PPDMQUEUE) pNotificationQueueR3;219 /** Queue to send tasks to R3. - R0 ptr */220 R0PTRTYPE(PPDMQUEUE) pNotificationQueueR0;221 /** Queue to send tasks to R3. - RC ptr */222 RCPTRTYPE(PPDMQUEUE) pNotificationQueueRC;223 217 224 218 /** Number of device states allocated. */ … … 1317 1311 if (ASMAtomicReadBool(&pThis->fWrkThreadSleeping)) 1318 1312 { 1319 #ifdef IN_RC1320 PPDMQUEUEITEMCORE pNotificationItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));1321 AssertPtr(pNotificationItem);1322 PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), pNotificationItem);1323 #else1324 1313 LogFlowFunc(("Signal event semaphore\n")); 1325 1314 rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess); 1326 1315 AssertRC(rc); 1327 #endif1328 1316 } 1329 1317 } … … 3804 3792 3805 3793 /** 3806 * @callback_method_impl{FNPDMQUEUEDEV, Transmit queue consumer.}3807 */3808 static DECLCALLBACK(bool) lsilogicR3NotifyQueueConsumer(PPDMDEVINS pDevIns, PPDMQUEUEITEMCORE pItem)3809 {3810 RT_NOREF(pItem);3811 PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI);3812 int rc = VINF_SUCCESS;3813 3814 LogFlowFunc(("pDevIns=%#p pItem=%#p\n", pDevIns, pItem));3815 3816 rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);3817 AssertRC(rc);3818 3819 return true;3820 }3821 3822 /**3823 3794 * Sets the emulated controller type from a given string. 3824 3795 * … … 3960 3931 { 3961 3932 ASMAtomicXchgBool(&pThis->fBiosReqPending, true); 3962 /* Send a notifier to the PDM queuethat there are pending requests. */3963 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));3964 AssertMsg(pItem, ("Allocating item for queue failed\n"));3965 PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);3933 /* Notify the worker thread that there are pending requests. */ 3934 LogFlowFunc(("Signal event semaphore\n")); 3935 rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess); 3936 AssertRC(rc); 3966 3937 } 3967 3938 else if (RT_FAILURE(rc)) … … 3989 3960 { 3990 3961 ASMAtomicXchgBool(&pThis->fBiosReqPending, true); 3991 /* Send a notifier to the PDM queuethat there are pending requests. */3992 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));3993 AssertMsg(pItem, ("Allocating item for queue failed\n"));3994 PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);3962 /* Notify the worker thread that there are pending requests. */ 3963 LogFlowFunc(("Signal event semaphore\n")); 3964 rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess); 3965 AssertRC(rc); 3995 3966 } 3996 3967 else if (RT_FAILURE(rc)) … … 4430 4401 if (pThis->fNotificationSent) 4431 4402 { 4432 /* Send a notifier to the PDM queuethat there are pending requests. */4433 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pNotificationQueue));4434 AssertMsg(pItem, ("Allocating item for queue failed\n"));4435 PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), (PPDMQUEUEITEMCORE)pItem);4403 /* Notify the worker thread that there are pending requests. */ 4404 LogFlowFunc(("Signal event semaphore\n")); 4405 int rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess); 4406 AssertRC(rc); 4436 4407 } 4437 4408 } … … 4449 4420 RT_NOREF(uPass); 4450 4421 PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI); 4451 4452 SSMR3PutU32(pSSM, pThis->enmCtrlType); 4453 SSMR3PutU32(pSSM, pThis->cDeviceStates); 4454 SSMR3PutU32(pSSM, pThis->cPorts); 4422 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 4423 4424 pHlp->pfnSSMPutU32(pSSM, pThis->enmCtrlType); 4425 pHlp->pfnSSMPutU32(pSSM, pThis->cDeviceStates); 4426 pHlp->pfnSSMPutU32(pSSM, pThis->cPorts); 4455 4427 4456 4428 /* Save the device config. */ 4457 4429 for (unsigned i = 0; i < pThis->cDeviceStates; i++) 4458 SSMR3PutBool(pSSM, pThis->paDeviceStates[i].pDrvBase != NULL);4430 pHlp->pfnSSMPutBool(pSSM, pThis->paDeviceStates[i].pDrvBase != NULL); 4459 4431 4460 4432 return VINF_SSM_DONT_CALL_AGAIN; … … 4467 4439 { 4468 4440 PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI); 4441 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 4469 4442 4470 4443 /* Every device first. */ … … 4476 4449 AssertMsg(!pDevice->cOutstandingRequests, 4477 4450 ("There are still outstanding requests on this device\n")); 4478 SSMR3PutU32(pSSM, pDevice->cOutstandingRequests);4451 pHlp->pfnSSMPutU32(pSSM, pDevice->cOutstandingRequests); 4479 4452 4480 4453 /* Query all suspended requests and store them in the request queue. */ … … 4520 4493 4521 4494 /* Now the main device state. */ 4522 SSMR3PutU32(pSSM, pThis->enmState);4523 SSMR3PutU32(pSSM, pThis->enmWhoInit);4524 SSMR3PutU32(pSSM, pThis->enmDoorbellState);4525 SSMR3PutBool(pSSM, pThis->fDiagnosticEnabled);4526 SSMR3PutBool(pSSM, pThis->fNotificationSent);4527 SSMR3PutBool(pSSM, pThis->fEventNotificationEnabled);4528 SSMR3PutU32(pSSM, pThis->uInterruptMask);4529 SSMR3PutU32(pSSM, pThis->uInterruptStatus);4495 pHlp->pfnSSMPutU32(pSSM, pThis->enmState); 4496 pHlp->pfnSSMPutU32(pSSM, pThis->enmWhoInit); 4497 pHlp->pfnSSMPutU32(pSSM, pThis->enmDoorbellState); 4498 pHlp->pfnSSMPutBool(pSSM, pThis->fDiagnosticEnabled); 4499 pHlp->pfnSSMPutBool(pSSM, pThis->fNotificationSent); 4500 pHlp->pfnSSMPutBool(pSSM, pThis->fEventNotificationEnabled); 4501 pHlp->pfnSSMPutU32(pSSM, pThis->uInterruptMask); 4502 pHlp->pfnSSMPutU32(pSSM, pThis->uInterruptStatus); 4530 4503 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aMessage); i++) 4531 SSMR3PutU32(pSSM, pThis->aMessage[i]);4532 SSMR3PutU32(pSSM, pThis->iMessage);4533 SSMR3PutU32(pSSM, pThis->cMessage);4534 SSMR3PutMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));4535 SSMR3PutU32(pSSM, pThis->uNextReplyEntryRead);4536 SSMR3PutU32(pSSM, pThis->cReplySize);4537 SSMR3PutU16(pSSM, pThis->u16IOCFaultCode);4538 SSMR3PutU32(pSSM, pThis->u32HostMFAHighAddr);4539 SSMR3PutU32(pSSM, pThis->u32SenseBufferHighAddr);4540 SSMR3PutU8(pSSM, pThis->cMaxDevices);4541 SSMR3PutU8(pSSM, pThis->cMaxBuses);4542 SSMR3PutU16(pSSM, pThis->cbReplyFrame);4543 SSMR3PutU32(pSSM, pThis->iDiagnosticAccess);4544 SSMR3PutU32(pSSM, pThis->cReplyQueueEntries);4545 SSMR3PutU32(pSSM, pThis->cRequestQueueEntries);4546 SSMR3PutU32(pSSM, pThis->uReplyFreeQueueNextEntryFreeWrite);4547 SSMR3PutU32(pSSM, pThis->uReplyFreeQueueNextAddressRead);4548 SSMR3PutU32(pSSM, pThis->uReplyPostQueueNextEntryFreeWrite);4549 SSMR3PutU32(pSSM, pThis->uReplyPostQueueNextAddressRead);4550 SSMR3PutU32(pSSM, pThis->uRequestQueueNextEntryFreeWrite);4551 SSMR3PutU32(pSSM, pThis->uRequestQueueNextAddressRead);4504 pHlp->pfnSSMPutU32(pSSM, pThis->aMessage[i]); 4505 pHlp->pfnSSMPutU32(pSSM, pThis->iMessage); 4506 pHlp->pfnSSMPutU32(pSSM, pThis->cMessage); 4507 pHlp->pfnSSMPutMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer)); 4508 pHlp->pfnSSMPutU32(pSSM, pThis->uNextReplyEntryRead); 4509 pHlp->pfnSSMPutU32(pSSM, pThis->cReplySize); 4510 pHlp->pfnSSMPutU16(pSSM, pThis->u16IOCFaultCode); 4511 pHlp->pfnSSMPutU32(pSSM, pThis->u32HostMFAHighAddr); 4512 pHlp->pfnSSMPutU32(pSSM, pThis->u32SenseBufferHighAddr); 4513 pHlp->pfnSSMPutU8(pSSM, pThis->cMaxDevices); 4514 pHlp->pfnSSMPutU8(pSSM, pThis->cMaxBuses); 4515 pHlp->pfnSSMPutU16(pSSM, pThis->cbReplyFrame); 4516 pHlp->pfnSSMPutU32(pSSM, pThis->iDiagnosticAccess); 4517 pHlp->pfnSSMPutU32(pSSM, pThis->cReplyQueueEntries); 4518 pHlp->pfnSSMPutU32(pSSM, pThis->cRequestQueueEntries); 4519 pHlp->pfnSSMPutU32(pSSM, pThis->uReplyFreeQueueNextEntryFreeWrite); 4520 pHlp->pfnSSMPutU32(pSSM, pThis->uReplyFreeQueueNextAddressRead); 4521 pHlp->pfnSSMPutU32(pSSM, pThis->uReplyPostQueueNextEntryFreeWrite); 4522 pHlp->pfnSSMPutU32(pSSM, pThis->uReplyPostQueueNextAddressRead); 4523 pHlp->pfnSSMPutU32(pSSM, pThis->uRequestQueueNextEntryFreeWrite); 4524 pHlp->pfnSSMPutU32(pSSM, pThis->uRequestQueueNextAddressRead); 4552 4525 4553 4526 for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++) 4554 SSMR3PutU32(pSSM, pThis->pReplyFreeQueueBaseR3[i]);4527 pHlp->pfnSSMPutU32(pSSM, pThis->pReplyFreeQueueBaseR3[i]); 4555 4528 for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++) 4556 SSMR3PutU32(pSSM, pThis->pReplyPostQueueBaseR3[i]);4529 pHlp->pfnSSMPutU32(pSSM, pThis->pReplyPostQueueBaseR3[i]); 4557 4530 for (unsigned i = 0; i < pThis->cRequestQueueEntries; i++) 4558 SSMR3PutU32(pSSM, pThis->pRequestQueueBaseR3[i]);4559 4560 SSMR3PutU16(pSSM, pThis->u16NextHandle);4531 pHlp->pfnSSMPutU32(pSSM, pThis->pRequestQueueBaseR3[i]); 4532 4533 pHlp->pfnSSMPutU16(pSSM, pThis->u16NextHandle); 4561 4534 4562 4535 /* Save diagnostic memory register and data regions. */ 4563 SSMR3PutU32(pSSM, pThis->u32DiagMemAddr);4564 SSMR3PutU32(pSSM, lsilogicR3MemRegionsCount(pThis));4536 pHlp->pfnSSMPutU32(pSSM, pThis->u32DiagMemAddr); 4537 pHlp->pfnSSMPutU32(pSSM, lsilogicR3MemRegionsCount(pThis)); 4565 4538 4566 4539 PLSILOGICMEMREGN pIt; 4567 4540 RTListForEach(&pThis->ListMemRegns, pIt, LSILOGICMEMREGN, NodeList) 4568 4541 { 4569 SSMR3PutU32(pSSM, pIt->u32AddrStart);4570 SSMR3PutU32(pSSM, pIt->u32AddrEnd);4571 SSMR3PutMem(pSSM, &pIt->au32Data[0], (pIt->u32AddrEnd - pIt->u32AddrStart + 1) * sizeof(uint32_t));4542 pHlp->pfnSSMPutU32(pSSM, pIt->u32AddrStart); 4543 pHlp->pfnSSMPutU32(pSSM, pIt->u32AddrEnd); 4544 pHlp->pfnSSMPutMem(pSSM, &pIt->au32Data[0], (pIt->u32AddrEnd - pIt->u32AddrStart + 1) * sizeof(uint32_t)); 4572 4545 } 4573 4546 4574 4547 PMptConfigurationPagesSupported pPages = pThis->pConfigurationPages; 4575 4548 4576 SSMR3PutMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));4577 SSMR3PutMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));4578 SSMR3PutMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));4579 SSMR3PutMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));4580 SSMR3PutMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));4581 SSMR3PutMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));4582 SSMR3PutMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));4583 SSMR3PutMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));4584 SSMR3PutMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));4585 SSMR3PutMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));4586 SSMR3PutMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));4587 SSMR3PutMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));4588 SSMR3PutMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));4589 SSMR3PutMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));4590 SSMR3PutMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));4591 SSMR3PutMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));4592 SSMR3PutMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));4593 SSMR3PutMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));4594 SSMR3PutMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));4595 SSMR3PutMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));4596 SSMR3PutMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));4597 SSMR3PutMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));4598 SSMR3PutMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));4599 SSMR3PutMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));4549 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0)); 4550 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1)); 4551 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2)); 4552 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3)); 4553 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4)); 4554 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5)); 4555 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6)); 4556 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8)); 4557 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9)); 4558 pHlp->pfnSSMPutMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10)); 4559 pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0)); 4560 pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1)); 4561 pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2)); 4562 pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3)); 4563 pHlp->pfnSSMPutMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4)); 4564 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0)); 4565 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1)); 4566 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2)); 4567 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3)); 4568 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4)); 4569 pHlp->pfnSSMPutMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6)); 4570 pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1)); 4571 pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2)); 4572 pHlp->pfnSSMPutMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4)); 4600 4573 4601 4574 /* Device dependent pages */ … … 4604 4577 PMptConfigurationPagesSpi pSpiPages = &pPages->u.SpiPages; 4605 4578 4606 SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));4607 SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));4608 SSMR3PutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));4579 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0)); 4580 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1)); 4581 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2)); 4609 4582 4610 4583 for (unsigned i = 0; i < RT_ELEMENTS(pSpiPages->aBuses[0].aDevicePages); i++) 4611 4584 { 4612 SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));4613 SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));4614 SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));4615 SSMR3PutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));4585 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0)); 4586 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1)); 4587 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2)); 4588 pHlp->pfnSSMPutMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3)); 4616 4589 } 4617 4590 } … … 4620 4593 PMptConfigurationPagesSas pSasPages = &pPages->u.SasPages; 4621 4594 4622 SSMR3PutU32(pSSM, pSasPages->cbManufacturingPage7);4623 SSMR3PutU32(pSSM, pSasPages->cbSASIOUnitPage0);4624 SSMR3PutU32(pSSM, pSasPages->cbSASIOUnitPage1);4625 4626 SSMR3PutMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7);4627 SSMR3PutMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0);4628 SSMR3PutMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1);4629 4630 SSMR3PutMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2));4631 SSMR3PutMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3));4632 4633 SSMR3PutU32(pSSM, pSasPages->cPHYs);4595 pHlp->pfnSSMPutU32(pSSM, pSasPages->cbManufacturingPage7); 4596 pHlp->pfnSSMPutU32(pSSM, pSasPages->cbSASIOUnitPage0); 4597 pHlp->pfnSSMPutU32(pSSM, pSasPages->cbSASIOUnitPage1); 4598 4599 pHlp->pfnSSMPutMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7); 4600 pHlp->pfnSSMPutMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0); 4601 pHlp->pfnSSMPutMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1); 4602 4603 pHlp->pfnSSMPutMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2)); 4604 pHlp->pfnSSMPutMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3)); 4605 4606 pHlp->pfnSSMPutU32(pSSM, pSasPages->cPHYs); 4634 4607 for (unsigned i = 0; i < pSasPages->cPHYs; i++) 4635 4608 { 4636 SSMR3PutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));4637 SSMR3PutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));4609 pHlp->pfnSSMPutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0)); 4610 pHlp->pfnSSMPutMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1)); 4638 4611 } 4639 4612 4640 4613 /* The number of devices first. */ 4641 SSMR3PutU32(pSSM, pSasPages->cDevices); 4642 4643 PMptSASDevice pCurr = pSasPages->pSASDeviceHead; 4644 4645 while (pCurr) 4646 { 4647 SSMR3PutMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0)); 4648 SSMR3PutMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1)); 4649 SSMR3PutMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2)); 4650 4651 pCurr = pCurr->pNext; 4614 pHlp->pfnSSMPutU32(pSSM, pSasPages->cDevices); 4615 4616 for (PMptSASDevice pCurr = pSasPages->pSASDeviceHead; pCurr; pCurr = pCurr->pNext) 4617 { 4618 pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0)); 4619 pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1)); 4620 pHlp->pfnSSMPutMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2)); 4652 4621 } 4653 4622 } … … 4656 4625 4657 4626 vboxscsiR3SaveExec(&pThis->VBoxSCSI, pSSM); 4658 return SSMR3PutU32(pSSM, UINT32_MAX);4627 return pHlp->pfnSSMPutU32(pSSM, UINT32_MAX); 4659 4628 } 4660 4629 … … 4677 4646 { 4678 4647 PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI); 4648 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 4679 4649 int rc; 4680 4650 … … 4692 4662 uint32_t cDeviceStates, cPorts; 4693 4663 4694 rc = SSMR3GetU32(pSSM, (uint32_t *)&enmCtrlType); 4664 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&enmCtrlType); 4665 pHlp->pfnSSMGetU32(pSSM, &cDeviceStates); 4666 rc = pHlp->pfnSSMGetU32(pSSM, &cPorts); 4695 4667 AssertRCReturn(rc, rc); 4696 rc = SSMR3GetU32(pSSM, &cDeviceStates);4697 AssertRCReturn(rc, rc);4698 rc = SSMR3GetU32(pSSM, &cPorts);4699 AssertRCReturn(rc, rc);4700 4668 4701 4669 if (enmCtrlType != pThis->enmCtrlType) 4702 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Controller type): config=%d state=%d"),4703 pThis->enmCtrlType, enmCtrlType);4670 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Controller type): config=%d state=%d"), 4671 pThis->enmCtrlType, enmCtrlType); 4704 4672 if (cDeviceStates != pThis->cDeviceStates) 4705 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Device states): config=%u state=%u"),4706 pThis->cDeviceStates, cDeviceStates);4673 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Device states): config=%u state=%u"), 4674 pThis->cDeviceStates, cDeviceStates); 4707 4675 if (cPorts != pThis->cPorts) 4708 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Ports): config=%u state=%u"),4709 pThis->cPorts, cPorts);4676 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target config mismatch (Ports): config=%u state=%u"), 4677 pThis->cPorts, cPorts); 4710 4678 } 4711 4679 if (uVersion > LSILOGIC_SAVED_STATE_VERSION_VBOX_30) … … 4714 4682 { 4715 4683 bool fPresent; 4716 rc = SSMR3GetBool(pSSM, &fPresent);4684 rc = pHlp->pfnSSMGetBool(pSSM, &fPresent); 4717 4685 AssertRCReturn(rc, rc); 4718 4686 if (fPresent != (pThis->paDeviceStates[i].pDrvBase != NULL)) 4719 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"),4720 i, pThis->paDeviceStates[i].pDrvBase != NULL, fPresent);4687 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"), 4688 i, pThis->paDeviceStates[i].pDrvBase != NULL, fPresent); 4721 4689 } 4722 4690 } … … 4731 4699 AssertMsg(!pDevice->cOutstandingRequests, 4732 4700 ("There are still outstanding requests on this device\n")); 4733 SSMR3GetU32(pSSM, (uint32_t *)&pDevice->cOutstandingRequests);4701 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pDevice->cOutstandingRequests); 4734 4702 } 4735 4703 /* Now the main device state. */ 4736 SSMR3GetU32(pSSM, (uint32_t *)&pThis->enmState);4737 SSMR3GetU32(pSSM, (uint32_t *)&pThis->enmWhoInit);4704 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmState); 4705 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmWhoInit); 4738 4706 if (uVersion <= LSILOGIC_SAVED_STATE_VERSION_BOOL_DOORBELL) 4739 4707 { … … 4744 4712 * doorbell not in use or a Function handshake is currently in progress. 4745 4713 */ 4746 SSMR3GetBool (pSSM, &fDoorbellInProgress);4714 pHlp->pfnSSMGetBool (pSSM, &fDoorbellInProgress); 4747 4715 if (fDoorbellInProgress) 4748 4716 pThis->enmDoorbellState = LSILOGICDOORBELLSTATE_FN_HANDSHAKE; … … 4751 4719 } 4752 4720 else 4753 SSMR3GetU32(pSSM, (uint32_t *)&pThis->enmDoorbellState);4754 SSMR3GetBool(pSSM, &pThis->fDiagnosticEnabled);4755 SSMR3GetBool(pSSM, &pThis->fNotificationSent);4756 SSMR3GetBool(pSSM, &pThis->fEventNotificationEnabled);4757 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uInterruptMask);4758 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uInterruptStatus);4721 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->enmDoorbellState); 4722 pHlp->pfnSSMGetBool(pSSM, &pThis->fDiagnosticEnabled); 4723 pHlp->pfnSSMGetBool(pSSM, &pThis->fNotificationSent); 4724 pHlp->pfnSSMGetBool(pSSM, &pThis->fEventNotificationEnabled); 4725 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uInterruptMask); 4726 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uInterruptStatus); 4759 4727 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aMessage); i++) 4760 SSMR3GetU32 (pSSM, &pThis->aMessage[i]);4761 SSMR3GetU32(pSSM, &pThis->iMessage);4762 SSMR3GetU32(pSSM, &pThis->cMessage);4763 SSMR3GetMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer));4764 SSMR3GetU32(pSSM, &pThis->uNextReplyEntryRead);4765 SSMR3GetU32(pSSM, &pThis->cReplySize);4766 SSMR3GetU16(pSSM, &pThis->u16IOCFaultCode);4767 SSMR3GetU32(pSSM, &pThis->u32HostMFAHighAddr);4768 SSMR3GetU32(pSSM, &pThis->u32SenseBufferHighAddr);4769 SSMR3GetU8(pSSM, &pThis->cMaxDevices);4770 SSMR3GetU8(pSSM, &pThis->cMaxBuses);4771 SSMR3GetU16(pSSM, &pThis->cbReplyFrame);4772 SSMR3GetU32(pSSM, &pThis->iDiagnosticAccess);4728 pHlp->pfnSSMGetU32 (pSSM, &pThis->aMessage[i]); 4729 pHlp->pfnSSMGetU32(pSSM, &pThis->iMessage); 4730 pHlp->pfnSSMGetU32(pSSM, &pThis->cMessage); 4731 pHlp->pfnSSMGetMem(pSSM, &pThis->ReplyBuffer, sizeof(pThis->ReplyBuffer)); 4732 pHlp->pfnSSMGetU32(pSSM, &pThis->uNextReplyEntryRead); 4733 pHlp->pfnSSMGetU32(pSSM, &pThis->cReplySize); 4734 pHlp->pfnSSMGetU16(pSSM, &pThis->u16IOCFaultCode); 4735 pHlp->pfnSSMGetU32(pSSM, &pThis->u32HostMFAHighAddr); 4736 pHlp->pfnSSMGetU32(pSSM, &pThis->u32SenseBufferHighAddr); 4737 pHlp->pfnSSMGetU8(pSSM, &pThis->cMaxDevices); 4738 pHlp->pfnSSMGetU8(pSSM, &pThis->cMaxBuses); 4739 pHlp->pfnSSMGetU16(pSSM, &pThis->cbReplyFrame); 4740 pHlp->pfnSSMGetU32(pSSM, &pThis->iDiagnosticAccess); 4773 4741 4774 4742 uint32_t cReplyQueueEntries, cRequestQueueEntries; 4775 SSMR3GetU32 (pSSM, &cReplyQueueEntries); 4776 SSMR3GetU32 (pSSM, &cRequestQueueEntries); 4743 pHlp->pfnSSMGetU32(pSSM, &cReplyQueueEntries); 4744 rc = pHlp->pfnSSMGetU32(pSSM, &cRequestQueueEntries); 4745 AssertRCReturn(rc, rc); 4777 4746 4778 4747 if ( cReplyQueueEntries != pThis->cReplyQueueEntries … … 4789 4758 } 4790 4759 4791 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextEntryFreeWrite);4792 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextAddressRead);4793 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextEntryFreeWrite);4794 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextAddressRead);4795 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextEntryFreeWrite);4796 SSMR3GetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextAddressRead);4760 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextEntryFreeWrite); 4761 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyFreeQueueNextAddressRead); 4762 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextEntryFreeWrite); 4763 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uReplyPostQueueNextAddressRead); 4764 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextEntryFreeWrite); 4765 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->uRequestQueueNextAddressRead); 4797 4766 4798 4767 PMptConfigurationPagesSupported pPages = pThis->pConfigurationPages; … … 4804 4773 4805 4774 if (pThis->enmCtrlType != LSILOGICCTRLTYPE_SCSI_SPI) 4806 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: Expected SPI SCSI controller"));4807 4808 SSMR3GetMem(pSSM, &ConfigPagesV2,4775 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: Expected SPI SCSI controller")); 4776 4777 pHlp->pfnSSMGetMem(pSSM, &ConfigPagesV2, 4809 4778 sizeof(MptConfigurationPagesSupported_SSM_V2)); 4810 4779 … … 4841 4810 /* Queue content */ 4842 4811 for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++) 4843 SSMR3GetU32(pSSM, (uint32_t *)&pThis->pReplyFreeQueueBaseR3[i]);4812 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pReplyFreeQueueBaseR3[i]); 4844 4813 for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++) 4845 SSMR3GetU32(pSSM, (uint32_t *)&pThis->pReplyPostQueueBaseR3[i]);4814 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pReplyPostQueueBaseR3[i]); 4846 4815 for (unsigned i = 0; i < pThis->cRequestQueueEntries; i++) 4847 SSMR3GetU32(pSSM, (uint32_t *)&pThis->pRequestQueueBaseR3[i]);4848 4849 SSMR3GetU16(pSSM, &pThis->u16NextHandle);4816 pHlp->pfnSSMGetU32(pSSM, (uint32_t *)&pThis->pRequestQueueBaseR3[i]); 4817 4818 pHlp->pfnSSMGetU16(pSSM, &pThis->u16NextHandle); 4850 4819 4851 4820 if (uVersion > LSILOGIC_SAVED_STATE_VERSION_PRE_DIAG_MEM) … … 4853 4822 4854 4823 /* Save diagnostic memory register and data regions. */ 4855 SSMR3GetU32(pSSM, &pThis->u32DiagMemAddr);4824 pHlp->pfnSSMGetU32(pSSM, &pThis->u32DiagMemAddr); 4856 4825 uint32_t cMemRegions = 0; 4857 rc = SSMR3GetU32(pSSM, &cMemRegions);4826 rc = pHlp->pfnSSMGetU32(pSSM, &cMemRegions); 4858 4827 AssertLogRelRCReturn(rc, rc); 4859 4828 … … 4861 4830 { 4862 4831 uint32_t u32AddrStart = 0; 4863 SSMR3GetU32(pSSM, &u32AddrStart);4832 pHlp->pfnSSMGetU32(pSSM, &u32AddrStart); 4864 4833 uint32_t u32AddrEnd = 0; 4865 rc = SSMR3GetU32(pSSM, &u32AddrEnd);4834 rc = pHlp->pfnSSMGetU32(pSSM, &u32AddrEnd); 4866 4835 AssertLogRelRCReturn(rc, rc); 4867 4836 … … 4872 4841 pRegion->u32AddrStart = u32AddrStart; 4873 4842 pRegion->u32AddrEnd = u32AddrEnd; 4874 SSMR3GetMem(pSSM, &pRegion->au32Data[0], cRegion * sizeof(uint32_t));4843 pHlp->pfnSSMGetMem(pSSM, &pRegion->au32Data[0], cRegion * sizeof(uint32_t)); 4875 4844 lsilogicR3MemRegionInsert(pThis, pRegion); 4876 4845 pThis->cbMemRegns += cRegion * sizeof(uint32_t); … … 4880 4849 /* Leave a log message but continue. */ 4881 4850 LogRel(("LsiLogic: Out of memory while restoring the state, might not work as expected\n")); 4882 SSMR3Skip(pSSM, cRegion * sizeof(uint32_t));4851 pHlp->pfnSSMSkip(pSSM, cRegion * sizeof(uint32_t)); 4883 4852 } 4884 4853 cMemRegions--; … … 4887 4856 4888 4857 /* Configuration pages */ 4889 SSMR3GetMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0));4890 SSMR3GetMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1));4891 SSMR3GetMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2));4892 SSMR3GetMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3));4893 SSMR3GetMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4));4894 SSMR3GetMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5));4895 SSMR3GetMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6));4896 SSMR3GetMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8));4897 SSMR3GetMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9));4898 SSMR3GetMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10));4899 SSMR3GetMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0));4900 SSMR3GetMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1));4901 SSMR3GetMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2));4902 SSMR3GetMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3));4903 SSMR3GetMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4));4904 SSMR3GetMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0));4905 SSMR3GetMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1));4906 SSMR3GetMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2));4907 SSMR3GetMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3));4908 SSMR3GetMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4));4909 SSMR3GetMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6));4910 SSMR3GetMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1));4911 SSMR3GetMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2));4912 SSMR3GetMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4));4858 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage0, sizeof(MptConfigurationPageManufacturing0)); 4859 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage1, sizeof(MptConfigurationPageManufacturing1)); 4860 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage2, sizeof(MptConfigurationPageManufacturing2)); 4861 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage3, sizeof(MptConfigurationPageManufacturing3)); 4862 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage4, sizeof(MptConfigurationPageManufacturing4)); 4863 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage5, sizeof(MptConfigurationPageManufacturing5)); 4864 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage6, sizeof(MptConfigurationPageManufacturing6)); 4865 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage8, sizeof(MptConfigurationPageManufacturing8)); 4866 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage9, sizeof(MptConfigurationPageManufacturing9)); 4867 pHlp->pfnSSMGetMem(pSSM, &pPages->ManufacturingPage10, sizeof(MptConfigurationPageManufacturing10)); 4868 pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage0, sizeof(MptConfigurationPageIOUnit0)); 4869 pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage1, sizeof(MptConfigurationPageIOUnit1)); 4870 pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage2, sizeof(MptConfigurationPageIOUnit2)); 4871 pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage3, sizeof(MptConfigurationPageIOUnit3)); 4872 pHlp->pfnSSMGetMem(pSSM, &pPages->IOUnitPage4, sizeof(MptConfigurationPageIOUnit4)); 4873 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage0, sizeof(MptConfigurationPageIOC0)); 4874 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage1, sizeof(MptConfigurationPageIOC1)); 4875 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage2, sizeof(MptConfigurationPageIOC2)); 4876 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage3, sizeof(MptConfigurationPageIOC3)); 4877 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage4, sizeof(MptConfigurationPageIOC4)); 4878 pHlp->pfnSSMGetMem(pSSM, &pPages->IOCPage6, sizeof(MptConfigurationPageIOC6)); 4879 pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage1, sizeof(MptConfigurationPageBIOS1)); 4880 pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage2, sizeof(MptConfigurationPageBIOS2)); 4881 pHlp->pfnSSMGetMem(pSSM, &pPages->BIOSPage4, sizeof(MptConfigurationPageBIOS4)); 4913 4882 4914 4883 /* Device dependent pages */ … … 4917 4886 PMptConfigurationPagesSpi pSpiPages = &pPages->u.SpiPages; 4918 4887 4919 SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0));4920 SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1));4921 SSMR3GetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2));4888 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage0, sizeof(MptConfigurationPageSCSISPIPort0)); 4889 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage1, sizeof(MptConfigurationPageSCSISPIPort1)); 4890 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aPortPages[0].SCSISPIPortPage2, sizeof(MptConfigurationPageSCSISPIPort2)); 4922 4891 4923 4892 for (unsigned i = 0; i < RT_ELEMENTS(pSpiPages->aBuses[0].aDevicePages); i++) 4924 4893 { 4925 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0));4926 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1));4927 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2));4928 SSMR3GetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3));4894 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage0, sizeof(MptConfigurationPageSCSISPIDevice0)); 4895 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage1, sizeof(MptConfigurationPageSCSISPIDevice1)); 4896 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage2, sizeof(MptConfigurationPageSCSISPIDevice2)); 4897 pHlp->pfnSSMGetMem(pSSM, &pSpiPages->aBuses[0].aDevicePages[i].SCSISPIDevicePage3, sizeof(MptConfigurationPageSCSISPIDevice3)); 4929 4898 } 4930 4899 } … … 4934 4903 PMptConfigurationPagesSas pSasPages = &pPages->u.SasPages; 4935 4904 4936 SSMR3GetU32(pSSM, &cbManufacturingPage7); 4937 SSMR3GetU32(pSSM, &cbPage0); 4938 SSMR3GetU32(pSSM, &cbPage1); 4905 pHlp->pfnSSMGetU32(pSSM, &cbManufacturingPage7); 4906 pHlp->pfnSSMGetU32(pSSM, &cbPage0); 4907 rc = pHlp->pfnSSMGetU32(pSSM, &cbPage1); 4908 AssertRCReturn(rc, rc); 4939 4909 4940 4910 if ( (cbPage0 != pSasPages->cbSASIOUnitPage0) … … 4947 4917 AssertPtr(pSasPages->pSASIOUnitPage1); 4948 4918 4949 SSMR3GetMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7); 4950 SSMR3GetMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0); 4951 SSMR3GetMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1); 4952 4953 SSMR3GetMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2)); 4954 SSMR3GetMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3)); 4955 4956 SSMR3GetU32(pSSM, &cPHYs); 4919 pHlp->pfnSSMGetMem(pSSM, pSasPages->pManufacturingPage7, pSasPages->cbManufacturingPage7); 4920 pHlp->pfnSSMGetMem(pSSM, pSasPages->pSASIOUnitPage0, pSasPages->cbSASIOUnitPage0); 4921 pHlp->pfnSSMGetMem(pSSM, pSasPages->pSASIOUnitPage1, pSasPages->cbSASIOUnitPage1); 4922 4923 pHlp->pfnSSMGetMem(pSSM, &pSasPages->SASIOUnitPage2, sizeof(MptConfigurationPageSASIOUnit2)); 4924 pHlp->pfnSSMGetMem(pSSM, &pSasPages->SASIOUnitPage3, sizeof(MptConfigurationPageSASIOUnit3)); 4925 4926 rc = pHlp->pfnSSMGetU32(pSSM, &cPHYs); 4927 AssertRCReturn(rc, rc); 4957 4928 if (cPHYs != pSasPages->cPHYs) 4958 4929 return VERR_SSM_LOAD_CONFIG_MISMATCH; … … 4961 4932 for (unsigned i = 0; i < pSasPages->cPHYs; i++) 4962 4933 { 4963 SSMR3GetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0));4964 SSMR3GetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1));4934 pHlp->pfnSSMGetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage0, sizeof(MptConfigurationPageSASPHY0)); 4935 pHlp->pfnSSMGetMem(pSSM, &pSasPages->paPHYs[i].SASPHYPage1, sizeof(MptConfigurationPageSASPHY1)); 4965 4936 } 4966 4937 4967 4938 /* The number of devices first. */ 4968 SSMR3GetU32(pSSM, &pSasPages->cDevices); 4939 rc = pHlp->pfnSSMGetU32(pSSM, &pSasPages->cDevices); 4940 AssertRCReturn(rc, rc); 4969 4941 4970 4942 PMptSASDevice pCurr = pSasPages->pSASDeviceHead; … … 4972 4944 for (unsigned i = 0; i < pSasPages->cDevices; i++) 4973 4945 { 4974 SSMR3GetMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0)); 4975 SSMR3GetMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1)); 4976 SSMR3GetMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2)); 4946 AssertReturn(pCurr, VERR_SSM_LOAD_CONFIG_MISMATCH); 4947 4948 pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage0, sizeof(MptConfigurationPageSASDevice0)); 4949 pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage1, sizeof(MptConfigurationPageSASDevice1)); 4950 rc = pHlp->pfnSSMGetMem(pSSM, &pCurr->SASDevicePage2, sizeof(MptConfigurationPageSASDevice2)); 4951 AssertRCReturn(rc, rc); 4977 4952 4978 4953 pCurr = pCurr->pNext; … … 4989 4964 { 4990 4965 LogRel(("LsiLogic: Failed to restore BIOS state: %Rrc.\n", rc)); 4991 return PDMDEV_SET_ERROR(pDevIns, rc, 4992 N_("LsiLogic: Failed to restore BIOS state\n")); 4966 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: Failed to restore BIOS state\n")); 4993 4967 } 4994 4968 4995 4969 uint32_t u32; 4996 rc = SSMR3GetU32(pSSM, &u32);4970 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 4997 4971 if (RT_FAILURE(rc)) 4998 4972 return rc; … … 5307 5281 5308 5282 pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 5309 pThis->pNotificationQueueRC = PDMQueueRCPtr(pThis->pNotificationQueueR3);5310 5283 5311 5284 /* Relocate queues. */ … … 5358 5331 { 5359 5332 PLSILOGICSCSI pThis = PDMDEVINS_2_DATA(pDevIns, PLSILOGICSCSI); 5333 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 5360 5334 int rc = VINF_SUCCESS; 5361 5335 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); … … 5371 5345 * Validate and read configuration. 5372 5346 */ 5373 rc = CFGMR3AreValuesValid(pCfg, "GCEnabled\0" 5374 "R0Enabled\0" 5375 "ReplyQueueDepth\0" 5376 "RequestQueueDepth\0" 5377 "ControllerType\0" 5378 "NumPorts\0" 5379 "Bootable\0"); 5380 if (RT_FAILURE(rc)) 5381 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 5382 N_("LsiLogic configuration error: unknown option specified")); 5383 rc = CFGMR3QueryBoolDef(pCfg, "GCEnabled", &pThis->fGCEnabled, true); 5384 if (RT_FAILURE(rc)) 5385 return PDMDEV_SET_ERROR(pDevIns, rc, 5386 N_("LsiLogic configuration error: failed to read GCEnabled as boolean")); 5387 Log(("%s: fGCEnabled=%d\n", __FUNCTION__, pThis->fGCEnabled)); 5388 5389 rc = CFGMR3QueryBoolDef(pCfg, "R0Enabled", &pThis->fR0Enabled, true); 5390 if (RT_FAILURE(rc)) 5391 return PDMDEV_SET_ERROR(pDevIns, rc, 5392 N_("LsiLogic configuration error: failed to read R0Enabled as boolean")); 5393 Log(("%s: fR0Enabled=%d\n", __FUNCTION__, pThis->fR0Enabled)); 5394 5395 rc = CFGMR3QueryU32Def(pCfg, "ReplyQueueDepth", 5396 &pThis->cReplyQueueEntries, 5397 LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT); 5347 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, 5348 "ReplyQueueDepth|" 5349 "RequestQueueDepth|" 5350 "ControllerType|" 5351 "NumPorts|" 5352 "Bootable", 5353 ""); 5354 5355 pThis->fGCEnabled = pDevIns->fRCEnabled; 5356 pThis->fR0Enabled = pDevIns->fR0Enabled; 5357 5358 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "ReplyQueueDepth", 5359 &pThis->cReplyQueueEntries, LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT); 5398 5360 if (RT_FAILURE(rc)) 5399 5361 return PDMDEV_SET_ERROR(pDevIns, rc, … … 5401 5363 Log(("%s: ReplyQueueDepth=%u\n", __FUNCTION__, pThis->cReplyQueueEntries)); 5402 5364 5403 rc = CFGMR3QueryU32Def(pCfg, "RequestQueueDepth", 5404 &pThis->cRequestQueueEntries, 5405 LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT); 5365 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "RequestQueueDepth", 5366 &pThis->cRequestQueueEntries, LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT); 5406 5367 if (RT_FAILURE(rc)) 5407 5368 return PDMDEV_SET_ERROR(pDevIns, rc, … … 5410 5371 5411 5372 char *pszCtrlType; 5412 rc = CFGMR3QueryStringAllocDef(pCfg, "ControllerType", 5413 &pszCtrlType, LSILOGICSCSI_PCI_SPI_CTRLNAME); 5373 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "ControllerType", &pszCtrlType, LSILOGICSCSI_PCI_SPI_CTRLNAME); 5414 5374 if (RT_FAILURE(rc)) 5415 5375 return PDMDEV_SET_ERROR(pDevIns, rc, … … 5425 5385 iInstance); 5426 5386 5427 5428 5387 if (RT_FAILURE(rc)) 5429 return PDMDEV_SET_ERROR(pDevIns, rc, 5430 N_("LsiLogic configuration error: failed to determine controller type from string")); 5431 5432 rc = CFGMR3QueryU8(pCfg, "NumPorts", 5433 &pThis->cPorts); 5388 return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic configuration error: failed to determine controller type from string")); 5389 5390 rc = pHlp->pfnCFGMQueryU8(pCfg, "NumPorts", &pThis->cPorts); 5434 5391 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 5435 5392 { … … 5446 5403 5447 5404 bool fBootable; 5448 rc = CFGMR3QueryBoolDef(pCfg, "Bootable", &fBootable, true);5405 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Bootable", &fBootable, true); 5449 5406 if (RT_FAILURE(rc)) 5450 5407 return PDMDEV_SET_ERROR(pDevIns, rc, … … 5553 5510 if (RT_FAILURE(rc)) 5554 5511 return rc; 5555 5556 /* Initialize task queue. (Need two items to handle SMP guest concurrency.) */5557 char szTaggedText[64];5558 RTStrPrintf(szTaggedText, sizeof(szTaggedText), "%s-Task", szDevTag);5559 rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 2, 0,5560 lsilogicR3NotifyQueueConsumer, true,5561 szTaggedText,5562 &pThis->pNotificationQueueR3);5563 if (RT_FAILURE(rc))5564 return rc;5565 pThis->pNotificationQueueR0 = PDMQueueR0Ptr(pThis->pNotificationQueueR3);5566 pThis->pNotificationQueueRC = PDMQueueRCPtr(pThis->pNotificationQueueR3);5567 5512 5568 5513 /*
Note:
See TracChangeset
for help on using the changeset viewer.