VirtualBox

Changeset 15810 in vbox


Ignore:
Timestamp:
Jan 5, 2009 3:52:31 PM (16 years ago)
Author:
vboxsync
Message:

Use separate IO control codes for 32 bit and 64 bit requests in the guest driver.

File:
1 edited

Legend:

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

    r15706 r15810  
    12421242# define IOCTL_CODE(DeviceType, Function, Method, Access, DataSize_ignored) \
    12431243  ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
    1244 # define VBOXGUEST_IOCTL_CODE(Function, Size)   IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS, 0)
    1245 # define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       (Code)
     1244# define VBOXGUEST_IOCTL_CODE_(Function, Size)  IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS, 0)
     1245# define VBOXGUEST_IOCTL_STRIP_SIZE_(Code)      (Code)
    12461246
    12471247#elif defined(RT_OS_OS2)
    12481248  /* No automatic buffering, size not encoded. */
    12491249# define VBOXGUEST_IOCTL_CATEGORY               0xc2
    1250 # define VBOXGUEST_IOCTL_CODE(Function, Size)   ((unsigned char)(Function))
     1250# define VBOXGUEST_IOCTL_CODE_(Function, Size)  ((unsigned char)(Function))
    12511251# define VBOXGUEST_IOCTL_CATEGORY_FAST          0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
    1252 # define VBOXGUEST_IOCTL_CODE_FAST(Function)    ((unsigned char)(Function))
     1252# define VBOXGUEST_IOCTL_CODE_FAST_(Function)   ((unsigned char)(Function))
    12531253# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       (Code)
    12541254
     
    12561256  /* No automatic buffering, size limited to 255 bytes => use VBGLBIGREQ for everything. */
    12571257# include <sys/ioccom.h>
    1258 # define VBOXGUEST_IOCTL_CODE(Function, Size)   _IOWRN('V', (Function) | VBOXGUEST_IOCTL_FLAG, sizeof(VBGLBIGREQ))
    1259 # define VBOXGUEST_IOCTL_CODE_FAST(Function)    _IO(  'V', (Function) | VBOXGUEST_IOCTL_FLAG)
     1258# define VBOXGUEST_IOCTL_CODE_(Function, Size)  _IOWRN('V', (Function), sizeof(VBGLBIGREQ))
     1259# define VBOXGUEST_IOCTL_CODE_FAST_(Function)   _IO(  'V', (Function))
    12601260# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       (Code)
    12611261
     
    12631263  /* No automatic buffering, size limited to 16KB. */
    12641264# include <linux/ioctl.h>
    1265 # define VBOXGUEST_IOCTL_CODE(Function, Size)   _IOC(_IOC_READ|_IOC_WRITE, 'V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size))
    1266 # define VBOXGUEST_IOCTL_CODE_FAST(Function)    _IO(  'V', (Function) | VBOXGUEST_IOCTL_FLAG)
    1267 # define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       VBOXGUEST_IOCTL_CODE(_IOC_NR((Code)), 0)
     1265# define VBOXGUEST_IOCTL_CODE_(Function, Size)  _IOC(_IOC_READ|_IOC_WRITE, 'V', (Function), (Size))
     1266# define VBOXGUEST_IOCTL_CODE_FAST_(Function)   _IO(  'V', (Function))
     1267# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       VBOXGUEST_IOCTL_CODE_(_IOC_NR((Code)), 0)
    12681268
    12691269#elif defined(RT_OS_FREEBSD) /** @todo r=bird: Please do it like SUPDRVIOC to keep it as similar as possible. */
    12701270# include <sys/ioccom.h>
    12711271
    1272 # define VBOXGUEST_IOCTL_CODE(Function, Size)   _IOWR('V', (Function) | VBOXGUEST_IOCTL_FLAG, VBGLBIGREQ)
    1273 # define VBOXGUEST_IOCTL_CODE_FAST(Function)    _IO(  'V', (Function) | VBOXGUEST_IOCTL_FLAG)
     1272# define VBOXGUEST_IOCTL_CODE_(Function, Size)  _IOWR('V', (Function), VBGLBIGREQ)
     1273# define VBOXGUEST_IOCTL_CODE_FAST_(Function)   _IO(  'V', (Function))
    12741274# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)       IOCBASECMD(Code)
    12751275
     
    12771277/* PORTME */
    12781278#endif
     1279
     1280#define VBOXGUEST_IOCTL_CODE(Function, Size)     VBOXGUEST_IOCTL_CODE_((Function) | VBOXGUEST_IOCTL_FLAG, Size)
     1281#define VBOXGUEST_IOCTL_CODE_FAST(Function)      VBOXGUEST_IOCTL_CODE_FAST_((Function) | VBOXGUEST_IOCTL_FLAG)
     1282
     1283/* Define 32 bit codes to support 32 bit applications requests in the 64 bit guest driver. */
     1284#ifdef RT_ARCH_AMD64
     1285# define VBOXGUEST_IOCTL_CODE_32(Function, Size) VBOXGUEST_IOCTL_CODE_(Function, Size)
     1286# define VBOXGUEST_IOCTL_CODE_FAST_32(Function)  VBOXGUEST_IOCTL_CODE_FAST_(Function)
     1287#endif /* RT_ARCH_AMD64 */
    12791288
    12801289/** IOCTL to VBoxGuest to query the VMMDev IO port region start. */
     
    13871396# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size)    VBOXGUEST_IOCTL_CODE(20, (Size))
    13881397# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT        VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t))
    1389 
    1390 # ifdef VBOX_WITH_64_BITS_GUESTS
    1391 #  ifndef VBOX_HGCM_HOST_CODE
    1392 #     define  VBOXGUEST_IOCTL_HGCM_CALL_32(Size)   VBOXGUEST_IOCTL_CODE(18, (Size))
    1393 #  endif /* !VBOX_HGCM_HOST_CODE */
    1394 # endif /* VBOX_WITH_64_BITS_GUESTS */
     1398#ifdef RT_ARCH_AMD64
     1399/* Following HGCM IOCtls can be used by a 32 bit application on a 64 bit guest (Windows OpenGL guest driver). */
     1400# define VBOXGUEST_IOCTL_HGCM_CONNECT_32          VBOXGUEST_IOCTL_CODE_32(16, sizeof(VBoxGuestHGCMConnectInfo))
     1401# define VBOXGUEST_IOCTL_HGCM_DISCONNECT_32       VBOXGUEST_IOCTL_CODE_32(17, sizeof(VBoxGuestHGCMDisconnectInfo))
     1402# define VBOXGUEST_IOCTL_HGCM_CALL_32(Size)       VBOXGUEST_IOCTL_CODE_32(18, (Size))
     1403#endif /* RT_ARCH_AMD64 */
    13951404
    13961405# define VBOXGUEST_HGCM_CALL_PARMS(a)       ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo)))
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