VirtualBox

Changeset 28320 in vbox for trunk/include


Ignore:
Timestamp:
Apr 14, 2010 6:26:24 PM (15 years ago)
Author:
vboxsync
Message:

Network/D*,VMM: Moving the TX threads, part 1.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r28264 r28320  
    118118        if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
    119119        { \
    120             InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \
     120            P##InterfaceType pReturnInterfaceTypeCheck = (pInterface); \
    121121            return pReturnInterfaceTypeCheck; \
    122122        } \
     
    159159 * @returns PDMIBASERC::pfnQueryInterface return value.
    160160 *
    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.
    164165 *
    165166 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
     
    167168 */
    168169#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) )
    170171
    171172/**
     
    177178 * @param   pIns            Pointer to the instance data.
    178179 * @param   pszIID          The ID of the interface that is being queried.
    179  * @param   InterfaceType   The interface type name.  The interface ID is
    180  *                          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.
    181182 * @param   pInterface      The interface address expression.  This must resolve
    182183 *                          to some address within the instance data.
     184 * @remarks Don't use with PDMIBASE.
    183185 */
    184186#define PDMIBASERC_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface)  \
     
    187189        if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
    188190        { \
    189             InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \
     191            InterfaceType##RC *pReturnInterfaceTypeCheck = (pInterface); \
    190192            return (uintptr_t)pReturnInterfaceTypeCheck \
    191193                 - PDMINS_2_DATA(pIns, uintptr_t) \
     
    229231 * @returns PDMIBASER0::pfnQueryInterface return value.
    230232 *
    231  * @param   pIBaseR0        Pointer to the base ring-0 interface.
    232  * @param   InterfaceType   The interface type name.  The interface ID is
    233  *                          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.
    234236 *
    235237 * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
     
    237239 */
    238240#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) )
    240242
    241243/**
     
    247249 * @param   pIns            Pointer to the instance data.
    248250 * @param   pszIID          The ID of the interface that is being queried.
    249  * @param   InterfaceType   The interface type name.  The interface ID is
    250  *                          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.
    251253 * @param   pInterface      The interface address expression.  This must resolve
    252254 *                          to some address within the instance data.
     255 * @remarks Don't use with PDMIBASE.
    253256 */
    254257#define PDMIBASER0_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface)  \
     
    257260        if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
    258261        { \
    259             InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \
     262            InterfaceType##R0 *pReturnInterfaceTypeCheck = (pInterface); \
    260263            return (uintptr_t)pReturnInterfaceTypeCheck \
    261264                 - PDMINS_2_DATA(pIns, uintptr_t) \
     
    15071510     */
    15081511    DECLR3CALLBACKMEMBER(int, pfnNotifyStatusLinesChanged,(PPDMICHARPORT pInterface, uint32_t fNewStatusLines));
    1509    
     1512
    15101513    /**
    15111514     * Notify the device when the driver buffer is full.
  • trunk/include/VBox/pdmnetifs.h

    r28276 r28320  
    177177
    178178/** Pointer to a network connector interface */
    179 typedef struct PDMINETWORKUP *PPDMINETWORKUP;
     179typedef R3PTRTYPE(struct PDMINETWORKUP *) PPDMINETWORKUPR3;
     180/** Pointer to a network connector interface, ring-0 context. */
     181typedef R0PTRTYPE(struct PDMINETWORKUPR0 *) PPDMINETWORKUPR0;
     182/** Pointer to a network connector interface, raw-mode context. */
     183typedef RCPTRTYPE(struct PDMINETWORKUPRC *) PPDMINETWORKUPRC;
     184/** Pointer to a current context network connector interface. */
     185typedef CTX_SUFF(PPDMINETWORKUP) PPDMINETWORKUP;
     186
    180187/**
    181188 * Network connector interface (up).
     
    307314
    308315} PDMINETWORKUP;
     316
     317/** Ring-0 edition of PDMINETWORKUP. */
     318typedef 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. */
     336typedef 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
    309353/** PDMINETWORKUP interface ID. */
    310354#define PDMINETWORKUP_IID                       "67e7e7a8-2594-4649-a1e3-7cee680c6083"
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