Changeset 29588 in vbox
- Timestamp:
- May 17, 2010 10:32:29 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r29326 r29588 550 550 { 551 551 int rc; 552 553 LogFlowFunc(("pLsiLogic=%#p u32MessageContext=%#x\n", pLsiLogic, u32MessageContext)); 554 552 555 AssertMsg(!pLsiLogic->fDoorbellInProgress, ("We are in a doorbell function\n")); 553 556 … … 734 737 { 735 738 PMptSCSITaskManagementRequest pTaskMgmtReq = (PMptSCSITaskManagementRequest)pMessageHdr; 739 740 LogFlow(("u8TaskType=%u\n", pTaskMgmtReq->u8TaskType)); 741 LogFlow(("u32TaskMessageContext=%#x\n", pTaskMgmtReq->u32TaskMessageContext)); 736 742 737 743 pReply->SCSITaskManagement.u8MessageLength = 6; /* 6 32bit dwords. */ … … 3757 3763 } 3758 3764 3765 /** 3766 * Allocate the queues. 3767 * 3768 * @returns VBox status code. 3769 * 3770 * @param pThis The LsiLogic device instance. 3771 */ 3772 static int lsilogicQueuesAlloc(PLSILOGICSCSI pThis) 3773 { 3774 PVM pVM = PDMDevHlpGetVM(pThis->pDevInsR3); 3775 uint32_t cbQueues; 3776 3777 Assert(!pThis->pReplyFreeQueueBaseR3); 3778 3779 cbQueues = 2*pThis->cReplyQueueEntries * sizeof(uint32_t); 3780 cbQueues += pThis->cRequestQueueEntries * sizeof(uint32_t); 3781 int rc = MMHyperAlloc(pVM, cbQueues, 1, MM_TAG_PDM_DEVICE_USER, 3782 (void **)&pThis->pReplyFreeQueueBaseR3); 3783 if (RT_FAILURE(rc)) 3784 return VERR_NO_MEMORY; 3785 pThis->pReplyFreeQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pReplyFreeQueueBaseR3); 3786 pThis->pReplyFreeQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pReplyFreeQueueBaseR3); 3787 3788 pThis->pReplyPostQueueBaseR3 = pThis->pReplyFreeQueueBaseR3 + pThis->cReplyQueueEntries; 3789 pThis->pReplyPostQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pReplyPostQueueBaseR3); 3790 pThis->pReplyPostQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pReplyPostQueueBaseR3); 3791 3792 pThis->pRequestQueueBaseR3 = pThis->pReplyPostQueueBaseR3 + pThis->cReplyQueueEntries; 3793 pThis->pRequestQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pRequestQueueBaseR3); 3794 pThis->pRequestQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pRequestQueueBaseR3); 3795 3796 return VINF_SUCCESS; 3797 } 3798 3799 /** 3800 * Free the hyper memory used or the queues. 3801 * 3802 * @returns nothing. 3803 * 3804 * @param pThis The LsiLogic device instance. 3805 */ 3806 static void lsilogicQueuesFree(PLSILOGICSCSI pThis) 3807 { 3808 PVM pVM = PDMDevHlpGetVM(pThis->pDevInsR3); 3809 int rc = VINF_SUCCESS; 3810 3811 AssertPtr(pThis->pReplyFreeQueueBaseR3); 3812 3813 rc = MMHyperFree(pVM, (void *)pThis->pReplyFreeQueueBaseR3); 3814 AssertRC(rc); 3815 3816 pThis->pReplyFreeQueueBaseR3 = NULL; 3817 pThis->pReplyPostQueueBaseR3 = NULL; 3818 pThis->pRequestQueueBaseR3 = NULL; 3819 } 3820 3759 3821 static DECLCALLBACK(int) lsilogicLiveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass) 3760 3822 { … … 4007 4069 SSMR3GetU16 (pSSM, &pLsiLogic->cbReplyFrame); 4008 4070 SSMR3GetU32 (pSSM, &pLsiLogic->iDiagnosticAccess); 4009 SSMR3GetU32 (pSSM, &pLsiLogic->cReplyQueueEntries); 4010 SSMR3GetU32 (pSSM, &pLsiLogic->cRequestQueueEntries); 4071 4072 uint32_t cReplyQueueEntries, cRequestQueueEntries; 4073 SSMR3GetU32 (pSSM, &cReplyQueueEntries); 4074 SSMR3GetU32 (pSSM, &cRequestQueueEntries); 4075 4076 if ( cReplyQueueEntries != pLsiLogic->cReplyQueueEntries 4077 || cRequestQueueEntries != pLsiLogic->cRequestQueueEntries) 4078 { 4079 LogFlow(("Reallocating queues cReplyQueueEntries=%u cRequestQueuEntries=%u\n", 4080 cReplyQueueEntries, cRequestQueueEntries)); 4081 lsilogicQueuesFree(pLsiLogic); 4082 pLsiLogic->cReplyQueueEntries = cReplyQueueEntries; 4083 pLsiLogic->cRequestQueueEntries = cRequestQueueEntries; 4084 rc = lsilogicQueuesAlloc(pLsiLogic); 4085 if (RT_FAILURE(rc)) 4086 return rc; 4087 } 4088 4011 4089 SSMR3GetU32 (pSSM, (uint32_t *)&pLsiLogic->uReplyFreeQueueNextEntryFreeWrite); 4012 4090 SSMR3GetU32 (pSSM, (uint32_t *)&pLsiLogic->uReplyFreeQueueNextAddressRead); … … 4408 4486 int rc = VINF_SUCCESS; 4409 4487 char *pszCtrlType = NULL; 4410 PVM pVM = PDMDevHlpGetVM(pDevIns);4411 4488 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 4412 4489 … … 4549 4626 * Allocate memory for the queues. 4550 4627 */ 4551 uint32_t cbQueues; 4552 4553 cbQueues = 2*pThis->cReplyQueueEntries * sizeof(uint32_t); 4554 cbQueues += pThis->cRequestQueueEntries * sizeof(uint32_t); 4555 rc = MMHyperAlloc(pVM, cbQueues, 1, MM_TAG_PDM_DEVICE_USER, 4556 (void **)&pThis->pReplyFreeQueueBaseR3); 4628 rc = lsilogicQueuesAlloc(pThis); 4557 4629 if (RT_FAILURE(rc)) 4558 return VERR_NO_MEMORY; 4559 pThis->pReplyFreeQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pReplyFreeQueueBaseR3); 4560 pThis->pReplyFreeQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pReplyFreeQueueBaseR3); 4561 4562 pThis->pReplyPostQueueBaseR3 = pThis->pReplyFreeQueueBaseR3 + pThis->cReplyQueueEntries; 4563 pThis->pReplyPostQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pReplyPostQueueBaseR3); 4564 pThis->pReplyPostQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pReplyPostQueueBaseR3); 4565 4566 pThis->pRequestQueueBaseR3 = pThis->pReplyPostQueueBaseR3 + pThis->cReplyQueueEntries; 4567 pThis->pRequestQueueBaseR0 = MMHyperR3ToR0(pVM, (void *)pThis->pRequestQueueBaseR3); 4568 pThis->pRequestQueueBaseRC = MMHyperR3ToRC(pVM, (void *)pThis->pRequestQueueBaseR3); 4630 return rc; 4569 4631 4570 4632 /* -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.h
r29326 r29588 27 27 #define LSILOGIC_SAS_ISA_IO_PORT 0x350 28 28 29 #define LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT 102430 #define LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT 12829 #define LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT 256 30 #define LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT 256 31 31 32 32 #define LSILOGICSCSI_MAXIMUM_CHAIN_DEPTH 3
Note:
See TracChangeset
for help on using the changeset viewer.