Changeset 36340 in vbox for trunk/src/VBox/HostDrivers/VBoxPci
- Timestamp:
- Mar 22, 2011 1:19:08 PM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxPci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r36329 r36340 372 372 } 373 373 374 DECLHIDDEN(int) vboxPciDevPowerStateChange(PRAWPCIDEVPORT pPort, PCIRAWPOWERSTATE aState) 375 { 376 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 377 int rc; 378 379 vboxPciDevLock(pThis); 380 381 rc = vboxPciOsDevPowerStateChange(pThis, aState); 382 383 vboxPciDevUnlock(pThis); 384 385 return rc; 386 } 387 374 388 /** 375 389 * Creates a new instance. … … 383 397 uint32_t u32HostAddress, 384 398 uint32_t fFlags, 399 PRAWPCIVM pVmCtx, 385 400 PRAWPCIDEVPORT *ppDevPort) 386 401 { … … 396 411 pNew->HostPciAddress = u32HostAddress; 397 412 pNew->iHostIrq = -1; 413 pNew->pVmCtx = pVmCtx; 398 414 399 415 pNew->DevPort.u32Version = RAWPCIDEVPORT_VERSION; … … 411 427 pNew->DevPort.pfnRegisterIrqHandler = vboxPciDevRegisterIrqHandler; 412 428 pNew->DevPort.pfnUnregisterIrqHandler = vboxPciDevUnregisterIrqHandler; 429 pNew->DevPort.pfnPowerStateChange = vboxPciDevPowerStateChange; 413 430 pNew->DevPort.u32VersionEnd = RAWPCIDEVPORT_VERSION; 414 431 … … 447 464 uint32_t u32HostAddress, 448 465 uint32_t fFlags, 466 PRAWPCIVM pVmCtx, 449 467 PRAWPCIDEVPORT *ppDevPort) 450 468 { … … 466 484 } 467 485 468 rc = vboxPciNewInstance(pGlobals, u32HostAddress, fFlags, p pDevPort);486 rc = vboxPciNewInstance(pGlobals, u32HostAddress, fFlags, pVmCtx, ppDevPort); 469 487 470 488 unlock: … … 493 511 PRAWPCIVM pPciData) 494 512 { 495 PVBOXRAWPCI VM pThis = (PVBOXRAWPCIVM)RTMemAllocZ(sizeof(VBOXRAWPCIVM));513 PVBOXRAWPCIDRVVM pThis = (PVBOXRAWPCIDRVVM)RTMemAllocZ(sizeof(VBOXRAWPCIDRVVM)); 496 514 int rc; 497 515 … … 527 545 if (pPciData->pDriverData) 528 546 { 529 PVBOXRAWPCI VM pThis =pPciData->pDriverData;547 PVBOXRAWPCIDRVVM pThis = (PVBOXRAWPCIDRVVM)pPciData->pDriverData; 530 548 531 549 vboxPciOsDeinitVm(pThis, pVM); -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h
r36329 r36340 42 42 /* Forward declaration. */ 43 43 typedef struct VBOXRAWPCIGLOBALS *PVBOXRAWPCIGLOBALS; 44 typedef struct VBOXRAWPCI VM *PVBOXRAWPCIVM;44 typedef struct VBOXRAWPCIDRVVM *PVBOXRAWPCIDRVVM; 45 45 typedef struct VBOXRAWPCIINS *PVBOXRAWPCIINS; 46 46 … … 85 85 PFNRAWPCIISR pfnIrqHandler; 86 86 void *pIrqContext; 87 88 PRAWPCIVM pVmCtx; 87 89 } VBOXRAWPCIINS; 88 90 … … 91 93 * 92 94 */ 93 typedef struct VBOXRAWPCI VM95 typedef struct VBOXRAWPCIDRVVM 94 96 { 95 97 /** Mutex protecting state changes. */ … … 101 103 # endif 102 104 #endif 103 } VBOXRAWPCI VM;105 } VBOXRAWPCIDRVVM; 104 106 105 107 /** … … 136 138 DECLHIDDEN(void) vboxPciShutdown(PVBOXRAWPCIGLOBALS pGlobals); 137 139 138 DECLHIDDEN(int) vboxPciOsInitVm(PVBOXRAWPCI VM pThis, PVM pVM);139 DECLHIDDEN(void) vboxPciOsDeinitVm(PVBOXRAWPCI VM pThis, PVM pVM);140 DECLHIDDEN(int) vboxPciOsInitVm(PVBOXRAWPCIDRVVM pThis, PVM pVM); 141 DECLHIDDEN(void) vboxPciOsDeinitVm(PVBOXRAWPCIDRVVM pThis, PVM pVM); 140 142 141 143 DECLHIDDEN(int) vboxPciOsDevInit (PVBOXRAWPCIINS pIns, uint32_t fFlags); … … 167 169 DECLHIDDEN(int) vboxPciOsDevUnregisterIrqHandler(PVBOXRAWPCIINS pIns, int32_t iHostIrq); 168 170 171 DECLHIDDEN(int) vboxPciOsDevPowerStateChange(PVBOXRAWPCIINS pIns, PCIRAWPOWERSTATE aState); 172 173 #define VBOX_DRV_VMDATA(pIns) ((PVBOXRAWPCIDRVVM)(pIns->pVmCtx->pDriverData)) 174 169 175 RT_C_DECLS_END 170 176
Note:
See TracChangeset
for help on using the changeset viewer.