- Timestamp:
- Jul 8, 2008 10:19:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r10389 r10391 108 108 virtual void stop(IOService *pProvider); 109 109 virtual IOService *probe(IOService *pProvider, SInt32 *pi32Score); 110 virtual bool terminate(IOOptionBits fOptions); 110 111 }; 111 112 … … 196 197 /** Calculates the index into g_apSessionHashTab.*/ 197 198 #define SESSION_HASH(pid) ((pid) % RT_ELEMENTS(g_apSessionHashTab)) 199 /** The number of open sessions. */ 200 static int32_t volatile g_cSessions = 0; 198 201 199 202 … … 202 205 * rest of the kernel modules on darwin. 203 206 */ 204 externPFNRT g_apfnVBoxDrvIPRTDeps[] =207 PFNRT g_apfnVBoxDrvIPRTDeps[] = 205 208 { 206 209 (PFNRT)RTUuidCompare, … … 352 355 pSession->pNextHash = g_apSessionHashTab[iHash]; 353 356 g_apSessionHashTab[iHash] = pSession; 357 ASMAtomicIncS32(&g_cSessions); 354 358 RTSpinlockReleaseNoInts(g_Spinlock, &Tmp); 355 359 } … … 387 391 g_apSessionHashTab[iHash] = pSession->pNextHash; 388 392 pSession->pNextHash = NULL; 393 ASMAtomicIncS32(&g_cSessions); 389 394 } 390 395 else … … 398 403 pPrev->pNextHash = pSession->pNextHash; 399 404 pSession->pNextHash = NULL; 405 ASMAtomicIncS32(&g_cSessions); 400 406 break; 401 407 } … … 827 833 dprintf(("org_virtualbox_SupDrv::stop([%p], %p)\n", this, pProvider)); 828 834 IOService::stop(pProvider); 835 } 836 837 838 /** 839 * Termination request. 840 * 841 * @return true if we're ok with shutting down now, false if we're not. 842 * @param fOptions Flags. 843 */ 844 bool org_virtualbox_SupDrv::terminate(IOOptionBits fOptions) 845 { 846 bool fRc; 847 dprintf(("org_virtualbox_SupDrv::terminate: reference_count=%d g_cSessions=%d\n", 848 KMOD_INFO_NAME.reference_count, ASMAtomicUoReadS32(&g_cSessions))); 849 if ( KMOD_INFO_NAME.reference_count != 0 850 || ASMAtomicUoReadS32(&g_cSessions)) 851 fRc = false; 852 else 853 fRc = IOService::terminate(fOptions); 854 dprintf(("org_virtualbox_SupDrv::terminate: returns %d\n", fRc)); 855 return fRc; 829 856 } 830 857
Note:
See TracChangeset
for help on using the changeset viewer.