Changeset 34972 in vbox
- Timestamp:
- Dec 12, 2010 2:54:20 AM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r34321 r34972 1595 1595 } 1596 1596 1597 case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_SEM_CREATE):1598 {1599 /* validate */1600 PSUPSEMCREATE pReq = (PSUPSEMCREATE)pReqHdr;1601 REQ_CHECK_SIZES_EX(SUP_IOCTL_SEM_CREATE, SUP_IOCTL_SEM_CREATE_SIZE_IN, SUP_IOCTL_SEM_CREATE_SIZE_OUT);1602 1603 /* execute */1604 switch (pReq->u.In.uType)1605 {1606 case SUP_SEM_TYPE_EVENT:1607 {1608 SUPSEMEVENT hEvent;1609 pReq->Hdr.rc = SUPSemEventCreate(pSession, &hEvent);1610 pReq->u.Out.hSem = (uint32_t)(uintptr_t)hEvent;1611 break;1612 }1613 1614 case SUP_SEM_TYPE_EVENT_MULTI:1615 {1616 SUPSEMEVENTMULTI hEventMulti;1617 pReq->Hdr.rc = SUPSemEventMultiCreate(pSession, &hEventMulti);1618 pReq->u.Out.hSem = (uint32_t)(uintptr_t)hEventMulti;1619 break;1620 }1621 1622 default:1623 pReq->Hdr.rc = VERR_INVALID_PARAMETER;1624 break;1625 }1626 VBOXDRV_SUPDRV_IOCTL_RETURN(pSession, uIOCtl, pReqHdr, VINF_SUCCESS, pReq->Hdr.rc);1627 return 0;1628 }1629 1630 case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_SEM_OP):1631 {1632 /* validate */1633 PSUPSEMOP pReq = (PSUPSEMOP)pReqHdr;1634 REQ_CHECK_SIZES_EX(SUP_IOCTL_SEM_OP, SUP_IOCTL_SEM_OP_SIZE_IN, SUP_IOCTL_SEM_OP_SIZE_OUT);1635 1636 /* execute */1637 switch (pReq->u.In.uType)1638 {1639 case SUP_SEM_TYPE_EVENT:1640 {1641 SUPSEMEVENT hEvent = (SUPSEMEVENT)(uintptr_t)pReq->u.In.hSem;1642 switch (pReq->u.In.uOp)1643 {1644 case SUPSEMOP_WAIT:1645 pReq->Hdr.rc = SUPSemEventWaitNoResume(pSession, hEvent, pReq->u.In.cMillies);1646 break;1647 case SUPSEMOP_SIGNAL:1648 pReq->Hdr.rc = SUPSemEventSignal(pSession, hEvent);1649 break;1650 case SUPSEMOP_CLOSE:1651 pReq->Hdr.rc = SUPSemEventClose(pSession, hEvent);1652 break;1653 case SUPSEMOP_RESET:1654 default:1655 pReq->Hdr.rc = VERR_INVALID_FUNCTION;1656 break;1657 }1658 break;1659 }1660 1661 case SUP_SEM_TYPE_EVENT_MULTI:1662 {1663 SUPSEMEVENTMULTI hEventMulti = (SUPSEMEVENTMULTI)(uintptr_t)pReq->u.In.hSem;1664 switch (pReq->u.In.uOp)1665 {1666 case SUPSEMOP_WAIT:1667 pReq->Hdr.rc = SUPSemEventMultiWaitNoResume(pSession, hEventMulti, pReq->u.In.cMillies);1668 break;1669 case SUPSEMOP_SIGNAL:1670 pReq->Hdr.rc = SUPSemEventMultiSignal(pSession, hEventMulti);1671 break;1672 case SUPSEMOP_CLOSE:1673 pReq->Hdr.rc = SUPSemEventMultiClose(pSession, hEventMulti);1674 break;1675 case SUPSEMOP_RESET:1676 pReq->Hdr.rc = SUPSemEventMultiReset(pSession, hEventMulti);1677 break;1678 default:1679 pReq->Hdr.rc = VERR_INVALID_FUNCTION;1680 break;1681 }1682 break;1683 }1684 1685 default:1686 pReq->Hdr.rc = VERR_INVALID_PARAMETER;1687 break;1688 }1689 VBOXDRV_SUPDRV_IOCTL_RETURN(pSession, uIOCtl, pReqHdr, VINF_SUCCESS, pReq->Hdr.rc);1690 return 0;1691 }1692 1693 1597 case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_SEM_OP2): 1694 1598 { -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r33540 r34972 191 191 * 192 192 * @todo Pending work on next major version change: 193 * - Remove SUPSEMOP and SUPSEMCREATE.194 */ 195 #define SUPDRV_IOC_VERSION 0x001 50004193 * - None. 194 */ 195 #define SUPDRV_IOC_VERSION 0x00160000 196 196 197 197 /** SUP_IOCTL_COOKIE. */ … … 295 295 /** Image file name. 296 296 * This can be used to load the image using a native loader. */ 297 char szFilename[ 196];297 char szFilename[260]; 298 298 } In; 299 299 struct … … 1017 1017 1018 1018 1019 /** @name SUP_IOCTL_SEM_CREATE1020 * Create a semaphore1021 * @todo remove this interface with the next major version change.1022 * @{1023 */1024 #define SUP_IOCTL_SEM_CREATE SUP_CTL_CODE_SIZE(24, SUP_IOCTL_SEM_CREATE_SIZE)1025 #define SUP_IOCTL_SEM_CREATE_SIZE sizeof(SUPSEMCREATE)1026 #define SUP_IOCTL_SEM_CREATE_SIZE_IN sizeof(SUPSEMCREATE)1027 #define SUP_IOCTL_SEM_CREATE_SIZE_OUT sizeof(SUPSEMCREATE)1028 typedef struct SUPSEMCREATE1029 {1030 /** The header. */1031 SUPREQHDR Hdr;1032 union1033 {1034 struct1035 {1036 /** The semaphore type. */1037 uint32_t uType;1038 } In;1039 struct1040 {1041 /** The handle of the created semaphore. */1042 uint32_t hSem;1043 } Out;1044 } u;1045 } SUPSEMCREATE, *PSUPSEMCREATE;1046 1047 /** @} */1048 1049 1050 /** @name SUP_IOCTL_SEM_OP1051 * Semaphore operations.1052 * @todo remove this interface with the next major version change.1053 * @{1054 */1055 #define SUP_IOCTL_SEM_OP SUP_CTL_CODE_SIZE(25, SUP_IOCTL_SEM_OP_SIZE)1056 #define SUP_IOCTL_SEM_OP_SIZE sizeof(SUPSEMOP)1057 #define SUP_IOCTL_SEM_OP_SIZE_IN sizeof(SUPSEMOP)1058 #define SUP_IOCTL_SEM_OP_SIZE_OUT sizeof(SUPREQHDR)1059 typedef struct SUPSEMOP1060 {1061 /** The header. */1062 SUPREQHDR Hdr;1063 union1064 {1065 struct1066 {1067 /** The semaphore type. */1068 uint32_t uType;1069 /** The semaphore handle. */1070 uint32_t hSem;1071 /** The operation. */1072 uint32_t uOp;1073 /** The number of milliseconds to wait if it's a wait operation. */1074 uint32_t cMillies;1075 } In;1076 } u;1077 } SUPSEMOP, *PSUPSEMOP;1078 1079 /** Wait for a number of milliseconds. */1080 #define SUPSEMOP_WAIT 01081 /** Signal the semaphore. */1082 #define SUPSEMOP_SIGNAL 11083 /** Reset the semaphore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */1084 #define SUPSEMOP_RESET 21085 /** Close the semaphore handle. */1086 #define SUPSEMOP_CLOSE 31087 1088 /** @} */1089 1090 1019 /** @name SUP_IOCTL_SEM_OP2 1091 1020 * Semaphore operations. … … 1093 1022 * @{ 1094 1023 */ 1095 #define SUP_IOCTL_SEM_OP2 SUP_CTL_CODE_SIZE(2 7, SUP_IOCTL_SEM_OP2_SIZE)1024 #define SUP_IOCTL_SEM_OP2 SUP_CTL_CODE_SIZE(24, SUP_IOCTL_SEM_OP2_SIZE) 1096 1025 #define SUP_IOCTL_SEM_OP2_SIZE sizeof(SUPSEMOP2) 1097 1026 #define SUP_IOCTL_SEM_OP2_SIZE_IN sizeof(SUPSEMOP2) … … 1151 1080 * @{ 1152 1081 */ 1153 #define SUP_IOCTL_SEM_OP3 SUP_CTL_CODE_SIZE(2 8, SUP_IOCTL_SEM_OP3_SIZE)1082 #define SUP_IOCTL_SEM_OP3 SUP_CTL_CODE_SIZE(25, SUP_IOCTL_SEM_OP3_SIZE) 1154 1083 #define SUP_IOCTL_SEM_OP3_SIZE sizeof(SUPSEMOP3) 1155 1084 #define SUP_IOCTL_SEM_OP3_SIZE_IN sizeof(SUPSEMOP3) -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r34959 r34972 268 268 strcpy(CookieReq.u.In.szMagic, SUPCOOKIE_MAGIC); 269 269 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 270 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00150000271 ? 0x001 50004272 : SUPDRV_IOC_VERSION & 0xffff0000;270 const uint32_t uMinVersion = /*(SUPDRV_IOC_VERSION & 0xffff0000) == 0x00160000 271 ? 0x00160000 272 :*/ SUPDRV_IOC_VERSION & 0xffff0000; 273 273 CookieReq.u.In.u32MinVersion = uMinVersion; 274 274 rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_COOKIE, &CookieReq, SUP_IOCTL_COOKIE_SIZE);
Note:
See TracChangeset
for help on using the changeset viewer.