Changeset 37687 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 29, 2011 3:22:11 PM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/ATAController.cpp
r37466 r37687 2402 2402 break; 2403 2403 case 2: /* 10 - Eject media */ 2404 { 2404 2405 /* This must be done from EMT. */ 2405 {2406 2406 PAHCIATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s); 2407 2407 PPDMDEVINS pDevIns = ATADEVSTATE_2_DEVINS(s); … … 2412 2412 false /*=fForce*/, true /*=fEeject*/); 2413 2413 Assert(RT_SUCCESS(rc) || (rc == VERR_PDM_MEDIA_LOCKED) || (rc = VERR_PDM_MEDIA_NOT_MOUNTED)); 2414 if (RT_SUCCESS(rc) && pCtl->pMediaNotify) 2415 { 2416 rc = VMR3ReqCallNoWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 2417 (PFNRT)pCtl->pMediaNotify->pfnEjected, 2, 2418 pCtl->pMediaNotify, s->iLUN); 2419 AssertRC(rc); 2420 } 2414 2421 { 2415 2422 STAM_PROFILE_START(&pCtl->StatLockWait, a); … … 2417 2424 STAM_PROFILE_STOP(&pCtl->StatLockWait, a); 2418 2425 } 2419 }2420 2426 break; 2427 } 2421 2428 case 3: /* 11 - Load media */ 2422 2429 /** @todo rc = s->pDrvMount->pfnLoadMedia(s->pDrvMount) */ … … 5567 5574 5568 5575 int ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl, 5576 PPDMIMEDIANOTIFY pMediaNotify, 5569 5577 unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster, PPDMLED pLedMaster, 5570 5578 PSTAMCOUNTER pStatBytesReadMaster, PSTAMCOUNTER pStatBytesWrittenMaster, … … 5588 5596 pCtl->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns); 5589 5597 pCtl->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 5598 pCtl->pMediaNotify = pMediaNotify; 5590 5599 pCtl->AsyncIOSem = NIL_RTSEMEVENT; 5591 5600 pCtl->SuspendIOSem = NIL_RTSEMEVENT; -
trunk/src/VBox/Devices/Storage/ATAController.h
r37264 r37687 387 387 /** The event semaphore the thread is waiting on during suspended I/O. */ 388 388 RTSEMEVENT SuspendIOSem; 389 /** Pointer to Media Notify interface. */ 390 R3PTRTYPE(PPDMIMEDIANOTIFY) pMediaNotify; 389 391 #if 0 /*HC_ARCH_BITS == 32*/ 390 392 uint32_t Alignment0; … … 429 431 * @param pDevIns Pointer to the device instance which creates a controller. 430 432 * @param pCtl Pointer to the unitialized ATA controller structure. 433 * @param pMediaNotify Pointer to PDM interface for media eject. 431 434 * @param iLUNMaster Port number of the master device. 432 435 * @param pDrvBaseMaster Pointer to the base driver interface which acts as the master. … … 457 460 */ 458 461 int ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl, 462 PPDMIMEDIANOTIFY pMediaNotify, 459 463 unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster, PPDMLED pLedMaster, 460 464 PSTAMCOUNTER pStatBytesReadMaster, PSTAMCOUNTER pStatBytesWrittenMaster, -
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r37673 r37687 575 575 /** Status LUN: Partner of ILeds. */ 576 576 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector; 577 /** Status LUN: Media Notifys. */ 578 R3PTRTYPE(PPDMIMEDIANOTIFY) pMediaNotify; 577 579 578 580 #if HC_ARCH_BITS == 64 … … 4383 4385 break; 4384 4386 case 2: /* 10 - Eject media */ 4387 { 4385 4388 /* This must be done from EMT. */ 4389 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci); 4390 PPDMDEVINS pDevIns = pAhci->CTX_SUFF(pDevIns); 4391 4392 rc2 = VMR3ReqCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 4393 (PFNRT)pAhciPort->pDrvMount->pfnUnmount, 3, 4394 pAhciPort->pDrvMount, false/*=fForce*/, true/*=fEject*/); 4395 Assert(RT_SUCCESS(rc2) || (rc2 == VERR_PDM_MEDIA_LOCKED) || (rc2 = VERR_PDM_MEDIA_NOT_MOUNTED)); 4396 if (RT_SUCCESS(rc) && pAhci->pMediaNotify) 4386 4397 { 4387 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci); 4388 PPDMDEVINS pDevIns = pAhci->CTX_SUFF(pDevIns); 4389 4390 rc2 = VMR3ReqCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 4391 (PFNRT)pAhciPort->pDrvMount->pfnUnmount, 3, 4392 pAhciPort->pDrvMount, false/*=fForce*/, true/*=fEject*/); 4393 Assert(RT_SUCCESS(rc2) || (rc2 == VERR_PDM_MEDIA_LOCKED) || (rc2 = VERR_PDM_MEDIA_NOT_MOUNTED)); 4398 rc2 = VMR3ReqCallNoWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 4399 (PFNRT)pAhci->pMediaNotify->pfnEjected, 2, 4400 pAhci->pMediaNotify, pAhciPort->iLUN); 4401 AssertRC(rc); 4394 4402 } 4395 4403 break; 4404 } 4396 4405 case 3: /* 11 - Load media */ 4397 4406 /** @todo rc = s->pDrvMount->pfnLoadMedia(s->pDrvMount) */ … … 8607 8616 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port"); 8608 8617 if (RT_SUCCESS(rc)) 8618 { 8609 8619 pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS); 8620 pThis->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIANOTIFY); 8621 } 8610 8622 else if (rc != VERR_PDM_NO_ATTACHED_DRIVER) 8611 8623 { … … 8659 8671 char szName[24]; 8660 8672 RTStrPrintf(szName, sizeof(szName), "EmulatedATA%d", i); 8661 rc = ataControllerInit(pDevIns, pCtl, 8673 rc = ataControllerInit(pDevIns, pCtl, pThis->pMediaNotify, 8662 8674 iPortMaster, pThis->ahciPort[iPortMaster].pDrvBase, 8663 8675 &pThis->ahciPort[iPortMaster].Led, -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r37653 r37687 476 476 /** Status LUN: Partner of ILeds. */ 477 477 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector; 478 /** Status LUN: Media Notify. */ 479 R3PTRTYPE(PPDMIMEDIANOTIFY) pMediaNotify; 478 480 /** Flag whether GC is enabled. */ 479 481 bool fGCEnabled; … … 3116 3118 break; 3117 3119 case 2: /* 10 - Eject media */ 3120 { 3118 3121 /* This must be done from EMT. */ 3119 {3120 3122 PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s); 3121 3123 PPDMDEVINS pDevIns = ATADEVSTATE_2_DEVINS(s); 3124 PCIATAState *pThis = PDMINS_2_DATA(pDevIns, PCIATAState *); 3122 3125 3123 3126 PDMCritSectLeave(&pCtl->lock); … … 3126 3129 s->pDrvMount, false /*=fForce*/, true /*=fEject*/); 3127 3130 Assert(RT_SUCCESS(rc) || (rc == VERR_PDM_MEDIA_LOCKED) || (rc = VERR_PDM_MEDIA_NOT_MOUNTED)); 3131 if (RT_SUCCESS(rc) && pThis->pMediaNotify) 3132 { 3133 rc = VMR3ReqCallNoWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 3134 (PFNRT)pThis->pMediaNotify->pfnEjected, 2, 3135 pThis->pMediaNotify, s->iLUN); 3136 AssertRC(rc); 3137 } 3128 3138 { 3129 3139 STAM_PROFILE_START(&pCtl->StatLockWait, a); … … 3131 3141 STAM_PROFILE_STOP(&pCtl->StatLockWait, a); 3132 3142 } 3133 }3134 3143 break; 3144 } 3135 3145 case 3: /* 11 - Load media */ 3136 3146 /** @todo rc = s->pDrvMount->pfnLoadMedia(s->pDrvMount) */ … … 7042 7052 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port"); 7043 7053 if (RT_SUCCESS(rc)) 7054 { 7044 7055 pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS); 7056 pThis->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIANOTIFY); 7057 } 7045 7058 else if (rc != VERR_PDM_NO_ATTACHED_DRIVER) 7046 7059 {
Note:
See TracChangeset
for help on using the changeset viewer.