VirtualBox

Changeset 9435 in vbox for trunk/include


Ignore:
Timestamp:
Jun 5, 2008 3:39:11 PM (17 years ago)
Author:
vboxsync
Message:

Extend HGCM interface to support 64 bit pointers.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r8155 r9435  
    9090} VBoxClipboardGetHostMsg;
    9191
     92#define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG 2
     93
    9294typedef struct _VBoxClipboardFormats
    9395{
     
    9799    HGCMFunctionParameter formats; /* OUT uint32_t */
    98100} VBoxClipboardFormats;
     101
     102#define VBOX_SHARED_CLIPBOARD_CPARMS_FORMATS 1
    99103
    100104typedef struct _VBoxClipboardReadData
     
    115119} VBoxClipboardReadData;
    116120
     121#define VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA 3
     122
    117123typedef struct _VBoxClipboardWriteData
    118124{
     
    125131    HGCMFunctionParameter ptr;    /* IN linear pointer. */
    126132} VBoxClipboardWriteData;
     133
     134#define VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA 2
     135
    127136#pragma pack ()
    128137
  • trunk/include/VBox/VBoxGuest.h

    r9215 r9435  
    163163    VMMDevReq_HGCMConnect                = 60,
    164164    VMMDevReq_HGCMDisconnect             = 61,
     165#ifdef VBOX_WITH_64_BITS_GUESTS
     166    VMMDevReq_HGCMCall32                 = 62,
     167    VMMDevReq_HGCMCall64                 = 63,
     168#else
    165169    VMMDevReq_HGCMCall                   = 62,
     170#endif /* VBOX_WITH_64_BITS_GUESTS */
    166171#endif
    167172    VMMDevReq_VideoAccelEnable           = 70,
     
    179184    VMMDevReq_SizeHack                   = 0x7fffffff
    180185} VMMDevRequestType;
     186
     187#ifdef VBOX_WITH_64_BITS_GUESTS
     188/*
     189 * Constants and structures are redefined for the guest.
     190 *
     191 * Host code MUST always use either *32 or *64 variant explicitely.
     192 * Host source code will use VBOX_HGCM_HOST_CODE define to catch undefined
     193 * data types and constants.
     194 *
     195 * This redefinition means that the new additions builds will use
     196 * the *64 or *32 variants depending on the current architecture bit count (ARCH_BITS).
     197 */
     198# ifndef VBOX_HGCM_HOST_CODE
     199#  if ARCH_BITS == 64
     200#   define VMMDevReq_HGCMCall VMMDevReq_HGCMCall64
     201#  elif ARCH_BITS == 32
     202#   define VMMDevReq_HGCMCall VMMDevReq_HGCMCall32
     203#  else
     204#   error "Unsupported ARCH_BITS"
     205#  endif
     206# endif /* !VBOX_HGCM_HOST_CODE */
     207#endif /* VBOX_WITH_64_BITS_GUESTS */
    181208
    182209/** Version of VMMDevRequestHeader structure. */
     
    662689} HGCMFunctionParameterType;
    663690
    664 typedef struct _HGCMFUNCTIONPARAMETER
     691#ifdef VBOX_WITH_64_BITS_GUESTS
     692typedef struct _HGCMFUNCTIONPARAMETER32
    665693{
    666694    HGCMFunctionParameterType type;
     
    680708        } Pointer;
    681709    } u;
     710} HGCMFunctionParameter32;
     711
     712typedef struct _HGCMFUNCTIONPARAMETER64
     713{
     714    HGCMFunctionParameterType type;
     715    union
     716    {
     717        uint32_t   value32;
     718        uint64_t   value64;
     719        struct
     720        {
     721            uint32_t size;
     722
     723            union
     724            {
     725                uint64_t physAddr;
     726                uint64_t linearAddr;
     727            } u;
     728        } Pointer;
     729    } u;
     730} HGCMFunctionParameter64;
     731#else
     732typedef struct _HGCMFUNCTIONPARAMETER
     733{
     734    HGCMFunctionParameterType type;
     735    union
     736    {
     737        uint32_t   value32;
     738        uint64_t   value64;
     739        struct
     740        {
     741            uint32_t size;
     742
     743            union
     744            {
     745                vmmDevHypPhys physAddr;
     746                vmmDevHypPtr  linearAddr;
     747            } u;
     748        } Pointer;
     749    } u;
    682750} HGCMFunctionParameter;
     751#endif /* VBOX_WITH_64_BITS_GUESTS */
     752
     753
     754#ifdef VBOX_WITH_64_BITS_GUESTS
     755/* Redefine the structure type for the guest code. */
     756# ifndef VBOX_HGCM_HOST_CODE
     757#  if ARCH_BITS == 64
     758#    define HGCMFunctionParameter HGCMFunctionParameter64
     759#  elif ARCH_BITS == 32
     760#    define HGCMFunctionParameter HGCMFunctionParameter32
     761#  else
     762#   error "Unsupported sizeof (void *)"
     763#  endif
     764# endif /* !VBOX_HGCM_HOST_CODE */
     765#endif /* VBOX_WITH_64_BITS_GUESTS */
    683766
    684767typedef struct
     
    697780#pragma pack()
    698781
    699 #define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((char *)a + sizeof (VMMDevHGCMCall)))
     782#define VMMDEV_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
     783
     784#ifdef VBOX_WITH_64_BITS_GUESTS
     785/* Explicit defines for the host code. */
     786# ifdef VBOX_HGCM_HOST_CODE
     787#  define VMMDEV_HGCM_CALL_PARMS32(a) ((HGCMFunctionParameter32 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
     788#  define VMMDEV_HGCM_CALL_PARMS64(a) ((HGCMFunctionParameter64 *)((uint8_t *)a + sizeof (VMMDevHGCMCall)))
     789# endif /* VBOX_HGCM_HOST_CODE */
     790#endif /* VBOX_WITH_64_BITS_GUESTS */
    700791
    701792#define VBOX_HGCM_MAX_PARMS 32
     
    12721363        case VMMDevReq_HGCMDisconnect:
    12731364            return sizeof(VMMDevHGCMDisconnect);
     1365#ifdef VBOX_WITH_64_BITS_GUESTS
     1366        case VMMDevReq_HGCMCall32:
     1367            return sizeof(VMMDevHGCMCall);
     1368        case VMMDevReq_HGCMCall64:
     1369            return sizeof(VMMDevHGCMCall);
     1370#else
    12741371        case VMMDevReq_HGCMCall:
    12751372            return sizeof(VMMDevHGCMCall);
    1276 #endif
     1373#endif /* VBOX_WITH_64_BITS_GUESTS */
     1374#endif /* VBOX_HGCM */
    12771375        case VMMDevReq_VideoAccelEnable:
    12781376            return sizeof(VMMDevVideoAccelEnable);
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