Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

VBoxGuest.h File Reference


Detailed Description

VBoxGuest - VirtualBox Guest Additions Driver Interface. (ADD,DEV)

Remarks:
This is in the process of being split up and usage cleaned up.

Definition in file VBoxGuest.h.

#include <VBox/cdefs.h>
#include <VBox/types.h>
#include <iprt/assert.h>
#include <VBox/VMMDev2.h>
#include <VBox/VBoxGuest2.h>

Go to the source code of this file.

Classes

struct  VBGLBIGREQ
struct  VBoxGuestFilterMaskInfo
struct  VBoxGuestPortInfo
struct  VBoxGuestWaitEventInfo

VBoxGuest IOCTL codes and structures.

The range 0..15 is for basic driver communication. The range 16..31 is for HGCM communcation. The range 32..47 is reserved for future use. The range 48..63 is for OS specific communcation. The 7th bit is reserved for future hacks. The 8th bit is reserved for distinguishing between 32-bit and 64-bit processes in future 64-bit guest additions.

Remarks:
When creating new IOCtl interfaces keep in mind that not all OSes supports reporting back the output size. (This got messed up a little bit in VBoxDrv.)
The request size is also a little bit tricky as it's passed as part of the request code on unix. The size field is 14 bits on Linux, 12 bits on *BSD, 13 bits Darwin, and 8-bits on Solaris. All the BSDs and Darwin kernels will make use of the size field, while Linux and Solaris will not. We're of course using the size to validate and/or map/lock the request, so it has to be valid.

For Solaris we will have to do something special though, 255 isn't sufficent for all we need. A 4KB restriction (BSD) is probably not too problematic (yet) as a general one.

More info can be found in SUPDRVIOC.h and related sources.

Remarks:
If adding interfaces that only has input or only has output, some new macros needs to be created so the most efficient IOCtl data buffering method can be used.


#define VBGLBIGREQ_MAGIC   0x19520219
#define VBOXGUEST_IOCTL_CODE(Function, Size)   VBOXGUEST_IOCTL_CODE_((Function) | VBOXGUEST_IOCTL_FLAG, Size)
#define VBOXGUEST_IOCTL_CODE_FAST(Function)   VBOXGUEST_IOCTL_CODE_FAST_((Function) | VBOXGUEST_IOCTL_FLAG)
#define VBOXGUEST_IOCTL_GETVMMDEVPORT   VBOXGUEST_IOCTL_CODE(1, sizeof(VBoxGuestPortInfo))
#define VBOXGUEST_IOCTL_WAITEVENT   VBOXGUEST_IOCTL_CODE_(2, sizeof(VBoxGuestWaitEventInfo))
typedef const VBGLBIGREQPCVBGLBIGREQ
typedef VBGLBIGREQPVBGLBIGREQ

Defines

#define VBOXGUEST_DEVICE_NAME   "/dev/vboxguest"
#define VBOXGUEST_HYPERVISOR_PHYSICAL_START   UINT32_C(0xf8000000)
#define VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS   VBOXGUEST_IOCTL_CODE_(5, 0)
#define VBOXGUEST_IOCTL_CTL_CHECK_BALLOON_MASK   VBOXGUEST_IOCTL_CODE_(7, 100)
#define VBOXGUEST_IOCTL_CTL_FILTER_MASK   VBOXGUEST_IOCTL_CODE_(4, sizeof(VBoxGuestFilterMaskInfo))
#define VBOXGUEST_IOCTL_LOG(Size)   VBOXGUEST_IOCTL_CODE_(6, (Size))
#define VBOXGUEST_IOCTL_VMMREQUEST(Size)   VBOXGUEST_IOCTL_CODE_(3, (Size))
#define VBOXGUEST_USER_DEVICE_NAME   VBOXGUEST_DEVICE_NAME
Result codes for VBoxGuestWaitEventInfo::u32Result
#define VBOXGUEST_WAITEVENT_ERROR   (3)
#define VBOXGUEST_WAITEVENT_INTERRUPTED   (2)
#define VBOXGUEST_WAITEVENT_OK   (0)
#define VBOXGUEST_WAITEVENT_TIMEOUT   (1)

Functions

 AssertCompileSize (VBoxGuestFilterMaskInfo, 8)
 AssertCompileSize (VBoxGuestWaitEventInfo, 16)


Generated by  Doxygen 1.6.0   Back to index