VirtualBox

Changeset 38768 in vbox


Ignore:
Timestamp:
Sep 15, 2011 8:48:19 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74052
Message:

Additions/common/VBoxGuest-linux: reverted r74040 and r74044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c

    r38762 r38768  
    6161#endif
    6262
    63 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
    64 # define USE_WORKQUEUE
    65 #endif
    66 
    67 #ifdef USE_WORKQUEUE
    68 /* The definition of work queue functions changed in Linux 2.6.20. */
    69 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
    70 typedef struct work_struct *WQ_PARAM;
    71 # else
    72 typedef void *WQ_PARAM;
    73 # endif
    74 #else
    75 typedef unsigned long WQ_PARAM;
    76 #endif
    7763
    7864/*******************************************************************************
     
    9278static unsigned int vboxguestPoll(struct file *pFile, poll_table *pPt);
    9379static ssize_t vboxguestRead(struct file *pFile, char *pbBuf, size_t cbRead, loff_t *poff);
    94 static void vboxguestReportMousePosition(WQ_PARAM unused);
    9580
    9681
     
    11499/** Wait queue used by polling. */
    115100static wait_queue_head_t        g_PollEventQueue;
    116 #ifdef USE_WORKQUEUE
    117 /** The IRQ bottom half work queue for reporting the mouse position */
    118 static struct work_struct       g_MouseEventWQ;
    119 #else
    120 DECLARE_TASKLET_DISABLED(g_MouseTasklet, vboxguestReportMousePosition, 0);
    121 #endif
    122101/** Asynchronous notification stuff.  */
    123102static struct fasync_struct    *g_pFAsyncQueue;
     
    367346
    368347/**
    369  * Registers the ISR and initializes the poll wait queue and the
    370  * bottom half work-queue for mouse reporting.
     348 * Registers the ISR and initializes the poll wait queue.
    371349 */
    372350static int __init vboxguestLinuxInitISR(void)
     
    375353
    376354    init_waitqueue_head(&g_PollEventQueue);
    377 #ifdef USE_WORKQUEUE
    378     INIT_WORK(&g_MouseEventWQ, vboxguestReportMousePosition
    379 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
    380               , NULL
    381 # endif
    382               );
    383 #else
    384     tasklet_enable(&g_MouseTasklet);
    385     tasklet_schedule(&g_MouseTasklet);
    386 #endif
    387355    rc = request_irq(g_pPciDev->irq,
    388356                     vboxguestLinuxISR,
     
    965933
    966934
    967 void vboxguestReportMousePosition(WQ_PARAM unused)
     935void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt)
    968936{
    969937    VMMDevReqMouseStatus *pReq;
    970938    int rc;
    971 
    972     NOREF(unused);
     939    NOREF(pDevExt);
     940
     941    /*
     942     * Wake up everyone that's in a poll() and post anyone that has
     943     * subscribed to async notifications.
     944     */
     945    Log(("VBoxGuestNativeISRMousePollEvent: wake_up_all\n"));
     946    wake_up_all(&g_PollEventQueue);
     947    Log(("VBoxGuestNativeISRMousePollEvent: kill_fasync\n"));
     948    kill_fasync(&g_pFAsyncQueue, SIGIO, POLL_IN);
    973949    /* Report events to the kernel input device */
    974950    rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_GetMouseStatus);
     
    986962        VbglGRFree(&pReq->header);
    987963    }
    988 }
    989 
    990 
    991 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt)
    992 {
    993     NOREF(pDevExt);
    994 
    995     /*
    996      * Wake up everyone that's in a poll() and post anyone that has
    997      * subscribed to async notifications.
    998      */
    999     Log(("VBoxGuestNativeISRMousePollEvent: wake_up_all\n"));
    1000     wake_up_all(&g_PollEventQueue);
    1001     Log(("VBoxGuestNativeISRMousePollEvent: kill_fasync\n"));
    1002     kill_fasync(&g_pFAsyncQueue, SIGIO, POLL_IN);
    1003964    Log(("VBoxGuestNativeISRMousePollEvent: done\n"));
    1004 #ifdef USE_WORKQUEUE
    1005     schedule_work(&g_MouseEventWQ);
    1006 #else
    1007     tasklet_schedule(&g_MouseTasklet);
    1008 #endif
    1009965}
    1010966
     
    11221078MODULE_VERSION(VBOX_VERSION_STRING);
    11231079#endif
     1080
Note: See TracChangeset for help on using the changeset viewer.

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