Changeset 57990 in vbox
- Timestamp:
- Oct 1, 2015 5:53:32 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r57949 r57990 479 479 # Enable the new async completion manager 480 480 VBOX_WITH_PDM_ASYNC_COMPLETION = 1 481 # Temporary switch for enabling / disabling the new USB code on Darwin.482 VBOX_WITH_NEW_USB_CODE_ON_DARWIN = 1483 481 ifdef VBOX_WITH_USB 484 482 VBOX_WITH_VUSB = 1 -
trunk/src/VBox/Devices/Makefile.kmk
r57989 r57990 69 69 if defined(VBOX_WITH_XHCI_IMPL) && !defined(VBOX_WITH_EXTPACK_PUEL) 70 70 VBoxDDU_DEFS += VBOX_WITH_XHCI_IMPL 71 endif72 ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN73 VBoxDDU_DEFS.darwin += VBOX_WITH_NEW_USB_CODE_ON_DARWIN74 71 endif 75 72 else … … 101 98 VBoxDDU_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDDU.dylib 102 99 ifdef VBOX_WITH_USB 103 ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN104 100 VBoxDDU_LDFLAGS.darwin += -framework IOKit 105 endif106 101 endif 107 102 … … 325 320 326 321 VBoxDD_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE 327 ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN328 VBoxDD_DEFS.darwin += VBOX_WITH_NEW_USB_CODE_ON_DARWIN329 endif330 322 VBoxDD_SOURCES.darwin += \ 331 323 USB/USBProxyDevice.cpp \ -
trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
r57358 r57990 1184 1184 } 1185 1185 1186 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN1187 1186 /* 1188 1187 * Call the USBLib init to make sure we're a valid VBoxUSB client. … … 1192 1191 if (RT_FAILURE(vrc)) 1193 1192 LogRel(("USB: USBLibInit failed - %Rrc\n", vrc)); 1194 #endif1195 1193 1196 1194 /* … … 1330 1328 } 1331 1329 1332 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN1333 1330 USBLibTerm(); 1334 #endif1335 1331 return vrc; 1336 1332 } … … 1379 1375 1380 1376 IOReturn irc = (*pDevOsX->ppDevI)->ResetDevice(pDevOsX->ppDevI); 1381 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN1382 if (irc == kIOReturnSuccess)1383 irc = (*pDevOsX->ppDevI)->USBDeviceReEnumerate(pDevOsX->ppDevI, 0);1384 #endif1385 1377 1386 1378 irc = (*pDevOsX->ppDevI)->USBDeviceClose(pDevOsX->ppDevI); … … 1409 1401 } 1410 1402 1411 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN1412 1403 USBLibTerm(); 1413 #endif1414 1404 LogFlow(("usbProxyDarwinClose: returns\n")); 1415 1405 } -
trunk/src/VBox/Devices/build/VBoxDDUDeps.cpp
r57358 r57990 44 44 (PFNRT)UsbOpen, 45 45 # endif 46 # if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) \ 47 || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) /* PORTME */ 46 # if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) /* PORTME */ 48 47 (PFNRT)USBLibInit, 49 48 # endif -
trunk/src/VBox/Main/include/USBProxyService.h
r53062 r57990 154 154 ~USBProxyServiceDarwin(); 155 155 156 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN157 156 virtual void *insertFilter(PCUSBFILTER aFilter); 158 157 virtual void removeFilter(void *aId); 159 #endif160 158 161 159 virtual int captureDevice(HostUSBDevice *aDevice); … … 183 181 * not including newly attached devices. */ 184 182 bool mWaitABitNextTime; 185 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN186 /** Whether we've got a fake async event and should return without entering the runloop. */187 bool volatile mFakeAsync;188 #endif189 183 /** Whether we've successfully initialized the USBLib and should call USBLibTerm in the destructor. */ 190 184 bool mUSBLibInitialized; -
trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
r57475 r57990 442 442 */ 443 443 LogFlowThisFunc(("{%s} capturing the device.\n", mName)); 444 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 445 || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) 444 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) /* PORTME */ 446 445 i_setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM, kHostUSBDeviceSubState_AwaitingDetach); 447 446 #else … … 705 704 * Try release it. 706 705 */ 707 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 708 || defined(RT_OS_WINDOWS) 706 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) /* PORTME */ 709 707 i_startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused, kHostUSBDeviceSubState_AwaitingDetach); 710 708 #else … … 759 757 * Do the job. 760 758 */ 761 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 762 || defined(RT_OS_WINDOWS) 759 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) /* PORTME */ 763 760 i_startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy, kHostUSBDeviceSubState_AwaitingDetach); 764 761 #else -
trunk/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp
r57358 r57990 53 53 HRESULT USBProxyServiceDarwin::init(void) 54 54 { 55 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN56 55 /* 57 56 * Initialize the USB library. … … 64 63 } 65 64 mUSBLibInitialized = true; 66 #endif67 65 68 66 /* … … 87 85 stop(); 88 86 89 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN90 87 /* 91 88 * Terminate the USB library - it'll … … 96 93 mUSBLibInitialized = false; 97 94 } 98 #endif 99 } 100 101 102 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 95 } 96 97 103 98 void *USBProxyServiceDarwin::insertFilter(PCUSBFILTER aFilter) 104 99 { … … 111 106 USBLibRemoveFilter(aId); 112 107 } 113 #endif /* VBOX_WITH_NEW_USB_CODE_ON_DARWIN */114 108 115 109 … … 127 121 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing); 128 122 129 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN130 /*131 * Fake it.132 */133 ASMAtomicWriteBool(&mFakeAsync, true);134 devLock.release();135 interruptWait();136 return VINF_SUCCESS;137 138 #else139 123 /* 140 124 * Create a one-shot capture filter for the device (don't … … 159 143 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId)); 160 144 return rc; 161 #endif162 145 } 163 146 … … 166 149 { 167 150 AssertReturnVoid(aDevice->isWriteLockOnCurrentThread()); 168 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 151 169 152 /* 170 153 * Remove the one-shot filter if necessary. … … 174 157 USBLibRemoveFilter(aDevice->mOneShotId); 175 158 aDevice->mOneShotId = NULL; 176 #endif177 159 } 178 160 … … 191 173 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost); 192 174 193 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN194 /*195 * Fake it.196 */197 ASMAtomicWriteBool(&mFakeAsync, true);198 devLock.release();199 interruptWait();200 return VINF_SUCCESS;201 202 #else203 175 /* 204 176 * Create a one-shot ignore filter for the device … … 225 197 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId)); 226 198 return rc; 227 #endif228 199 } 229 200 … … 232 203 { 233 204 AssertReturnVoid(aDevice->isWriteLockOnCurrentThread()); 234 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 205 235 206 /* 236 207 * Remove the one-shot filter if necessary. … … 240 211 USBLibRemoveFilter(aDevice->mOneShotId); 241 212 aDevice->mOneShotId = NULL; 242 #endif243 213 } 244 214 … … 247 217 void USBProxyServiceDarwin::detachingDevice(HostUSBDevice *aDevice) 248 218 { 249 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN250 aDevice->setLogicalReconnect(HostUSBDevice::kDetachingPendingDetach);251 #else252 219 NOREF(aDevice); 253 #endif254 220 } 255 221 … … 259 225 AssertReturn(aDevice, false); 260 226 AssertReturn(!aDevice->isWriteLockOnCurrentThread(), false); 261 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 262 /* We're faking async state stuff. */ 263 return updateDeviceStateFake(aDevice, aUSBDevice, aRunFilters, aIgnoreMachine); 264 #else 265 /* Nothing special here so far, so fall back on parent */ 227 /* Nothing special here so far, so fall back on parent. */ 266 228 return USBProxyService::updateDeviceState(aDevice, aUSBDevice, aRunFilters, aIgnoreMachine); 267 #endif268 229 } 269 230 … … 271 232 int USBProxyServiceDarwin::wait(RTMSINTERVAL aMillies) 272 233 { 273 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN274 if ( mFakeAsync275 && ASMAtomicXchgBool(&mFakeAsync, false))276 return VINF_SUCCESS;277 #endif278 279 234 SInt32 rc = CFRunLoopRunInMode(CFSTR(VBOX_IOKIT_MODE_STRING), 280 235 mWaitABitNextTime && aMillies >= 1000
Note:
See TracChangeset
for help on using the changeset viewer.