Changeset 6978 in vbox
- Timestamp:
- Feb 18, 2008 7:55:14 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuest.h
r6849 r6978 993 993 # define VBOXGUEST_IOCTL_CODE(Function, Size) _IOC(_IOC_READ|_IOC_WRITE, 'V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size)) 994 994 # define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG) 995 # define VBOXGUEST_IOCTL_STRIP_SIZE(Function) ((Function) - _IOC_SIZE((Function))) 996 997 /** @todo r=bird: Please remove. See discussion in xTracker and elsewhere; VBOXGUEST_IOCTL_STRIP_SIZE is all we need here and it must be defined everywhere. */ 998 # define VBOXGUEST_IOCTL_NUMBER(Code) (_IOC_NR((Code)) & ~VBOXGUEST_IOCTL_FLAG) 995 # define VBOXGUEST_IOCTL_STRIP_SIZE(Code) VBOXGUEST_IOCTL_CODE(_IOC_NR((Code)), 0) 999 996 # define VBOXGUEST_IOCTL_SIZE(Code) (_IOC_SIZE((Code))) 1000 997 -
trunk/src/VBox/Additions/linux/module/vboxmod.c
r6948 r6978 355 355 356 356 /* Deal with variable size ioctls first. */ 357 if (VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_LOG(0)) == VBOXGUEST_IOCTL_NUMBER(cmd)) { 357 if ( VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_LOG(0)) 358 == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) { 358 359 char *pszMessage = kmalloc(VBOXGUEST_IOCTL_SIZE(cmd), GFP_KERNEL); 359 360 if (NULL == pszMessage) { … … 376 377 } 377 378 378 if ( VBOXGUEST_IOCTL_ NUMBER(VBOXGUEST_IOCTL_VMMREQUEST(0))379 == VBOXGUEST_IOCTL_ NUMBER(cmd)) {379 if ( VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_VMMREQUEST(0)) 380 == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) { 380 381 VMMDevRequestHeader reqHeader; 381 382 VMMDevRequestHeader *reqFull = NULL; … … 453 454 VbglGRFree(reqFull); 454 455 return rc; 456 } 457 458 if ( VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL(0)) 459 == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) { 460 /* This IOCTL allows the guest to make an HGCM call from user space. The 461 OS-independant part of the Guest Additions already contain code for making an 462 HGCM call from the guest, but this code assumes that the call is made from the 463 kernel's address space. So before calling it, we have to copy all parameters 464 to the HGCM call from user space to kernel space and reconstruct the structures 465 passed to the call (which include pointers to other memory) inside the kernel's 466 address space. */ 467 return vbox_ioctl_hgcm_call(arg, vboxDev); 455 468 } 456 469
Note:
See TracChangeset
for help on using the changeset viewer.