Changeset 38759 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Sep 15, 2011 11:11:27 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74040
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
r38722 r38759 61 61 #endif 62 62 63 /* The definition of work queue functions changed in Linux 2.6.20. */ 64 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) 65 typedef struct work_struct *WQ_PARAM; 66 #else 67 typedef void *WQ_PARAM; 68 #endif 63 69 64 70 /******************************************************************************* … … 78 84 static unsigned int vboxguestPoll(struct file *pFile, poll_table *pPt); 79 85 static ssize_t vboxguestRead(struct file *pFile, char *pbBuf, size_t cbRead, loff_t *poff); 86 static void vboxguestReportMousePosition(WQ_PARAM unused); 80 87 81 88 … … 99 106 /** Wait queue used by polling. */ 100 107 static wait_queue_head_t g_PollEventQueue; 108 /** The IRQ bottom half work queue for reporting the mouse position */ 109 static struct work_struct g_MouseEventWQ; 101 110 /** Asynchronous notification stuff. */ 102 111 static struct fasync_struct *g_pFAsyncQueue; … … 346 355 347 356 /** 348 * Registers the ISR and initializes the poll wait queue. 357 * Registers the ISR and initializes the poll wait queue and the 358 * bottom half work-queue for mouse reporting. 349 359 */ 350 360 static int __init vboxguestLinuxInitISR(void) … … 353 363 354 364 init_waitqueue_head(&g_PollEventQueue); 365 INIT_WORK(&g_MouseEventWQ, vboxguestReportMousePosition 366 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) 367 , NULL 368 #endif 369 ); 355 370 rc = request_irq(g_pPciDev->irq, 356 371 vboxguestLinuxISR, … … 933 948 934 949 935 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt)950 void vboxguestReportMousePosition(WQ_PARAM unused) 936 951 { 937 952 VMMDevReqMouseStatus *pReq; 938 953 int rc; 954 955 NOREF(unused); 956 /* Report events to the kernel input device */ 957 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_GetMouseStatus); 958 if (RT_SUCCESS(rc)) 959 { 960 pReq->mouseFeatures = 0; 961 pReq->pointerXPos = 0; 962 pReq->pointerYPos = 0; 963 rc = VbglGRPerform(&pReq->header); 964 input_report_abs(g_pInputDevice, ABS_X, pReq->pointerXPos); 965 input_report_abs(g_pInputDevice, ABS_Y, pReq->pointerYPos); 966 #ifdef EV_SYN 967 input_sync(g_pInputDevice); 968 #endif 969 VbglGRFree(&pReq->header); 970 } 971 } 972 973 974 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt) 975 { 939 976 NOREF(pDevExt); 940 977 … … 947 984 Log(("VBoxGuestNativeISRMousePollEvent: kill_fasync\n")); 948 985 kill_fasync(&g_pFAsyncQueue, SIGIO, POLL_IN); 949 /* Report events to the kernel input device */950 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_GetMouseStatus);951 if (RT_SUCCESS(rc))952 {953 pReq->mouseFeatures = 0;954 pReq->pointerXPos = 0;955 pReq->pointerYPos = 0;956 rc = VbglGRPerform(&pReq->header);957 input_report_abs(g_pInputDevice, ABS_X, pReq->pointerXPos);958 input_report_abs(g_pInputDevice, ABS_Y, pReq->pointerYPos);959 #ifdef EV_SYN960 input_sync(g_pInputDevice);961 #endif962 VbglGRFree(&pReq->header);963 }964 986 Log(("VBoxGuestNativeISRMousePollEvent: done\n")); 987 schedule_work(&g_MouseEventWQ); 965 988 } 966 989
Note:
See TracChangeset
for help on using the changeset viewer.