Changeset 28320 in vbox for trunk/include
- Timestamp:
- Apr 14, 2010 6:26:24 PM (15 years ago)
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmifs.h
r28264 r28320 118 118 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \ 119 119 { \ 120 InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \120 P##InterfaceType pReturnInterfaceTypeCheck = (pInterface); \ 121 121 return pReturnInterfaceTypeCheck; \ 122 122 } \ … … 159 159 * @returns PDMIBASERC::pfnQueryInterface return value. 160 160 * 161 * @param pIBaseRC Pointer to the base ring-0 interface. 162 * @param InterfaceType The interface type name. The interface ID is 163 * derived from this by appending _IID. 161 * @param pIBaseRC Pointer to the base raw-mode context interface. Can 162 * be NULL. 163 * @param InterfaceType The interface type base name, no trailing RC. The 164 * interface ID is derived from this by appending _IID. 164 165 * 165 166 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any … … 167 168 */ 168 169 #define PDMIBASERC_QUERY_INTERFACE(pIBaseRC, InterfaceType) \ 169 ( ( InterfaceType *)(pIBaseRC)->pfnQueryInterface(pIBaseRC, InterfaceType##_IID) )170 ( (P##InterfaceType##RC)((pIBaseRC) ? (pIBaseRC)->pfnQueryInterface(pIBaseRC, InterfaceType##_IID) : NIL_RTRCPTR) ) 170 171 171 172 /** … … 177 178 * @param pIns Pointer to the instance data. 178 179 * @param pszIID The ID of the interface that is being queried. 179 * @param InterfaceType The interface type name. The interface ID is180 * derived from this by appending _IID.180 * @param InterfaceType The interface type base name, no trailing RC. The 181 * interface ID is derived from this by appending _IID. 181 182 * @param pInterface The interface address expression. This must resolve 182 183 * to some address within the instance data. 184 * @remarks Don't use with PDMIBASE. 183 185 */ 184 186 #define PDMIBASERC_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \ … … 187 189 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \ 188 190 { \ 189 InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \191 InterfaceType##RC *pReturnInterfaceTypeCheck = (pInterface); \ 190 192 return (uintptr_t)pReturnInterfaceTypeCheck \ 191 193 - PDMINS_2_DATA(pIns, uintptr_t) \ … … 229 231 * @returns PDMIBASER0::pfnQueryInterface return value. 230 232 * 231 * @param pIBaseR0 Pointer to the base ring-0 interface. 232 * @param InterfaceType The interface type name. The interface ID is233 * derived from this by appending _IID.233 * @param pIBaseR0 Pointer to the base ring-0 interface. Can be NULL. 234 * @param InterfaceType The interface type base name, no trailing R0. The 235 * interface ID is derived from this by appending _IID. 234 236 * 235 237 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any … … 237 239 */ 238 240 #define PDMIBASER0_QUERY_INTERFACE(pIBaseR0, InterfaceType) \ 239 ( ( InterfaceType *)(pIBaseR0)->pfnQueryInterface(pIBaseR0, InterfaceType##_IID) )241 ( (P##InterfaceType##R0)((pIBaseR0) ? (pIBaseR0)->pfnQueryInterface(pIBaseR0, InterfaceType##_IID) : NIL_RTR0PTR) ) 240 242 241 243 /** … … 247 249 * @param pIns Pointer to the instance data. 248 250 * @param pszIID The ID of the interface that is being queried. 249 * @param InterfaceType The interface type name. The interface ID is250 * derived from this by appending _IID.251 * @param InterfaceType The interface type base name, no trailing R0. The 252 * interface ID is derived from this by appending _IID. 251 253 * @param pInterface The interface address expression. This must resolve 252 254 * to some address within the instance data. 255 * @remarks Don't use with PDMIBASE. 253 256 */ 254 257 #define PDMIBASER0_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \ … … 257 260 if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \ 258 261 { \ 259 InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \262 InterfaceType##R0 *pReturnInterfaceTypeCheck = (pInterface); \ 260 263 return (uintptr_t)pReturnInterfaceTypeCheck \ 261 264 - PDMINS_2_DATA(pIns, uintptr_t) \ … … 1507 1510 */ 1508 1511 DECLR3CALLBACKMEMBER(int, pfnNotifyStatusLinesChanged,(PPDMICHARPORT pInterface, uint32_t fNewStatusLines)); 1509 1512 1510 1513 /** 1511 1514 * Notify the device when the driver buffer is full. -
trunk/include/VBox/pdmnetifs.h
r28276 r28320 177 177 178 178 /** Pointer to a network connector interface */ 179 typedef struct PDMINETWORKUP *PPDMINETWORKUP; 179 typedef R3PTRTYPE(struct PDMINETWORKUP *) PPDMINETWORKUPR3; 180 /** Pointer to a network connector interface, ring-0 context. */ 181 typedef R0PTRTYPE(struct PDMINETWORKUPR0 *) PPDMINETWORKUPR0; 182 /** Pointer to a network connector interface, raw-mode context. */ 183 typedef RCPTRTYPE(struct PDMINETWORKUPRC *) PPDMINETWORKUPRC; 184 /** Pointer to a current context network connector interface. */ 185 typedef CTX_SUFF(PPDMINETWORKUP) PPDMINETWORKUP; 186 180 187 /** 181 188 * Network connector interface (up). … … 307 314 308 315 } PDMINETWORKUP; 316 317 /** Ring-0 edition of PDMINETWORKUP. */ 318 typedef struct PDMINETWORKUPR0 319 { 320 /** @copydoc PDMINETWORKUP::pfnBeginXmit */ 321 DECLR0CALLBACKMEMBER(int, pfnBeginXmit,(PPDMINETWORKUPR0 pInterface, bool fOnWorkerThread)); 322 /** @copydoc PDMINETWORKUP::pfnAllocBuf */ 323 DECLR0CALLBACKMEMBER(int, pfnAllocBuf,(PPDMINETWORKUPR0 pInterface, size_t cbMin, PCPDMNETWORKGSO pGso, 324 PPPDMSCATTERGATHER ppSgBuf)); 325 /** @copydoc PDMINETWORKUP::pfnFreeBuf */ 326 DECLR0CALLBACKMEMBER(int, pfnFreeBuf,(PPDMINETWORKUPR0 pInterface, PPDMSCATTERGATHER pSgBuf)); 327 /** @copydoc PDMINETWORKUP::pfnSendBuf */ 328 DECLR0CALLBACKMEMBER(int, pfnSendBuf,(PPDMINETWORKUPR0 pInterface, PPDMSCATTERGATHER pSgBuf, bool fOnWorkerThread)); 329 /** @copydoc PDMINETWORKUP::pfnEndBuf */ 330 DECLR0CALLBACKMEMBER(void, pfnEndXmit,(PPDMINETWORKUPR0 pInterface)); 331 /** @copydoc PDMINETWORKUP::pfnSetPromiscuousMode */ 332 DECLR0CALLBACKMEMBER(void, pfnSetPromiscuousMode,(PPDMINETWORKUPR0 pInterface, bool fPromiscuous)); 333 } PDMINETWORKUPR0; 334 335 /** Raw-mode context edition of PDMINETWORKUP. */ 336 typedef struct PDMINETWORKUPRC 337 { 338 /** @copydoc PDMINETWORKUP::pfnBeginXmit */ 339 DECLRCCALLBACKMEMBER(int, pfnBeginXmit,(PPDMINETWORKUPRC pInterface, bool fOnWorkerThread)); 340 /** @copydoc PDMINETWORKUP::pfnAllocBuf */ 341 DECLRCCALLBACKMEMBER(int, pfnAllocBuf,(PPDMINETWORKUPRC pInterface, size_t cbMin, PCPDMNETWORKGSO pGso, 342 PPPDMSCATTERGATHER ppSgBuf)); 343 /** @copydoc PDMINETWORKUP::pfnFreeBuf */ 344 DECLRCCALLBACKMEMBER(int, pfnFreeBuf,(PPDMINETWORKUPRC pInterface, PPDMSCATTERGATHER pSgBuf)); 345 /** @copydoc PDMINETWORKUP::pfnSendBuf */ 346 DECLRCCALLBACKMEMBER(int, pfnSendBuf,(PPDMINETWORKUPRC pInterface, PPDMSCATTERGATHER pSgBuf, bool fOnWorkerThread)); 347 /** @copydoc PDMINETWORKUP::pfnEndBuf */ 348 DECLRCCALLBACKMEMBER(void, pfnEndXmit,(PPDMINETWORKUPRC pInterface)); 349 /** @copydoc PDMINETWORKUP::pfnSetPromiscuousMode */ 350 DECLRCCALLBACKMEMBER(void, pfnSetPromiscuousMode,(PPDMINETWORKUPRC pInterface, bool fPromiscuous)); 351 } PDMINETWORKUPRC; 352 309 353 /** PDMINETWORKUP interface ID. */ 310 354 #define PDMINETWORKUP_IID "67e7e7a8-2594-4649-a1e3-7cee680c6083"
Note:
See TracChangeset
for help on using the changeset viewer.