Changeset 18915 in vbox
- Timestamp:
- Apr 15, 2009 8:50:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
r16030 r18915 104 104 /** The dev_clone event handler tag. */ 105 105 static eventhandler_tag g_VBoxDrvFreeBSDEHTag; 106 /** Reference counter */ 107 static volatile uint32_t cUsers; 106 108 107 109 /** The device extention. */ … … 148 150 { 149 151 dprintf(("VBoxDrvFreeBSDLoad:\n")); 152 153 cUsers = 0; 150 154 151 155 /* … … 190 194 dprintf(("VBoxDrvFreeBSDUnload:\n")); 191 195 192 /** @todo verify that FreeBSD does reference counting. */ 196 if (cUsers > 0) 197 return EBUSY; 193 198 194 199 /* … … 307 312 pSession->Gid = stuff; */ 308 313 if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) 314 { 315 ASMAtomicIncU32(&cUsers); 309 316 return 0; 317 } 310 318 311 319 OSDBGPRINT(("VBoxDrvFreeBSDOpen: si_drv1=%p, expected 0x42!\n", pDev->si_drv1)); … … 339 347 if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession)) 340 348 OSDBGPRINT(("VBoxDrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession)); 349 ASMAtomicDecU32(&cUsers); 350 /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */ 351 destroy_dev_sched(pDev); 341 352 } 342 353 else … … 491 502 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x) -> %d; uCmd=%#lx!\n", pHdr, pvUser, cbOut, rc, ulCmd)); 492 503 504 dprintf(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); 505 493 506 /* cleanup */ 494 507 RTMemTmpFree(pHdr); 495 508 } 496 dprintf(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));497 509 } 498 510 else
Note:
See TracChangeset
for help on using the changeset viewer.