Changeset 58160 in vbox for trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
- Timestamp:
- Oct 9, 2015 6:02:55 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r58159 r58160 608 608 */ 609 609 AssertCompile(sizeof(pThis->guestInfo2.szName) == sizeof(pInfo2->szName)); 610 AssertReturn( memchr(pInfo2->szName, '\0', sizeof(pInfo2->szName)) != NULL, VERR_INVALID_PARAMETER);610 AssertReturn(RTStrEnd(pInfo2->szName, sizeof(pInfo2->szName)) != NULL, VERR_INVALID_PARAMETER); 611 611 const char *pszName = pInfo2->szName; 612 612 … … 670 670 671 671 /* Clear our IRQ in case it was high for whatever reason. */ 672 PDMDevHlpPCISetIrqNoWait 672 PDMDevHlpPCISetIrqNoWait(pThis->pDevIns, 0, 0); 673 673 674 674 return VINF_SUCCESS; … … 1050 1050 } 1051 1051 1052 bool fVisible = (pReq->fFlags & VBOX_MOUSE_POINTER_VISIBLE) != 0;1053 bool fAlpha = (pReq->fFlags & VBOX_MOUSE_POINTER_ALPHA) != 0;1054 bool fShape = (pReq->fFlags & VBOX_MOUSE_POINTER_SHAPE) != 0;1052 bool fVisible = RT_BOOL(pReq->fFlags & VBOX_MOUSE_POINTER_VISIBLE); 1053 bool fAlpha = RT_BOOL(pReq->fFlags & VBOX_MOUSE_POINTER_ALPHA); 1054 bool fShape = RT_BOOL(pReq->fFlags & VBOX_MOUSE_POINTER_SHAPE); 1055 1055 1056 1056 Log(("VMMDevReq_SetPointerShape: visible: %d, alpha: %d, shape = %d, width: %d, height: %d\n", … … 1104 1104 AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 1105 1105 1106 if (RT_UNLIKELY(pThis->fGetHostTimeDisabled)) 1107 return VERR_NOT_SUPPORTED; 1108 1109 RTTIMESPEC now; 1110 pReq->time = RTTimeSpecGetMilli(PDMDevHlpTMUtcNow(pThis->pDevIns, &now)); 1111 return VINF_SUCCESS; 1106 if (RT_LIKELY(!pThis->fGetHostTimeDisabled)) 1107 { 1108 RTTIMESPEC now; 1109 pReq->time = RTTimeSpecGetMilli(PDMDevHlpTMUtcNow(pThis->pDevIns, &now)); 1110 return VINF_SUCCESS; 1111 } 1112 return VERR_NOT_SUPPORTED; 1112 1113 } 1113 1114 … … 1154 1155 /* new reservation */ 1155 1156 rc = PGMR3MappingsFix(pVM, pReq->hypervisorStart, pReq->hypervisorSize); 1156 LogRel(("VMMDev: Guest reported fixed hypervisor window at 0%010x (size = %#x, rc = %Rrc)\n", pReq->hypervisorStart,1157 pReq->hypervisorS ize, rc));1157 LogRel(("VMMDev: Guest reported fixed hypervisor window at 0%010x LB %#x (rc=%Rrc)\n", 1158 pReq->hypervisorStart, pReq->hypervisorSize, rc)); 1158 1159 } 1159 1160 else if (RT_FAILURE(rc)) … … 1255 1256 /** 1256 1257 * @todo It looks like a multi-monitor guest which only uses 1257 * @a VMMDevReq_GetDisplayChangeRequest (not the *2 version) 1258 * will get into a @a VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST event 1259 * loop if it tries to acknowlege host requests for additional 1260 * monitors. Should the loop which checks for those requests 1261 * be removed? 1258 * @c VMMDevReq_GetDisplayChangeRequest (not the *2 version) will get 1259 * into a @c VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST event loop if it tries 1260 * to acknowlege host requests for additional monitors. Should the loop 1261 * which checks for those requests be removed? 1262 1262 */ 1263 1263 … … 1572 1572 AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 1573 1573 1574 if (VMMDEV_INTERFACE_VERSION_IS_1_03(pThis)) 1575 { 1576 vmmdevSetIRQ_Legacy(pThis); 1577 } 1578 else 1574 if (!VMMDEV_INTERFACE_VERSION_IS_1_03(pThis)) 1579 1575 { 1580 1576 if (pThis->fNewGuestFilterMask) … … 1590 1586 PDMDevHlpPCISetIrqNoWait(pThis->pDevIns, 0, 0); 1591 1587 } 1588 else 1589 vmmdevSetIRQ_Legacy(pThis); 1592 1590 return VINF_SUCCESS; 1593 1591 } … … 1630 1628 AssertMsgReturn(pReq->header.header.size >= sizeof(*pReq), ("%u\n", pReq->header.header.size), VERR_INVALID_PARAMETER); /** @todo Not sure why this is >= ... */ 1631 1629 1632 if ( !pThis->pHGCMDrv)1633 { 1634 Log(("VMMDevReq_HGCMConnect : HGCM Connector is NULL!\n"));1635 return VERR_NOT_SUPPORTED;1636 } 1637 1638 Log(("VMMDevReq_HGCMConnect \n"));1639 return vmmdevHGCMConnect(pThis, pReq, GCPhysReqHdr);1630 if (pThis->pHGCMDrv) 1631 { 1632 Log(("VMMDevReq_HGCMConnect\n")); 1633 return vmmdevHGCMConnect(pThis, pReq, GCPhysReqHdr); 1634 } 1635 1636 Log(("VMMDevReq_HGCMConnect: HGCM Connector is NULL!\n")); 1637 return VERR_NOT_SUPPORTED; 1640 1638 } 1641 1639 … … 1654 1652 AssertMsgReturn(pReq->header.header.size >= sizeof(*pReq), ("%u\n", pReq->header.header.size), VERR_INVALID_PARAMETER); /** @todo Not sure why this >= ... */ 1655 1653 1656 if ( !pThis->pHGCMDrv)1657 { 1658 Log(("VMMDevReq_VMMDevHGCMDisconnect : HGCM Connector is NULL!\n"));1659 return VERR_NOT_SUPPORTED;1660 } 1661 1662 Log(("VMMDevReq_VMMDevHGCMDisconnect \n"));1663 return vmmdevHGCMDisconnect(pThis, pReq, GCPhysReqHdr);1654 if (pThis->pHGCMDrv) 1655 { 1656 Log(("VMMDevReq_VMMDevHGCMDisconnect\n")); 1657 return vmmdevHGCMDisconnect(pThis, pReq, GCPhysReqHdr); 1658 } 1659 1660 Log(("VMMDevReq_VMMDevHGCMDisconnect: HGCM Connector is NULL!\n")); 1661 return VERR_NOT_SUPPORTED; 1664 1662 } 1665 1663 … … 1678 1676 AssertMsgReturn(pReq->header.header.size >= sizeof(*pReq), ("%u\n", pReq->header.header.size), VERR_INVALID_PARAMETER); 1679 1677 1680 if (!pThis->pHGCMDrv) 1681 { 1682 Log(("VMMDevReq_HGCMCall: HGCM Connector is NULL!\n")); 1683 return VERR_NOT_SUPPORTED; 1684 } 1685 1686 Log2(("VMMDevReq_HGCMCall: sizeof(VMMDevHGCMRequest) = %04X\n", sizeof(VMMDevHGCMCall))); 1687 Log2(("%.*Rhxd\n", pReq->header.header.size, pReq)); 1678 if (pThis->pHGCMDrv) 1679 { 1680 Log2(("VMMDevReq_HGCMCall: sizeof(VMMDevHGCMRequest) = %04X\n", sizeof(VMMDevHGCMCall))); 1681 Log2(("%.*Rhxd\n", pReq->header.header.size, pReq)); 1688 1682 1689 1683 #ifdef VBOX_WITH_64_BITS_GUESTS 1690 bool f64Bits = (pReq->header.header.requestType == VMMDevReq_HGCMCall64);1684 bool f64Bits = (pReq->header.header.requestType == VMMDevReq_HGCMCall64); 1691 1685 #else 1692 bool f64Bits = false;1686 bool f64Bits = false; 1693 1687 #endif /* VBOX_WITH_64_BITS_GUESTS */ 1694 1688 1695 return vmmdevHGCMCall(pThis, pReq, pReq->header.header.size, GCPhysReqHdr, f64Bits); 1689 return vmmdevHGCMCall(pThis, pReq, pReq->header.header.size, GCPhysReqHdr, f64Bits); 1690 } 1691 1692 Log(("VMMDevReq_HGCMCall: HGCM Connector is NULL!\n")); 1693 return VERR_NOT_SUPPORTED; 1696 1694 } 1697 1695 … … 1709 1707 AssertMsgReturn(pReq->header.header.size >= sizeof(*pReq), ("%u\n", pReq->header.header.size), VERR_INVALID_PARAMETER); /** @todo Not sure why this >= ... */ 1710 1708 1711 if ( !pThis->pHGCMDrv)1712 { 1713 Log(("VMMDevReq_VMMDevHGCMCancel : HGCM Connector is NULL!\n"));1714 return VERR_NOT_SUPPORTED;1715 } 1716 1717 Log(("VMMDevReq_VMMDevHGCMCancel \n"));1718 return vmmdevHGCMCancel(pThis, pReq, GCPhysReqHdr);1709 if (pThis->pHGCMDrv) 1710 { 1711 Log(("VMMDevReq_VMMDevHGCMCancel\n")); 1712 return vmmdevHGCMCancel(pThis, pReq, GCPhysReqHdr); 1713 } 1714 1715 Log(("VMMDevReq_VMMDevHGCMCancel: HGCM Connector is NULL!\n")); 1716 return VERR_NOT_SUPPORTED; 1719 1717 } 1720 1718 … … 1732 1730 AssertMsgReturn(pReq->header.size >= sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); /** @todo Not sure why this >= ... */ 1733 1731 1734 if ( !pThis->pHGCMDrv)1735 { 1736 Log(("VMMDevReq_HGCMC onnect2: HGCM Connector is NULL!\n"));1737 return VERR_NOT_SUPPORTED;1738 } 1739 1740 Log(("VMMDevReq_ VMMDevHGCMCancel\n"));1741 return vmmdevHGCMCancel2(pThis, pReq->physReqToCancel);1732 if (pThis->pHGCMDrv) 1733 { 1734 Log(("VMMDevReq_HGCMCancel2\n")); 1735 return vmmdevHGCMCancel2(pThis, pReq->physReqToCancel); 1736 } 1737 1738 Log(("VMMDevReq_HGCMConnect2: HGCM Connector is NULL!\n")); 1739 return VERR_NOT_SUPPORTED; 1742 1740 } 1743 1741 … … 1759 1757 if (!pThis->pDrv) 1760 1758 { 1761 Log(("VMMDevReq_VideoAccelEnable Connector is NULL!! !\n"));1759 Log(("VMMDevReq_VideoAccelEnable Connector is NULL!!\n")); 1762 1760 return VERR_NOT_SUPPORTED; 1763 1761 } … … 1765 1763 if (pReq->cbRingBuffer != VBVA_RING_BUFFER_SIZE) 1766 1764 { 1767 /* The guest driver seems compiled with anotherheaders. */1768 Log (("VMMDevReq_VideoAccelEnable guest ring buffer size %d, should be %d!!!\n", pReq->cbRingBuffer, VBVA_RING_BUFFER_SIZE));1765 /* The guest driver seems compiled with different headers. */ 1766 LogRelMax(16,("VMMDevReq_VideoAccelEnable guest ring buffer size %#x, should be %#x!!\n", pReq->cbRingBuffer, VBVA_RING_BUFFER_SIZE)); 1769 1767 return VERR_INVALID_PARAMETER; 1770 1768 } … … 2297 2295 ("%u cRegions=%u\n", pReq->header.size, pReq->cRegions), VERR_INVALID_PARAMETER); 2298 2296 2299 AssertReturn(memchr(pReq->szName, '\0', sizeof(pReq->szName)), VERR_INVALID_PARAMETER); 2300 AssertReturn(memchr(pReq->szVersion, '\0', sizeof(pReq->szVersion)), VERR_INVALID_PARAMETER); 2297 AssertReturn(RTStrEnd(pReq->szName, sizeof(pReq->szName)), VERR_INVALID_PARAMETER); 2298 AssertReturn(RTStrEnd(pReq->szVersion, sizeof(pReq->szVersion)), VERR_INVALID_PARAMETER); 2299 int rc = RTStrValidateEncoding(pReq->szName); 2300 AssertRCReturn(rc, rc); 2301 rc = RTStrValidateEncoding(pReq->szVersion); 2302 AssertRCReturn(rc, rc); 2301 2303 2302 2304 /* … … 2323 2325 ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 2324 2326 2325 AssertReturn(memchr(pReq->szName, '\0', sizeof(pReq->szName)), VERR_INVALID_PARAMETER); 2326 AssertReturn(memchr(pReq->szVersion, '\0', sizeof(pReq->szVersion)), VERR_INVALID_PARAMETER); 2327 AssertReturn(RTStrEnd(pReq->szName, sizeof(pReq->szName)), VERR_INVALID_PARAMETER); 2328 AssertReturn(RTStrEnd(pReq->szVersion, sizeof(pReq->szVersion)), VERR_INVALID_PARAMETER); 2329 int rc = RTStrValidateEncoding(pReq->szName); 2330 AssertRCReturn(rc, rc); 2331 rc = RTStrValidateEncoding(pReq->szVersion); 2332 AssertRCReturn(rc, rc); 2327 2333 2328 2334 /*
Note:
See TracChangeset
for help on using the changeset viewer.