VirtualBox

Changeset 21227 in vbox for trunk/include


Ignore:
Timestamp:
Jul 5, 2009 7:50:18 PM (16 years ago)
Author:
vboxsync
Message:

VBoxGuest.h/VMMDev.h/VBoxGuestLib.h usage cleanup.

Location:
trunk/include/VBox
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestPropertySvc.h

    r14352 r21227  
    3333
    3434#include <VBox/types.h>
    35 #include <VBox/VBoxGuest.h>
     35#include <VBox/VMMDev.h>
     36#include <VBox/VBoxGuest2.h>
    3637#include <VBox/hgcmsvc.h>
    3738#include <VBox/log.h>
  • trunk/include/VBox/HostServices/VBoxClipboardSvc.h

    r9435 r21227  
    3333
    3434#include <VBox/types.h>
    35 #include <VBox/VBoxGuest.h>
     35#include <VBox/VMMDev.h>
     36#include <VBox/VBoxGuest2.h>
    3637#include <VBox/hgcmsvc.h>
    3738
  • trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h

    r18637 r21227  
    3333
    3434#include <VBox/types.h>
    35 #include <VBox/VBoxGuest.h>
     35#include <VBox/VMMDev.h>
     36#include <VBox/VBoxGuest2.h>
    3637#include <VBox/hgcmsvc.h>
    3738
     
    102103     */
    103104    HGCMFunctionParameter   cbWriteback;
    104    
     105
    105106} CRVBOXHGCMWRITEREAD;
    106107
  • trunk/include/VBox/VBoxGuest.h

    r21226 r21227  
    3636#include <VBox/types.h>
    3737#include <iprt/assert.h>
     38#include <VBox/VMMDev2.h>
     39#include <VBox/VBoxGuest2.h>
     40#if 0
    3841#include <VBox/VMMDev.h> /* Temporarily. */
     42#endif
    3943
    4044
     
    209213
    210214#pragma pack(4)
    211 typedef struct _VBoxGuestPortInfo
     215typedef struct VBoxGuestPortInfo
    212216{
    213217    uint32_t portAddress;
    214     VMMDevMemory *pVMMDevMemory;
     218    struct VMMDevMemory *pVMMDevMemory;
    215219} VBoxGuestPortInfo;
    216220
     
    286290# define VBOXGUEST_IOCTL_HGCM_CONNECT               VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
    287291
    288 # pragma pack(1) /* explicit packing for good measure. */
    289 typedef struct VBoxGuestHGCMConnectInfo
    290 {
    291     int32_t result;           /**< OUT */
    292     HGCMServiceLocation Loc;  /**< IN */
    293     uint32_t u32ClientID;     /**< OUT */
    294 } VBoxGuestHGCMConnectInfo;
    295 AssertCompileSize(VBoxGuestHGCMConnectInfo, 4+4+128+4);
    296 # pragma pack()
    297 
    298 
    299292/** IOCTL to VBoxGuest to disconnect from a HGCM service. */
    300 # define VBOXGUEST_IOCTL_HGCM_DISCONNECT          VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
    301 typedef struct VBoxGuestHGCMDisconnectInfo
    302 {
    303     int32_t result;           /**< OUT */
    304     uint32_t u32ClientID;     /**< IN */
    305 } VBoxGuestHGCMDisconnectInfo;
    306 AssertCompileSize(VBoxGuestHGCMDisconnectInfo, 8);
    307 
    308 
    309 /** IOCTL to VBoxGuest to make a call to a HGCM service. */
    310 # define VBOXGUEST_IOCTL_HGCM_CALL(Size)          VBOXGUEST_IOCTL_CODE(18, (Size))
    311 typedef struct VBoxGuestHGCMCallInfo
    312 {
    313     int32_t result;           /**< OUT Host HGCM return code.*/
    314     uint32_t u32ClientID;     /**< IN  The id of the caller. */
    315     uint32_t u32Function;     /**< IN  Function number. */
    316     uint32_t cParms;          /**< IN  How many parms. */
    317     /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
    318 } VBoxGuestHGCMCallInfo;
    319 AssertCompileSize(VBoxGuestHGCMCallInfo, 16);
    320 
     293# define VBOXGUEST_IOCTL_HGCM_DISCONNECT            VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
     294
     295/** IOCTL to VBoxGuest to make a call to a HGCM service.
     296 * @see VBoxGuestHGCMCallInfo */
     297# define VBOXGUEST_IOCTL_HGCM_CALL(Size)            VBOXGUEST_IOCTL_CODE(18, (Size))
    321298
    322299/** IOCTL to VBoxGuest to make a timed call to a HGCM service. */
    323 # define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size)    VBOXGUEST_IOCTL_CODE(20, (Size))
    324 # pragma pack(1) /* explicit packing for good measure. */
    325 typedef struct VBoxGuestHGCMCallInfoTimed
    326 {
    327     uint32_t u32Timeout;         /**< IN  How long to wait for completion before cancelling the call. */
    328     uint32_t fInterruptible;     /**< IN  Is this request interruptible? */
    329     VBoxGuestHGCMCallInfo info;  /**< IN/OUT The rest of the call information.  Placed after the timeout
    330                                   * so that the parameters follow as they would for a normal call. */
    331     /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */
    332 } VBoxGuestHGCMCallInfoTimed;
    333 AssertCompileSize(VBoxGuestHGCMCallInfoTimed, 8+16);
    334 # pragma pack()
     300# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size)      VBOXGUEST_IOCTL_CODE(20, (Size))
    335301
    336302# ifdef RT_ARCH_AMD64
     
    431397
    432398
    433 #ifdef IN_RING3
     399#if 0 /*def IN_RING3*/
    434400# include <VBox/VBoxGuestLib.h> /** @todo eliminate this. */
    435401#endif /* IN_RING3 */
  • trunk/include/VBox/VBoxGuestLib.h

    r21211 r21227  
    3131#define ___VBox_VBoxGuestLib_h
    3232
     33#include <VBox/types.h>
     34#include <VBox/VMMDev2.h>
    3335#ifdef IN_RING0
    34 # include <VBox/VBoxGuest.h> /** @todo Try stop including <VBox/VBoxGuest.h> in ring-0. */
    35 # include <VBox/err.h>       /** @todo Why is this here?? */
     36# include <VBox/VMMDev.h>     /* grumble */
     37# include <VBox/VBoxGuest2.h>
    3638#endif
    37 #include <VBox/types.h>
    3839
    3940
     
    99100 * @return VBox status code.
    100101 */
    101 DECLVBGL(int) VbglInit (VBGLIOPORT portVMMDev, VMMDevMemory *pVMMDevMemory);
     102DECLVBGL(int) VbglInit (VBGLIOPORT portVMMDev, struct VMMDevMemory *pVMMDevMemory);
    102103
    103104# else
     
    392393 * @{ */
    393394VBGLR3DECL(int)     VbglR3SeamlessSetCap(bool fState);
    394 # ifdef VBOX_MOUSE_POINTER_SHAPE /** @todo Move common structures/enums out of VBoxGuest.h or/and the externalize the IOCtl interface... Whatever works, just try keep the amout of lowevel mess exposed here to a minimum. */
    395395VBGLR3DECL(int)     VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode);
    396 # endif
    397396VBGLR3DECL(int)     VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
    398397/** @}  */
     
    409408VBGLR3DECL(int)     VbglR3VideoAccelFlush(void);
    410409VBGLR3DECL(int)     VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg);
    411 # ifdef VBOX_MOUSE_POINTER_SHAPE /** @todo Move common structures/enums out of VBoxGuest.h or/and the externalize the IOCtl interface... Whatever works, just try keep the amout of lowevel mess exposed here to a minimum. */
    412 VBGLR3DECL(int)     VbglR3SetPointerShapeReq(VMMDevReqMousePointer *pReq);
    413 # endif
     410VBGLR3DECL(int)     VbglR3SetPointerShapeReq(struct VMMDevReqMousePointer *pReq);
    414411/** @}  */
    415412
  • trunk/include/VBox/VMMDev.h

    r21226 r21227  
    3636#include <VBox/err.h>
    3737#include <VBox/ostypes.h>
     38#include <VBox/VMMDev2.h>
    3839#include <iprt/assert.h>
    3940
     
    5051
    5152/** Size of VMMDev RAM region accessible by guest.
    52  *  Must be big enough to contain VMMDevMemory structure (see VBoxGuest.h)
    53  *  For now: 4 megabyte.
     53 * Must be big enough to contain VMMDevMemory structure (see further down).
     54 * For now: 4 megabyte.
    5455 */
    5556#define VMMDEV_RAM_SIZE                                     (4 * 256 * PAGE_SIZE)
     
    200201    /** IN: Size of the structure in bytes (including body). */
    201202    uint32_t size;
    202     /** IN: Version of the structure.*/
     203    /** IN: Version of the structure.  */
    203204    uint32_t version;
    204205    /** IN: Type of the request. */
     
    259260 * Used by VMMDevReq_SetPointerShape. The size is variable.
    260261 */
    261 typedef struct
     262typedef struct VMMDevReqMousePointer
    262263{
    263264    /** Header. */
     
    740741
    741742/**
    742  * Seamless mode.
    743  *
    744  * Used by VbglR3SeamlessWaitEvent
    745  *
    746  * @todo DARN! DARN! DARN! Who forgot to do the 32-bit hack here???
    747  *       FIXME! XXX!
    748  *
    749  *       We will now have to carefully check how our compilers have treated this
    750  *       flag. If any are compressing it into a byte type, we'll have to check
    751  *       how the request memory is initialized. If we are 104% sure it's ok to
    752  *       expand it, we'll expand it. If not, we must redefine the field to a
    753  *       uint8_t and a 3 byte padding.
    754  *  */
    755 typedef enum
    756 {
    757     VMMDev_Seamless_Disabled         = 0,     /**< normal mode; entire guest desktop displayed. */
    758     VMMDev_Seamless_Visible_Region   = 1,     /**< visible region mode; only top-level guest windows displayed. */
    759     VMMDev_Seamless_Host_Window      = 2      /**< windowed mode; each top-level guest window is represented in a host window. */
    760 } VMMDevSeamlessMode;
    761 
    762 /**
    763743 * Seamless mode change request structure.
    764744 *
     
    954934#pragma pack()
    955935
    956 /**
    957  * VBVA command header.
    958  */
    959 #pragma pack(1) /* unnecessary */
    960 typedef struct _VBVACMDHDR
    961 {
    962    /** Coordinates of affected rectangle. */
    963    int16_t x;
    964    int16_t y;
    965    uint16_t w;
    966    uint16_t h;
    967 } VBVACMDHDR;
    968 #pragma pack()
    969 
    970 /** @name VBVA ring defines.
    971  *
    972  * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
    973  * data. For example big bitmaps which do not fit to the buffer.
    974  *
    975  * Guest starts writing to the buffer by initializing a record entry in the
    976  * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
    977  * written. As data is written to the ring buffer, the guest increases off32End
    978  * for the record.
    979  *
    980  * The host reads the aRecords on flushes and processes all completed records.
    981  * When host encounters situation when only a partial record presents and
    982  * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
    983  * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
    984  * off32Head. After that on each flush the host continues fetching the data
    985  * until the record is completed.
    986  *
    987  */
    988 #define VBVA_RING_BUFFER_SIZE        (_4M - _1K)
    989 #define VBVA_RING_BUFFER_THRESHOLD   (4 * _1K)
    990 
    991 #define VBVA_MAX_RECORDS (64)
    992 
    993 #define VBVA_F_MODE_ENABLED         (0x00000001)
    994 #define VBVA_F_MODE_VRDP            (0x00000002)
    995 #define VBVA_F_MODE_VRDP_RESET      (0x00000004)
    996 #define VBVA_F_MODE_VRDP_ORDER_MASK (0x00000008)
    997 
    998 #define VBVA_F_RECORD_PARTIAL       (0x80000000)
    999 /** @} */
    1000 
    1001 typedef struct
    1002 {
    1003     /** The length of the record. Changed by guest. */
    1004     uint32_t cbRecord;
    1005 } VBVARECORD;
    1006 AssertCompileSize(VBVARECORD, 4);
    1007 
    1008 /**
    1009  * VBVA memory layout.
    1010  */
    1011 #pragma pack(1) /* paranoia */
    1012 typedef struct VBVAMEMORY
    1013 {
    1014     /** VBVA_F_MODE_*. */
    1015     uint32_t fu32ModeFlags;
    1016 
    1017     /** The offset where the data start in the buffer. */
    1018     uint32_t off32Data;
    1019     /** The offset where next data must be placed in the buffer. */
    1020     uint32_t off32Free;
    1021 
    1022     /** The ring buffer for data. */
    1023     uint8_t  au8RingBuffer[VBVA_RING_BUFFER_SIZE];
    1024 
    1025     /** The queue of record descriptions. */
    1026     VBVARECORD aRecords[VBVA_MAX_RECORDS];
    1027     uint32_t indexRecordFirst;
    1028     uint32_t indexRecordFree;
    1029 
    1030     /** RDP orders supported by the client. The guest reports only them
    1031      * and falls back to DIRTY rects for not supported ones.
    1032      *
    1033      * (1 << VBVA_VRDP_*)
    1034      */
    1035     uint32_t fu32SupportedOrders;
    1036 
    1037 } VBVAMEMORY;
    1038 #pragma pack()
    1039 AssertCompileSize(VBVAMEMORY, 12 + (_4M-_1K) + 4*64 + 12);
    1040 
    1041 
    1042936
    1043937#ifdef VBOX_WITH_HGCM
     
    1067961} VMMDevHGCMRequestHeader;
    1068962AssertCompileSize(VMMDevHGCMRequestHeader, 24+8);
    1069 
    1070 /**
    1071  * HGCM service location types.
    1072  */
    1073 typedef enum
    1074 {
    1075     VMMDevHGCMLoc_Invalid    = 0,
    1076     VMMDevHGCMLoc_LocalHost  = 1,
    1077     VMMDevHGCMLoc_LocalHost_Existing = 2,
    1078     VMMDevHGCMLoc_SizeHack   = 0x7fffffff
    1079 } HGCMServiceLocationType;
    1080 AssertCompileSize(HGCMServiceLocationType, 4);
    1081 
    1082 /**
    1083  * HGCM host service location.
    1084  */
    1085 typedef struct
    1086 {
    1087     char achName[128]; /**< This is really szName. */
    1088 } HGCMServiceLocationHost;
    1089 AssertCompileSize(HGCMServiceLocationHost, 128);
    1090 
    1091 /**
    1092  * HGCM service location.
    1093  */
    1094 typedef struct HGCMSERVICELOCATION
    1095 {
    1096     /** Type of the location. */
    1097     HGCMServiceLocationType type;
    1098 
    1099     union
    1100     {
    1101         HGCMServiceLocationHost host;
    1102     } u;
    1103 } HGCMServiceLocation;
    1104 AssertCompileSize(HGCMServiceLocation, 128+4);
    1105963
    1106964/**
     
    15411399
    15421400/**
     1401 * VBVA command header.
     1402 *
     1403 * @todo Where does this fit in?
     1404 */
     1405#pragma pack(1) /* unnecessary */
     1406typedef struct VBVACMDHDR
     1407{
     1408   /** Coordinates of affected rectangle. */
     1409   int16_t x;
     1410   int16_t y;
     1411   uint16_t w;
     1412   uint16_t h;
     1413} VBVACMDHDR;
     1414#pragma pack()
     1415
     1416/** @name VBVA ring defines.
     1417 *
     1418 * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
     1419 * data. For example big bitmaps which do not fit to the buffer.
     1420 *
     1421 * Guest starts writing to the buffer by initializing a record entry in the
     1422 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
     1423 * written. As data is written to the ring buffer, the guest increases off32End
     1424 * for the record.
     1425 *
     1426 * The host reads the aRecords on flushes and processes all completed records.
     1427 * When host encounters situation when only a partial record presents and
     1428 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
     1429 * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
     1430 * off32Head. After that on each flush the host continues fetching the data
     1431 * until the record is completed.
     1432 *
     1433 */
     1434#define VBVA_RING_BUFFER_SIZE        (_4M - _1K)
     1435#define VBVA_RING_BUFFER_THRESHOLD   (4 * _1K)
     1436
     1437#define VBVA_MAX_RECORDS (64)
     1438
     1439#define VBVA_F_MODE_ENABLED         (0x00000001)
     1440#define VBVA_F_MODE_VRDP            (0x00000002)
     1441#define VBVA_F_MODE_VRDP_RESET      (0x00000004)
     1442#define VBVA_F_MODE_VRDP_ORDER_MASK (0x00000008)
     1443
     1444#define VBVA_F_RECORD_PARTIAL       (0x80000000)
     1445/** @} */
     1446
     1447/**
     1448 * VBVA record.
     1449 */
     1450typedef struct
     1451{
     1452    /** The length of the record. Changed by guest. */
     1453    uint32_t cbRecord;
     1454} VBVARECORD;
     1455AssertCompileSize(VBVARECORD, 4);
     1456
     1457
     1458/**
     1459 * VBVA memory layout.
     1460 *
     1461 * This is a subsection of the VMMDevMemory structure.
     1462 */
     1463#pragma pack(1) /* paranoia */
     1464typedef struct VBVAMEMORY
     1465{
     1466    /** VBVA_F_MODE_*. */
     1467    uint32_t fu32ModeFlags;
     1468
     1469    /** The offset where the data start in the buffer. */
     1470    uint32_t off32Data;
     1471    /** The offset where next data must be placed in the buffer. */
     1472    uint32_t off32Free;
     1473
     1474    /** The ring buffer for data. */
     1475    uint8_t  au8RingBuffer[VBVA_RING_BUFFER_SIZE];
     1476
     1477    /** The queue of record descriptions. */
     1478    VBVARECORD aRecords[VBVA_MAX_RECORDS];
     1479    uint32_t indexRecordFirst;
     1480    uint32_t indexRecordFree;
     1481
     1482    /** RDP orders supported by the client. The guest reports only them
     1483     * and falls back to DIRTY rects for not supported ones.
     1484     *
     1485     * (1 << VBVA_VRDP_*)
     1486     */
     1487    uint32_t fu32SupportedOrders;
     1488
     1489} VBVAMEMORY;
     1490#pragma pack()
     1491AssertCompileSize(VBVAMEMORY, 12 + (_4M-_1K) + 4*64 + 12);
     1492
     1493
     1494/**
    15431495 * The layout of VMMDEV RAM region that contains information for guest.
    15441496 */
    15451497#pragma pack(1) /* paranoia */
    1546 typedef struct
    1547 {
    1548     /** size */
     1498typedef struct VMMDevMemory
     1499{
     1500    /** The size of this structure. */
    15491501    uint32_t u32Size;
    1550     /** version */
     1502    /** The structure version. (VMMDEV_MEMORY_VERSION) */
    15511503    uint32_t u32Version;
    15521504
    1553     union {
    1554         /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
    1555         struct {
     1505    union
     1506    {
     1507        struct
     1508        {
     1509            /** Flag telling that VMMDev set the IRQ and acknowlegment is required */
    15561510            bool fHaveEvents;
    15571511        } V1_04;
    15581512
    1559         struct {
     1513        struct
     1514        {
    15601515            /** Pending events flags, set by host. */
    15611516            uint32_t u32HostEvents;
  • trunk/include/VBox/shflsvc.h

    r21217 r21227  
    3232
    3333#include <VBox/types.h>
    34 #include <VBox/VBoxGuest.h>
     34#include <VBox/VBoxGuest2.h>
     35#include <VBox/VMMDev.h>
    3536#include <VBox/hgcmsvc.h>
    3637#include <iprt/fs.h>
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