VirtualBox

Changeset 5887 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Nov 30, 2007 11:44:21 AM (17 years ago)
Author:
vboxsync
Message:

r=bird: Removed incorrect remarks, updated the others with the recent VBoxDrv experience. Added a todo on _IOC/linux.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r5819 r5887  
    10971097 * the way), I've introduced a VBOXGUEST_IOCTL_CODE for defining generic IN/OUT
    10981098 * IOCtls on new ports of the additions.
    1099  * 
    1100  * @remark  When creating new IOCtl interfaces keep in mind that not all OSes supports
     1099 *
     1100 * @remarks When creating new IOCtl interfaces keep in mind that not all OSes supports
    11011101 *          reporting back the output size. (This got messed up a little bit in VBoxDrv.)
    11021102 *
    1103  *          OS/2 restricts the in/out data size to 64KB, while Linux, BSD and Darwin are
    1104  *          limited by a 14 bits size field (16KB). So, special considerations need to
    1105  *          be taken if more input/output needs to be passed around.
     1103 *          The request size is also a little bit tricky as it's passed as part of the
     1104 *          request code on unix. The size field is 14 bits on Linux, 12 bits on *BSD,
     1105 *          13 bits Darwin, and 8-bits on Solaris. All the BSDs and Darwin kernels
     1106 *          will make use of the size field, while Linux and Solaris will not. We're of
     1107 *          course using the size to validate and/or map/lock the request, so it has
     1108 *          to be valid.
    11061109 *
    1107  *          When passing variable sized input/output special care need to be taken on
    1108  *          Unix platforms (if we're going to play by the rules) since the size is
    1109  *          passed as part of the IOCtl code there. IIRC Darwin will use the size to
    1110  *          perform locking and in/out copying, I don't quite know about linux and *BSD.
    1111  *         
    1112  * @remark  If adding interfaces that only has input or only has output, some new macros
     1110 *          For Solaris we will have to do something special though, 255 isn't
     1111 *          sufficent for all we need. A 4KB restriction (BSD) is probably not
     1112 *          too problematic (yet) as a general one.
     1113 *
     1114 *          More info can be found in SUPDRVIOC.h and related sources.
     1115 *
     1116 * @remarks If adding interfaces that only has input or only has output, some new macros
    11131117 *          needs to be created so the most efficient IOCtl data buffering method can be
    11141118 *          used.
    1115  *
    1116  * @remark  On Linux (at least), things are not as grim as portrayed above.  The IOCtl
    1117  *          numbering system is pure convention designed in order to simplify error checking.
    1118  *          The numbers only have meaning to the driver which implements the IOCtl, and are
    1119  *          completely ignored by the system.  In fact, the oldest IOCtls still in use today
    1120  *          predate the current numbering system, and several of the ones implemented since
    1121  *          then implement it wrongly.  See 'man ioctl_list' for more information.
    1122  *            -Michael
    1123  *
    11241119 * @{
    11251120 */
     
    11451140/* Note that we can't use the Linux header IOCtl macros directly, as they expect a "type"
    11461141   argument, whereas we provide "sizeof(type)". */
     1142/** @todo r=bird: That's not true. You can use _IOC just like SUPDRVIOC.h does (include linux/ioctl.h). That should work back to 2.0.x. */
    11471143/* VBOXGUEST_IOCTL_CODE(Function, sizeof(type)) == _IOWR('V', (Function) | VBOXGUEST_IOCTL_FLAG, (type)) */
    11481144# define VBOXGUEST_IOCTL_CODE(Function, Size)   ( (3 << 30) | ('V' << 8) | (Function) | VBOXGUEST_IOCTL_FLAG | (Size << 16) )
Note: See TracChangeset for help on using the changeset viewer.

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