Changeset 14352 in vbox for trunk/src/VBox/Additions/linux/module
- Timestamp:
- Nov 19, 2008 2:10:24 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions/linux/module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/cmc.c
r14304 r14352 31 31 { 32 32 VBoxDevice *dev = pvData; 33 wait_event (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE); 33 if (u32Data == RT_INDEFINITE_WAIT) 34 wait_event (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE); 35 else 36 wait_event_timeout (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE, 37 msecs_to_jiffies (u32Data)); 34 38 } 35 39 … … 38 42 { 39 43 VBoxDevice *dev = pvData; 40 wait_event_interruptible (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE); 41 } 42 43 static DECLVBGL(void) 44 vboxadd_hgcm_callback_timeout (VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data) 45 { 46 VBoxDevice *dev = pvData; 47 wait_event_interruptible_timeout (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE, 48 msecs_to_jiffies (u32Data)); 44 if (u32Data == RT_INDEFINITE_WAIT) 45 wait_event_interruptible (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE); 46 else 47 wait_event_interruptible_timeout (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE, 48 msecs_to_jiffies (u32Data)); 49 49 } 50 50 … … 56 56 if ( VBOXGUEST_IOCTL_STRIP_SIZE(func) 57 57 == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL(0))) 58 rc = VbglHGCMCall (data, vboxadd_hgcm_callback_interruptible, opaque, 0);58 rc = VbglHGCMCall (data, vboxadd_hgcm_callback_interruptible, opaque, RT_INDEFINITE_WAIT); 59 59 /* this function can handle cancelled requests */ 60 60 else if ( VBOXGUEST_IOCTL_STRIP_SIZE(func) 61 == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL_TIME OUT(0)))61 == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL_TIMED(0))) 62 62 { 63 VBoxGuestHGCMCallInfoTimeout *pCallInfo; 64 pCallInfo = (VBoxGuestHGCMCallInfoTimeout *) data; 65 rc = VbglHGCMCall (&pCallInfo->info, vboxadd_hgcm_callback_timeout, 66 opaque, pCallInfo->u32Timeout); 63 VBoxGuestHGCMCallInfoTimed *pCallInfo; 64 pCallInfo = (VBoxGuestHGCMCallInfoTimed *) data; 65 if (pCallInfo->fInterruptible) 66 rc = VbglHGCMCall (&pCallInfo->info, vboxadd_hgcm_callback_interruptible, 67 opaque, pCallInfo->u32Timeout); 68 else 69 rc = VbglHGCMCall (&pCallInfo->info, vboxadd_hgcm_callback, 70 opaque, pCallInfo->u32Timeout); 67 71 } 68 72 else switch (func) … … 70 74 /* this function can NOT handle cancelled requests */ 71 75 case VBOXGUEST_IOCTL_HGCM_CONNECT: 72 rc = VbglHGCMConnect (data, vboxadd_hgcm_callback, opaque, 0);76 rc = VbglHGCMConnect (data, vboxadd_hgcm_callback, opaque, RT_INDEFINITE_WAIT); 73 77 break; 74 78 75 79 /* this function can NOT handle cancelled requests */ 76 80 case VBOXGUEST_IOCTL_HGCM_DISCONNECT: 77 rc = VbglHGCMDisconnect (data, vboxadd_hgcm_callback, opaque, 0);81 rc = VbglHGCMDisconnect (data, vboxadd_hgcm_callback, opaque, RT_INDEFINITE_WAIT); 78 82 break; 79 83 -
trunk/src/VBox/Additions/linux/module/vboxmod.c
r14218 r14352 420 420 * @param u32Size the size of the userspace structure 421 421 */ 422 static int vboxadd_hgcm_call_time out(unsigned long userspace_info,422 static int vboxadd_hgcm_call_timed(unsigned long userspace_info, 423 423 uint32_t u32Size) 424 424 { 425 VBoxGuestHGCMCallInfoTime out*pInfo = NULL;425 VBoxGuestHGCMCallInfoTimed *pInfo = NULL; 426 426 int rc = 0; 427 427 … … 445 445 LogRelFunc(("client ID %u\n", pInfo->info.u32ClientID)); 446 446 vrc = vboxadd_cmc_call(vboxDev, 447 VBOXGUEST_IOCTL_HGCM_CALL_TIME OUT(u32Size), pInfo);447 VBOXGUEST_IOCTL_HGCM_CALL_TIMED(u32Size), pInfo); 448 448 rc = -RTErrConvertToErrno(vrc); 449 449 if ( rc >= 0 … … 624 624 IOCTL_EXIT("VBOXGUEST_IOCTL_HGCM_CALL", arg); 625 625 } 626 else if ( VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL_TIME OUT(0))626 else if ( VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL_TIMED(0)) 627 627 == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) 628 628 { 629 629 /* Do the HGCM call using the Vbgl bits */ 630 IOCTL_ENTRY("VBOXGUEST_IOCTL_HGCM_CALL_TIME OUT", arg);631 rc = vboxadd_hgcm_call_time out(arg, _IOC_SIZE(cmd));632 IOCTL_EXIT("VBOXGUEST_IOCTL_HGCM_CALL_TIME OUT", arg);630 IOCTL_ENTRY("VBOXGUEST_IOCTL_HGCM_CALL_TIMED", arg); 631 rc = vboxadd_hgcm_call_timed(arg, _IOC_SIZE(cmd)); 632 IOCTL_EXIT("VBOXGUEST_IOCTL_HGCM_CALL_TIMED", arg); 633 633 } 634 634 else
Note:
See TracChangeset
for help on using the changeset viewer.