Changeset 38768 in vbox
- Timestamp:
- Sep 15, 2011 8:48:19 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 74052
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
r38762 r38768 61 61 #endif 62 62 63 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)64 # define USE_WORKQUEUE65 #endif66 67 #ifdef USE_WORKQUEUE68 /* 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 # else72 typedef void *WQ_PARAM;73 # endif74 #else75 typedef unsigned long WQ_PARAM;76 #endif77 63 78 64 /******************************************************************************* … … 92 78 static unsigned int vboxguestPoll(struct file *pFile, poll_table *pPt); 93 79 static ssize_t vboxguestRead(struct file *pFile, char *pbBuf, size_t cbRead, loff_t *poff); 94 static void vboxguestReportMousePosition(WQ_PARAM unused);95 80 96 81 … … 114 99 /** Wait queue used by polling. */ 115 100 static wait_queue_head_t g_PollEventQueue; 116 #ifdef USE_WORKQUEUE117 /** The IRQ bottom half work queue for reporting the mouse position */118 static struct work_struct g_MouseEventWQ;119 #else120 DECLARE_TASKLET_DISABLED(g_MouseTasklet, vboxguestReportMousePosition, 0);121 #endif122 101 /** Asynchronous notification stuff. */ 123 102 static struct fasync_struct *g_pFAsyncQueue; … … 367 346 368 347 /** 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. 371 349 */ 372 350 static int __init vboxguestLinuxInitISR(void) … … 375 353 376 354 init_waitqueue_head(&g_PollEventQueue); 377 #ifdef USE_WORKQUEUE378 INIT_WORK(&g_MouseEventWQ, vboxguestReportMousePosition379 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)380 , NULL381 # endif382 );383 #else384 tasklet_enable(&g_MouseTasklet);385 tasklet_schedule(&g_MouseTasklet);386 #endif387 355 rc = request_irq(g_pPciDev->irq, 388 356 vboxguestLinuxISR, … … 965 933 966 934 967 void vboxguestReportMousePosition(WQ_PARAM unused)935 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt) 968 936 { 969 937 VMMDevReqMouseStatus *pReq; 970 938 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); 973 949 /* Report events to the kernel input device */ 974 950 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_GetMouseStatus); … … 986 962 VbglGRFree(&pReq->header); 987 963 } 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 has997 * 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);1003 964 Log(("VBoxGuestNativeISRMousePollEvent: done\n")); 1004 #ifdef USE_WORKQUEUE1005 schedule_work(&g_MouseEventWQ);1006 #else1007 tasklet_schedule(&g_MouseTasklet);1008 #endif1009 965 } 1010 966 … … 1122 1078 MODULE_VERSION(VBOX_VERSION_STRING); 1123 1079 #endif 1080
Note:
See TracChangeset
for help on using the changeset viewer.