VirtualBox

Changeset 37859 in vbox


Ignore:
Timestamp:
Jul 11, 2011 8:48:24 AM (13 years ago)
Author:
vboxsync
Message:

Committed usb_thread.patch with tiny adjustments.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmusb.h

    r37822 r37859  
    630630
    631631    /**
     632     * Creates a PDM thread.
     633     *
     634     * This differs from the RTThreadCreate() API in that PDM takes care of suspending,
     635     * resuming, and destroying the thread as the VM state changes.
     636     *
     637     * @returns VBox status code.
     638     * @param   pDevIns             The device instance.
     639     * @param   ppThread            Where to store the thread 'handle'.
     640     * @param   pvUser              The user argument to the thread function.
     641     * @param   pfnThread           The thread function.
     642     * @param   pfnWakeup           The wakup callback. This is called on the EMT
     643     *                              thread when a state change is pending.
     644     * @param   cbStack             See RTThreadCreate.
     645     * @param   enmType             See RTThreadCreate.
     646     * @param   pszName             See RTThreadCreate.
     647     */
     648    DECLR3CALLBACKMEMBER(int, pfnThreadCreate,(PPDMUSBINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
     649                                               PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName));
     650
     651    /**
    632652     * Set up asynchronous handling of a suspend, reset or power off notification.
    633653     *
     
    662682
    663683/** Current USBHLP version number. */
    664 #define PDM_USBHLP_VERSION                      PDM_VERSION_MAKE(0xeefe, 1, 0)
     684#define PDM_USBHLP_VERSION                      PDM_VERSION_MAKE(0xeefe, 2, 0)
    665685
    666686#endif /* IN_RING3 */
     
    842862
    843863/**
     864 * @copydoc PDMUSBHLP::pfnThreadCreate
     865 */
     866DECLINLINE(int) PDMUsbHlpThreadCreate(PPDMUSBINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
     867                                         PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
     868{
     869    return pUsbIns->pHlpR3->pfnThreadCreate(pUsbIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
     870}
     871
     872
     873/**
    844874 * @copydoc PDMUSBHLP::pfnSetAsyncNotification
    845875 */
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r37358 r37859  
    13671367
    13681368
     1369/** @interface_method_impl{PDMUSBHLP,pfnThreadCreate} */
     1370static DECLCALLBACK(int) pdmR3UsbHlp_ThreadCreate(PPDMUSBINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
     1371                                                  PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
     1372{
     1373    PDMDEV_ASSERT_DEVINS(pUsbIns);
     1374    VM_ASSERT_EMT(pUsbIns->Internal.s.pVM);
     1375    LogFlow(("pdmR3UsbHlp_ThreadCreate: caller='%s'/%d: ppThread=%p pvUser=%p pfnThread=%p pfnWakeup=%p cbStack=%#zx enmType=%d pszName=%p:{%s}\n",
     1376             pUsbIns->pReg->szName, pUsbIns->iInstance, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName, pszName));
     1377
     1378    int rc = pdmR3ThreadCreateUsb(pUsbIns->Internal.s.pVM, pUsbIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
     1379
     1380    LogFlow(("pdmR3UsbHlp_ThreadCreate: caller='%s'/%d: returns %Rrc *ppThread=%RTthrd\n", pUsbIns->pReg->szName, pUsbIns->iInstance,
     1381             rc, *ppThread));
     1382    return rc;
     1383}
     1384
     1385
    13691386/** @interface_method_impl{PDMUSBHLP,pfnSetAsyncNotification} */
    13701387static DECLCALLBACK(int) pdmR3UsbHlp_SetAsyncNotification(PPDMUSBINS pUsbIns, PFNPDMUSBASYNCNOTIFY pfnAsyncNotify)
     
    14391456    pdmR3UsbHlp_VMSetRuntimeErrorV,
    14401457    pdmR3UsbHlp_VMState,
     1458    pdmR3UsbHlp_ThreadCreate,
    14411459    pdmR3UsbHlp_SetAsyncNotification,
    14421460    pdmR3UsbHlp_AsyncNotificationCompleted,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette