Changeset 39289 in vbox for trunk/src/VBox/GuestHost/OpenGL/include
- Timestamp:
- Nov 14, 2011 10:04:24 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h
r35271 r39289 49 49 } CRNetworkPointer; 50 50 51 #ifdef DEBUG_misha 52 #define CRDBGPTR_SETZ(_p) crMemset((_p), 0, sizeof (CRNetworkPointer)) 53 #define CRDBGPTR_CHECKZ(_p) do { \ 54 CRNetworkPointer _ptr = {0}; \ 55 Assert(!crMemcmp((_p), &_ptr, sizeof (CRNetworkPointer))); \ 56 } while (0) 57 #define CRDBGPTR_CHECKNZ(_p) do { \ 58 CRNetworkPointer _ptr = {0}; \ 59 Assert(crMemcmp((_p), &_ptr, sizeof (CRNetworkPointer))); \ 60 } while (0) 61 # if 0 62 # define _CRDBGPTR_PRINT(_tStr, _id, _p) do { \ 63 crDebug(_tStr "%d:0x%08x%08x", (_id), (_p)->ptrAlign[1], (_p)->ptrAlign[0]); \ 64 } while (0) 65 # else 66 # define _CRDBGPTR_PRINT(_tStr, _id, _p) do { } while (0) 67 # endif 68 #define CRDBGPTR_PRINTWB(_id, _p) _CRDBGPTR_PRINT("wbptr:", _id, _p) 69 #define CRDBGPTR_PRINTRB(_id, _p) _CRDBGPTR_PRINT("rbptr:", _id, _p) 70 #else 71 #define CRDBGPTR_SETZ(_p) do { } while (0) 72 #define CRDBGPTR_CHECKZ(_p) do { } while (0) 73 #define CRDBGPTR_CHECKNZ(_p) do { } while (0) 74 #define CRDBGPTR_PRINTWB(_id, _p) do { } while (0) 75 #define CRDBGPTR_PRINTRB(_id, _p) do { } while (0) 76 #endif 77 78 #ifdef VBOX_WITH_CRHGSMI 79 typedef struct CRVBOXHGSMI_CMDDATA { 80 struct VBOXVDMACMD_CHROMIUM_CMD *pCmd; 81 int *pCmdRc; 82 char *pWriteback; 83 unsigned int *pcbWriteback; 84 unsigned int cbWriteback; 85 } CRVBOXHGSMI_CMDDATA, *PCRVBOXHGSMI_CMDDATA; 86 87 #ifdef DEBUG 88 # define CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData) do { \ 89 CRASSERT(!(_pData)->pCmd == !(_pData)->pCmdRc); \ 90 CRASSERT(!(_pData)->pWriteback == !(_pData)->pcbWriteback); \ 91 CRASSERT(!(_pData)->pWriteback == !(_pData)->cbWriteback); \ 92 if ((_pData)->pWriteback) \ 93 { \ 94 CRASSERT((_pData)->pCmd); \ 95 } \ 96 } while (0) 97 98 # define CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData) do { \ 99 CRASSERT(!(_pData)->pCmd); \ 100 CRASSERT(!(_pData)->pCmdRc); \ 101 CRASSERT(!(_pData)->pWriteback); \ 102 CRASSERT(!(_pData)->pcbWriteback); \ 103 CRASSERT(!(_pData)->cbWriteback); \ 104 } while (0) 105 106 # define CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData) do { \ 107 CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData); \ 108 CRASSERT(CRVBOXHGSMI_CMDDATA_IS_SET(_pData)); \ 109 } while (0) 110 111 # define CRVBOXHGSMI_CMDDATA_ASSERT_ISSETWB(_pData) do { \ 112 CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData); \ 113 CRASSERT(CRVBOXHGSMI_CMDDATA_IS_SETWB(_pData)); \ 114 } while (0) 115 #else 116 # define CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData) do { } while (0) 117 # define CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData) do { } while (0) 118 # define CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData) do { } while (0) 119 # define CRVBOXHGSMI_CMDDATA_ASSERT_ISSETWB(_pData) do { } while (0) 120 #endif 121 122 #define CRVBOXHGSMI_CMDDATA_IS_SET(_pData) (!!(_pData)->pCmd) 123 #define CRVBOXHGSMI_CMDDATA_IS_SETWB(_pData) (!!(_pData)->pWriteback) 124 125 #define CRVBOXHGSMI_CMDDATA_CLEANUP(_pData) do { \ 126 crMemset(_pData, 0, sizeof (CRVBOXHGSMI_CMDDATA)); \ 127 CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData); \ 128 CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData); \ 129 } while (0) 130 131 #define CRVBOXHGSMI_CMDDATA_SET(_pData, _pCmd, _pHdr) do { \ 132 CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData); \ 133 (_pData)->pCmd = (_pCmd); \ 134 (_pData)->pCmdRc = &(_pHdr)->result; \ 135 CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData); \ 136 } while (0) 137 138 #define CRVBOXHGSMI_CMDDATA_SETWB(_pData, _pCmd, _pHdr, _pWb, _cbWb, _pcbWb) do { \ 139 CRVBOXHGSMI_CMDDATA_SET(_pData, _pCmd, _pHdr); \ 140 (_pData)->pWriteback = (_pWb); \ 141 (_pData)->pcbWriteback = (_pcbWb); \ 142 (_pData)->cbWriteback = (_cbWb); \ 143 CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData); \ 144 } while (0) 145 146 #define CRVBOXHGSMI_CMDDATA_RC(_pData, _rc) do { \ 147 *(_pData)->pCmdRc = (_rc); \ 148 } while (0) 149 #endif 150 51 151 typedef struct { 52 152 CRMessageType type; … … 62 162 CRMessageHeader header; 63 163 CRMessageHeader* pMessage; 164 #ifdef VBOX_WITH_CRHGSMI 165 CRVBOXHGSMI_CMDDATA CmdData; 166 #endif 64 167 } CRMessageRedirPtr; 65 168
Note:
See TracChangeset
for help on using the changeset viewer.