Changeset 36329 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Mar 21, 2011 4:47:48 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70660
- Location:
- trunk/src/VBox/HostDrivers/VBoxPci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r36260 r36329 201 201 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 202 202 int rc; 203 203 204 204 rc = vboxPciOsDevDestroy(pThis); 205 205 if (rc == VINF_SUCCESS) … … 210 210 pThis->hFastMtx = NIL_RTSEMFASTMUTEX; 211 211 } 212 212 213 213 if (pThis->hSpinlock) 214 214 { … … 216 216 pThis->hSpinlock = NIL_RTSPINLOCK; 217 217 } 218 218 219 219 vboxPciGlobalsLock(pThis->pGlobals); 220 220 vboxPciUnlinkInstanceLocked(pThis->pGlobals, pThis); … … 486 486 } 487 487 488 /** 489 * @copydoc RAWPCIFACTORY::pfnInitVm 490 */ 491 static DECLCALLBACK(int) vboxPciFactoryInitVm(PRAWPCIFACTORY pFactory, 492 PVM pVM, 493 PRAWPCIVM pPciData) 494 { 495 PVBOXRAWPCIVM pThis = (PVBOXRAWPCIVM)RTMemAllocZ(sizeof(VBOXRAWPCIVM)); 496 int rc; 497 498 if (!pThis) 499 return VERR_NO_MEMORY; 500 501 rc = RTSemFastMutexCreate(&pThis->hFastMtx); 502 if (RT_SUCCESS(rc)) 503 { 504 rc = vboxPciOsInitVm(pThis, pVM); 505 506 if (RT_SUCCESS(rc)) 507 { 508 pPciData->pDriverData = pThis; 509 return VINF_SUCCESS; 510 } 511 512 RTSemFastMutexDestroy(pThis->hFastMtx); 513 pThis->hFastMtx = NIL_RTSEMFASTMUTEX; 514 RTMemFree(pThis); 515 } 516 517 return rc; 518 } 519 520 /** 521 * @copydoc RAWPCIFACTORY::pfnDeinitVm 522 */ 523 static DECLCALLBACK(void) vboxPciFactoryDeinitVm(PRAWPCIFACTORY pFactory, 524 PVM pVM, 525 PRAWPCIVM pPciData) 526 { 527 if (pPciData->pDriverData) 528 { 529 PVBOXRAWPCIVM pThis = pPciData->pDriverData; 530 531 vboxPciOsDeinitVm(pThis, pVM); 532 533 if (pThis->hFastMtx) 534 { 535 RTSemFastMutexDestroy(pThis->hFastMtx); 536 pThis->hFastMtx = NIL_RTSEMFASTMUTEX; 537 } 538 539 RTMemFree(pThis); 540 pPciData->pDriverData = NULL; 541 } 542 } 543 544 488 545 static DECLHIDDEN(bool) vboxPciCanUnload(PVBOXRAWPCIGLOBALS pGlobals) 489 546 { … … 579 636 pGlobals->RawPciFactory.pfnRelease = vboxPciFactoryRelease; 580 637 pGlobals->RawPciFactory.pfnCreateAndConnect = vboxPciFactoryCreateAndConnect; 638 pGlobals->RawPciFactory.pfnInitVm = vboxPciFactoryInitVm; 639 pGlobals->RawPciFactory.pfnDeinitVm = vboxPciFactoryDeinitVm; 581 640 memcpy(pGlobals->SupDrvFactory.szName, "VBoxRawPci", sizeof("VBoxRawPci")); 582 641 pGlobals->SupDrvFactory.pfnQueryFactoryInterface = vboxPciQueryFactoryInterface; -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h
r36260 r36329 42 42 /* Forward declaration. */ 43 43 typedef struct VBOXRAWPCIGLOBALS *PVBOXRAWPCIGLOBALS; 44 typedef struct VBOXRAWPCIVM *PVBOXRAWPCIVM; 44 45 typedef struct VBOXRAWPCIINS *PVBOXRAWPCIINS; 45 46 … … 87 88 88 89 /** 90 * Per-VM data of the VBox PCI driver. Pointed to by pVM->rawpci.s.pOsData. 91 * 92 */ 93 typedef struct VBOXRAWPCIVM 94 { 95 /** Mutex protecting state changes. */ 96 RTSEMFASTMUTEX hFastMtx; 97 98 #ifdef RT_OS_LINUX 99 # ifdef VBOX_WITH_IOMMU 100 struct iommu_domain* iommu_domain; 101 # endif 102 #endif 103 } VBOXRAWPCIVM; 104 105 /** 89 106 * The global data of the VBox PCI driver. 90 107 * … … 114 131 struct module * pciStubModule; 115 132 #endif 116 117 133 } VBOXRAWPCIGLOBALS; 118 134 119 135 DECLHIDDEN(int) vboxPciInit(PVBOXRAWPCIGLOBALS pGlobals); 120 136 DECLHIDDEN(void) vboxPciShutdown(PVBOXRAWPCIGLOBALS pGlobals); 137 138 DECLHIDDEN(int) vboxPciOsInitVm(PVBOXRAWPCIVM pThis, PVM pVM); 139 DECLHIDDEN(void) vboxPciOsDeinitVm(PVBOXRAWPCIVM pThis, PVM pVM); 121 140 122 141 DECLHIDDEN(int) vboxPciOsDevInit (PVBOXRAWPCIINS pIns, uint32_t fFlags);
Note:
See TracChangeset
for help on using the changeset viewer.