Changeset 5887 in vbox for trunk/include/VBox
- Timestamp:
- Nov 30, 2007 11:44:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuest.h
r5819 r5887 1097 1097 * the way), I've introduced a VBOXGUEST_IOCTL_CODE for defining generic IN/OUT 1098 1098 * IOCtls on new ports of the additions. 1099 * 1100 * @remark 1099 * 1100 * @remarks When creating new IOCtl interfaces keep in mind that not all OSes supports 1101 1101 * reporting back the output size. (This got messed up a little bit in VBoxDrv.) 1102 1102 * 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. 1106 1109 * 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 1113 1117 * needs to be created so the most efficient IOCtl data buffering method can be 1114 1118 * used. 1115 *1116 * @remark On Linux (at least), things are not as grim as portrayed above. The IOCtl1117 * 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 are1119 * completely ignored by the system. In fact, the oldest IOCtls still in use today1120 * predate the current numbering system, and several of the ones implemented since1121 * then implement it wrongly. See 'man ioctl_list' for more information.1122 * -Michael1123 *1124 1119 * @{ 1125 1120 */ … … 1145 1140 /* Note that we can't use the Linux header IOCtl macros directly, as they expect a "type" 1146 1141 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. */ 1147 1143 /* VBOXGUEST_IOCTL_CODE(Function, sizeof(type)) == _IOWR('V', (Function) | VBOXGUEST_IOCTL_FLAG, (type)) */ 1148 1144 # 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.