VirtualBox

Changeset 12970 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Oct 3, 2008 7:04:11 AM (16 years ago)
Author:
vboxsync
Message:

#1865: PDMINS.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r12895 r12970  
    16601660 * PDM Device API.
    16611661 */
    1662 typedef struct PDMDEVHLP
     1662typedef struct PDMDEVHLPR3
    16631663{
    16641664    /** Structure version. PDM_DEVHLP_VERSION defines the current version. */
     
    17801780     * @param   pszFill             Name of the GC function which is gonna handle Fill/memset operations. (optional)
    17811781     * @param   pszDesc             Obsolete. NULL is fine.
    1782      * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
     1782     * @todo    Remove pszDesc in the next major revision of PDMDEVHLPR3.
    17831783     */
    17841784    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     
    18011801     * @param   pszFill             Name of the GC function which is gonna handle Fill/memset operations. (optional)
    18021802     * @param   pszDesc             Obsolete. NULL is fine.
    1803      * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
     1803     * @todo    Remove pszDesc in the next major revision of PDMDEVHLPR3.
    18041804     */
    18051805    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     
    27162716    /** Just a safety precaution. (PDM_DEVHLP_VERSION) */
    27172717    uint32_t                        u32TheEnd;
    2718 } PDMDEVHLP;
     2718} PDMDEVHLPR3;
    27192719#endif /* !IN_RING3 */
    2720 /** Pointer PDM Device API. */
    2721 typedef R3PTRTYPE(struct PDMDEVHLP *) PPDMDEVHLP;
    2722 /** Pointer PDM Device API. */
    2723 typedef R3PTRTYPE(const struct PDMDEVHLP *) PCPDMDEVHLP;
     2720/** Pointer to the R3 PDM Device API. */
     2721typedef R3PTRTYPE(struct PDMDEVHLPR3 *) PPDMDEVHLPR3;
     2722/** Pointer to the R3 PDM Device API, const variant. */
     2723typedef R3PTRTYPE(const struct PDMDEVHLPR3 *) PCPDMDEVHLPR3;
    27242724
    27252725/** Current PDMDEVHLP version number. */
     
    27282728
    27292729/**
    2730  * PDM Device API - GC Variant.
    2731  */
    2732 typedef struct PDMDEVHLPGC
    2733 {
    2734     /** Structure version. PDM_DEVHLPGC_VERSION defines the current version. */
     2730 * PDM Device API - RC Variant.
     2731 */
     2732typedef struct PDMDEVHLPRC
     2733{
     2734    /** Structure version. PDM_DEVHLPRC_VERSION defines the current version. */
    27352735    uint32_t                    u32Version;
    27362736
     
    28452845    /** Just a safety precaution. */
    28462846    uint32_t                        u32TheEnd;
    2847 } PDMDEVHLPGC;
    2848 /** Pointer PDM Device GC API. */
    2849 typedef RCPTRTYPE(struct PDMDEVHLPGC *) PPDMDEVHLPGC;
    2850 /** Pointer PDM Device GC API. */
    2851 typedef RCPTRTYPE(const struct PDMDEVHLPGC *) PCPDMDEVHLPGC;
     2847} PDMDEVHLPRC;
     2848/** Pointer PDM Device RC API. */
     2849typedef RCPTRTYPE(struct PDMDEVHLPRC *) PPDMDEVHLPRC;
     2850/** Pointer PDM Device RC API. */
     2851typedef RCPTRTYPE(const struct PDMDEVHLPRC *) PCPDMDEVHLPRC;
    28522852
    28532853/** Current PDMDEVHLP version number. */
    2854 #define PDM_DEVHLPGC_VERSION  0xfb010000
     2854#define PDM_DEVHLPRC_VERSION  0xfb010000
    28552855
    28562856
     
    29932993    /** Device instance number. */
    29942994    RTUINT                      iInstance;
     2995
     2996    /** Pointer the GC PDM Device API. */
     2997    PCPDMDEVHLPRC               pDevHlpRC;
     2998    /** Pointer to device instance data. */
     2999    RTRCPTR                     pvInstanceDataRC;
     3000
     3001    /** Pointer the R0 PDM Device API. */
     3002    PCPDMDEVHLPR0               pDevHlpR0;
     3003    /** Pointer to device instance data (R0). */
     3004    RTR0PTR                     pvInstanceDataR0;
     3005
     3006    /** Pointer the HC PDM Device API. */
     3007    PCPDMDEVHLPR3               pDevHlpR3;
     3008    /** Pointer to device instance data. */
     3009    RTR3PTR                     pvInstanceDataR3;
     3010
     3011    /** Pointer to device registration structure.  */
     3012    R3PTRTYPE(PCPDMDEVREG)      pDevReg;
     3013    /** Configuration handle. */
     3014    R3PTRTYPE(PCFGMNODE)        pCfgHandle;
     3015
    29953016    /** The base interface of the device.
    29963017     * The device constructor initializes this if it has any
     
    29983019     * call PDMR3QueryDevice(). */
    29993020    PDMIBASE                    IBase;
     3021    /** Align the internal data more naturally. */
     3022    RTR3PTR                     R3PtrPadding;
    30003023
    30013024    /** Internal data. */
     
    30053028        PDMDEVINSINT            s;
    30063029#endif
    3007         uint8_t                 padding[HC_ARCH_BITS == 32 ? 48 : 96];
     3030        uint8_t                 padding[HC_ARCH_BITS == 32 ? 64 + 16 : 112];
    30083031    } Internal;
    30093032
    3010     /** Pointer the HC PDM Device API. */
    3011     R3PTRTYPE(PCPDMDEVHLP)      pDevHlp;
    3012     /** Pointer the R0 PDM Device API. */
    3013     R0PTRTYPE(PCPDMDEVHLPR0)    pDevHlpR0;
    3014     /** Pointer to device registration structure.  */
    3015     R3PTRTYPE(PCPDMDEVREG)      pDevReg;
    3016     /** Configuration handle. */
    3017     R3PTRTYPE(PCFGMNODE)        pCfgHandle;
    3018     /** Pointer to device instance data. */
    3019     R3PTRTYPE(void *)           pvInstanceDataR3;
    3020     /** Pointer to device instance data. */
    3021     R0PTRTYPE(void *)           pvInstanceDataR0;
    3022     /** Pointer the GC PDM Device API. */
    3023     RCPTRTYPE(PCPDMDEVHLPGC)    pDevHlpGC;
    3024     /** Pointer to device instance data. */
    3025     RCPTRTYPE(void *)           pvInstanceDataGC;
    3026     /* padding to make achInstanceData aligned at 32 byte boundrary. */
    3027     uint32_t                    au32Padding[HC_ARCH_BITS == 32 ? 1 : 6];
    30283033    /** Device instance data. The size of this area is defined
    30293034     * in the PDMDEVREG::cbInstanceData field. */
     
    30313036} PDMDEVINS;
    30323037
    3033 /** Current DEVREG version number. */
    3034 #define PDM_DEVINS_VERSION  0xf3010000
     3038/** Current PDMDEVINS version number. */
     3039#define PDM_DEVINS_VERSION  0xf3020000
    30353040
    30363041/** Converts a pointer to the PDMDEVINS::IBase to a pointer to PDMDEVINS. */
     
    30423047 */
    30433048#ifdef VBOX_STRICT
    3044 # define PDMDEV_ASSERT_EMT(pDevIns)  pDevIns->pDevHlp->pfnAssertEMT(pDevIns, __FILE__, __LINE__, __FUNCTION__)
     3049# define PDMDEV_ASSERT_EMT(pDevIns)  pDevIns->pDevHlpR3->pfnAssertEMT(pDevIns, __FILE__, __LINE__, __FUNCTION__)
    30453050#else
    30463051# define PDMDEV_ASSERT_EMT(pDevIns)  do { } while (0)
     
    30513056 */
    30523057#ifdef VBOX_STRICT
    3053 # define PDMDEV_ASSERT_OTHER(pDevIns)  pDevIns->pDevHlp->pfnAssertOther(pDevIns, __FILE__, __LINE__, __FUNCTION__)
     3058# define PDMDEV_ASSERT_OTHER(pDevIns)  pDevIns->pDevHlpR3->pfnAssertOther(pDevIns, __FILE__, __LINE__, __FUNCTION__)
    30543059#else
    30553060# define PDMDEV_ASSERT_OTHER(pDevIns)  do { } while (0)
     
    30603065 */
    30613066#ifdef VBOX_STRICT
    3062 # define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns)  pDevIns->pDevHlp->pfnAssertVMLock(pDevIns, __FILE__, __LINE__, __FUNCTION__)
     3067# define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns)  pDevIns->pDevHlpR3->pfnAssertVMLock(pDevIns, __FILE__, __LINE__, __FUNCTION__)
    30633068#else
    30643069# define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns)  do { } while (0)
     
    30803085 * Converts a PDM Device instance pointer a RC PDM Device instance pointer.
    30813086 */
    3082 #define PDMDEVINS_2_RCPTR(pDevIns)  ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataGC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
     3087#define PDMDEVINS_2_RCPTR(pDevIns)  ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataRC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
    30833088
    30843089/** @def PDMDEVINS_2_R3PTR
     
    31093114    va_list args;
    31103115    va_start(args, pszFormat);
    3111     rc = pDevIns->pDevHlp->pfnDBGFStopV(pDevIns, RT_SRC_POS_ARGS, pszFormat, args);
     3116    rc = pDevIns->pDevHlpR3->pfnDBGFStopV(pDevIns, RT_SRC_POS_ARGS, pszFormat, args);
    31123117    va_end(args);
    31133118    return rc;
     
    31283133#ifdef IN_RING3
    31293134/**
    3130  * @copydoc PDMDEVHLP::pfnIOPortRegister
     3135 * @copydoc PDMDEVHLPR3::pfnIOPortRegister
    31313136 */
    31323137DECLINLINE(int) PDMDevHlpIOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
     
    31343139                                        PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc)
    31353140{
    3136     return pDevIns->pDevHlp->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);
    3137 }
    3138 
    3139 /**
    3140  * @copydoc PDMDEVHLP::pfnIOPortRegisterGC
     3141    return pDevIns->pDevHlpR3->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);
     3142}
     3143
     3144/**
     3145 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterGC
    31413146 */
    31423147DECLINLINE(int) PDMDevHlpIOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
     
    31443149                                          const char *pszInStr, const char *pszDesc)
    31453150{
    3146     return pDevIns->pDevHlp->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
    3147 }
    3148 
    3149 /**
    3150  * @copydoc PDMDEVHLP::pfnIOPortRegisterR0
     3151    return pDevIns->pDevHlpR3->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
     3152}
     3153
     3154/**
     3155 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterR0
    31513156 */
    31523157DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
     
    31543159                                          const char *pszInStr, const char *pszDesc)
    31553160{
    3156     return pDevIns->pDevHlp->pfnIOPortRegisterR0(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
    3157 }
    3158 
    3159 /**
    3160  * @copydoc PDMDEVHLP::pfnMMIORegister
     3161    return pDevIns->pDevHlpR3->pfnIOPortRegisterR0(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
     3162}
     3163
     3164/**
     3165 * @copydoc PDMDEVHLPR3::pfnMMIORegister
    31613166 */
    31623167DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     
    31643169                                      const char *pszDesc)
    31653170{
    3166     return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
    3167 }
    3168 
    3169 /**
    3170  * @copydoc PDMDEVHLP::pfnMMIORegisterGC
     3171    return pDevIns->pDevHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     3172}
     3173
     3174/**
     3175 * @copydoc PDMDEVHLPR3::pfnMMIORegisterGC
    31713176 */
    31723177DECLINLINE(int) PDMDevHlpMMIORegisterGC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
    31733178                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31743179{
    3175     return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    3176 }
    3177 
    3178 /**
    3179  * @copydoc PDMDEVHLP::pfnMMIORegisterR0
     3180    return pDevIns->pDevHlpR3->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3181}
     3182
     3183/**
     3184 * @copydoc PDMDEVHLPR3::pfnMMIORegisterR0
    31803185 */
    31813186DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    31823187                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31833188{
    3184     return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    3185 }
    3186 
    3187 /**
    3188  * @copydoc PDMDEVHLP::pfnROMRegister
     3189    return pDevIns->pDevHlpR3->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3190}
     3191
     3192/**
     3193 * @copydoc PDMDEVHLPR3::pfnROMRegister
    31893194 */
    31903195DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)
    31913196{
    3192     return pDevIns->pDevHlp->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);
    3193 }
    3194 /**
    3195  * @copydoc PDMDEVHLP::pfnROMProtectShadow
     3197    return pDevIns->pDevHlpR3->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);
     3198}
     3199/**
     3200 * @copydoc PDMDEVHLPR3::pfnROMProtectShadow
    31963201 */
    31973202DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
    31983203{
    3199     return pDevIns->pDevHlp->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange);
    3200 }
    3201 
    3202 /**
    3203  * @copydoc PDMDEVHLP::pfnMMIO2Register
     3204    return pDevIns->pDevHlpR3->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange);
     3205}
     3206
     3207/**
     3208 * @copydoc PDMDEVHLPR3::pfnMMIO2Register
    32043209 */
    32053210DECLINLINE(int) PDMDevHlpMMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc)
    32063211{
    3207     return pDevIns->pDevHlp->pfnMMIO2Register(pDevIns, iRegion, cb, fFlags, ppv, pszDesc);
    3208 }
    3209 
    3210 /**
    3211  * @copydoc PDMDEVHLP::pfnMMIO2Deregister
     3212    return pDevIns->pDevHlpR3->pfnMMIO2Register(pDevIns, iRegion, cb, fFlags, ppv, pszDesc);
     3213}
     3214
     3215/**
     3216 * @copydoc PDMDEVHLPR3::pfnMMIO2Deregister
    32123217 */
    32133218DECLINLINE(int) PDMDevHlpMMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion)
    32143219{
    3215     return pDevIns->pDevHlp->pfnMMIO2Deregister(pDevIns, iRegion);
    3216 }
    3217 
    3218 /**
    3219  * @copydoc PDMDEVHLP::pfnMMIO2Map
     3220    return pDevIns->pDevHlpR3->pfnMMIO2Deregister(pDevIns, iRegion);
     3221}
     3222
     3223/**
     3224 * @copydoc PDMDEVHLPR3::pfnMMIO2Map
    32203225 */
    32213226DECLINLINE(int) PDMDevHlpMMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)
    32223227{
    3223     return pDevIns->pDevHlp->pfnMMIO2Map(pDevIns, iRegion, GCPhys);
    3224 }
    3225 
    3226 /**
    3227  * @copydoc PDMDEVHLP::pfnMMIO2Unmap
     3228    return pDevIns->pDevHlpR3->pfnMMIO2Map(pDevIns, iRegion, GCPhys);
     3229}
     3230
     3231/**
     3232 * @copydoc PDMDEVHLPR3::pfnMMIO2Unmap
    32283233 */
    32293234DECLINLINE(int) PDMDevHlpMMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)
    32303235{
    3231     return pDevIns->pDevHlp->pfnMMIO2Unmap(pDevIns, iRegion, GCPhys);
    3232 }
    3233 
    3234 /**
    3235  * @copydoc PDMDEVHLP::pfnMMHyperMapMMIO2
     3236    return pDevIns->pDevHlpR3->pfnMMIO2Unmap(pDevIns, iRegion, GCPhys);
     3237}
     3238
     3239/**
     3240 * @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2
    32363241 */
    32373242DECLINLINE(int) PDMDevHlpMMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
    32383243                                         const char *pszDesc, PRTRCPTR pRCPtr)
    32393244{
    3240     return pDevIns->pDevHlp->pfnMMHyperMapMMIO2(pDevIns, iRegion, off, cb, pszDesc, pRCPtr);
    3241 }
    3242 
    3243 /**
    3244  * @copydoc PDMDEVHLP::pfnRegisterVMMDevHeap
     3245    return pDevIns->pDevHlpR3->pfnMMHyperMapMMIO2(pDevIns, iRegion, off, cb, pszDesc, pRCPtr);
     3246}
     3247
     3248/**
     3249 * @copydoc PDMDEVHLPR3::pfnRegisterVMMDevHeap
    32453250 */
    32463251DECLINLINE(int) PDMDevHlpRegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
    32473252{
    3248     return pDevIns->pDevHlp->pfnRegisterVMMDevHeap(pDevIns, GCPhys, pvHeap, cbSize);
    3249 }
    3250 
    3251 /**
    3252  * @copydoc PDMDEVHLP::pfnUnregisterVMMDevHeap
     3253    return pDevIns->pDevHlpR3->pfnRegisterVMMDevHeap(pDevIns, GCPhys, pvHeap, cbSize);
     3254}
     3255
     3256/**
     3257 * @copydoc PDMDEVHLPR3::pfnUnregisterVMMDevHeap
    32533258 */
    32543259DECLINLINE(int) PDMDevHlpUnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys)
    32553260{
    3256     return pDevIns->pDevHlp->pfnUnregisterVMMDevHeap(pDevIns, GCPhys);
    3257 }
    3258 
    3259 /**
    3260  * @copydoc PDMDEVHLP::pfnSSMRegister
     3261    return pDevIns->pDevHlpR3->pfnUnregisterVMMDevHeap(pDevIns, GCPhys);
     3262}
     3263
     3264/**
     3265 * @copydoc PDMDEVHLPR3::pfnSSMRegister
    32613266 */
    32623267DECLINLINE(int) PDMDevHlpSSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess,
     
    32643269                                     PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone)
    32653270{
    3266     return pDevIns->pDevHlp->pfnSSMRegister(pDevIns, pszName, u32Instance, u32Version, cbGuess,
     3271    return pDevIns->pDevHlpR3->pfnSSMRegister(pDevIns, pszName, u32Instance, u32Version, cbGuess,
    32673272                                            pfnSavePrep, pfnSaveExec, pfnSaveDone,
    32683273                                            pfnLoadPrep, pfnLoadExec, pfnLoadDone);
     
    32703275
    32713276/**
    3272  * @copydoc PDMDEVHLP::pfnTMTimerCreate
     3277 * @copydoc PDMDEVHLPR3::pfnTMTimerCreate
    32733278 */
    32743279DECLINLINE(int) PDMDevHlpTMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer)
    32753280{
    3276     return pDevIns->pDevHlp->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pszDesc, ppTimer);
    3277 }
    3278 
    3279 /**
    3280  * @copydoc PDMDEVHLP::pfnPCIRegister
     3281    return pDevIns->pDevHlpR3->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pszDesc, ppTimer);
     3282}
     3283
     3284/**
     3285 * @copydoc PDMDEVHLPR3::pfnPCIRegister
    32813286 */
    32823287DECLINLINE(int) PDMDevHlpPCIRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev)
    32833288{
    3284     return pDevIns->pDevHlp->pfnPCIRegister(pDevIns, pPciDev);
    3285 }
    3286 
    3287 /**
    3288  * @copydoc PDMDEVHLP::pfnPCIIORegionRegister
     3289    return pDevIns->pDevHlpR3->pfnPCIRegister(pDevIns, pPciDev);
     3290}
     3291
     3292/**
     3293 * @copydoc PDMDEVHLPR3::pfnPCIIORegionRegister
    32893294 */
    32903295DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
    32913296{
    3292     return pDevIns->pDevHlp->pfnPCIIORegionRegister(pDevIns, iRegion, cbRegion, enmType, pfnCallback);
    3293 }
    3294 
    3295 /**
    3296  * @copydoc PDMDEVHLP::pfnPCISetConfigCallbacks
     3297    return pDevIns->pDevHlpR3->pfnPCIIORegionRegister(pDevIns, iRegion, cbRegion, enmType, pfnCallback);
     3298}
     3299
     3300/**
     3301 * @copydoc PDMDEVHLPR3::pfnPCISetConfigCallbacks
    32973302 */
    32983303DECLINLINE(void) PDMDevHlpPCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
    32993304                                                PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld)
    33003305{
    3301     pDevIns->pDevHlp->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
    3302 }
    3303 
    3304 /**
    3305  * @copydoc PDMDEVHLP::pfnDriverAttach
     3306    pDevIns->pDevHlpR3->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
     3307}
     3308
     3309/**
     3310 * @copydoc PDMDEVHLPR3::pfnDriverAttach
    33063311 */
    33073312DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
    33083313{
    3309     return pDevIns->pDevHlp->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);
    3310 }
    3311 
    3312 /**
    3313  * @copydoc PDMDEVHLP::pfnMMHeapAlloc
     3314    return pDevIns->pDevHlpR3->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);
     3315}
     3316
     3317/**
     3318 * @copydoc PDMDEVHLPR3::pfnMMHeapAlloc
    33143319 */
    33153320DECLINLINE(void *) PDMDevHlpMMHeapAlloc(PPDMDEVINS pDevIns, size_t cb)
    33163321{
    3317     return pDevIns->pDevHlp->pfnMMHeapAlloc(pDevIns, cb);
    3318 }
    3319 
    3320 /**
    3321  * @copydoc PDMDEVHLP::pfnMMHeapAllocZ
     3322    return pDevIns->pDevHlpR3->pfnMMHeapAlloc(pDevIns, cb);
     3323}
     3324
     3325/**
     3326 * @copydoc PDMDEVHLPR3::pfnMMHeapAllocZ
    33223327 */
    33233328DECLINLINE(void *) PDMDevHlpMMHeapAllocZ(PPDMDEVINS pDevIns, size_t cb)
    33243329{
    3325     return pDevIns->pDevHlp->pfnMMHeapAllocZ(pDevIns, cb);
    3326 }
    3327 
    3328 /**
    3329  * @copydoc PDMDEVHLP::pfnMMHeapFree
     3330    return pDevIns->pDevHlpR3->pfnMMHeapAllocZ(pDevIns, cb);
     3331}
     3332
     3333/**
     3334 * @copydoc PDMDEVHLPR3::pfnMMHeapFree
    33303335 */
    33313336DECLINLINE(void) PDMDevHlpMMHeapFree(PPDMDEVINS pDevIns, void *pv)
    33323337{
    3333     pDevIns->pDevHlp->pfnMMHeapFree(pDevIns, pv);
    3334 }
    3335 
    3336 /**
    3337  * @copydoc PDMDEVHLP::pfnDBGFInfoRegister
     3338    pDevIns->pDevHlpR3->pfnMMHeapFree(pDevIns, pv);
     3339}
     3340
     3341/**
     3342 * @copydoc PDMDEVHLPR3::pfnDBGFInfoRegister
    33383343 */
    33393344DECLINLINE(int) PDMDevHlpDBGFInfoRegister(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler)
    33403345{
    3341     return pDevIns->pDevHlp->pfnDBGFInfoRegister(pDevIns, pszName, pszDesc, pfnHandler);
    3342 }
    3343 
    3344 /**
    3345  * @copydoc PDMDEVHLP::pfnSTAMRegister
     3346    return pDevIns->pDevHlpR3->pfnDBGFInfoRegister(pDevIns, pszName, pszDesc, pfnHandler);
     3347}
     3348
     3349/**
     3350 * @copydoc PDMDEVHLPR3::pfnSTAMRegister
    33463351 */
    33473352DECLINLINE(void) PDMDevHlpSTAMRegister(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc)
    33483353{
    3349     pDevIns->pDevHlp->pfnSTAMRegister(pDevIns, pvSample, enmType, pszName, enmUnit, pszDesc);
    3350 }
    3351 
    3352 /**
    3353  * @copydoc PDMDEVHLP::pfnSTAMRegisterF
     3354    pDevIns->pDevHlpR3->pfnSTAMRegister(pDevIns, pvSample, enmType, pszName, enmUnit, pszDesc);
     3355}
     3356
     3357/**
     3358 * @copydoc PDMDEVHLPR3::pfnSTAMRegisterF
    33543359 */
    33553360DECLINLINE(void) PDMDevHlpSTAMRegisterF(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
     
    33583363    va_list va;
    33593364    va_start(va, pszName);
    3360     pDevIns->pDevHlp->pfnSTAMRegisterV(pDevIns, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
     3365    pDevIns->pDevHlpR3->pfnSTAMRegisterV(pDevIns, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
    33613366    va_end(va);
    33623367}
    33633368
    33643369/**
    3365  * @copydoc PDMDEVHLP::pfnPDMQueueCreate
     3370 * @copydoc PDMDEVHLPR3::pfnPDMQueueCreate
    33663371 */
    33673372DECLINLINE(int) PDMDevHlpPDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
    33683373                                        PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue)
    33693374{
    3370     return pDevIns->pDevHlp->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue);
    3371 }
    3372 
    3373 /**
    3374  * @copydoc PDMDEVHLP::pfnCritSectInit
     3375    return pDevIns->pDevHlpR3->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue);
     3376}
     3377
     3378/**
     3379 * @copydoc PDMDEVHLPR3::pfnCritSectInit
    33753380 */
    33763381DECLINLINE(int) PDMDevHlpCritSectInit(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName)
    33773382{
    3378     return pDevIns->pDevHlp->pfnCritSectInit(pDevIns, pCritSect, pszName);
    3379 }
    3380 
    3381 /**
    3382  * @copydoc PDMDEVHLP::pfnUTCNow
     3383    return pDevIns->pDevHlpR3->pfnCritSectInit(pDevIns, pCritSect, pszName);
     3384}
     3385
     3386/**
     3387 * @copydoc PDMDEVHLPR3::pfnUTCNow
    33833388 */
    33843389DECLINLINE(PRTTIMESPEC) PDMDevHlpUTCNow(PPDMDEVINS pDevIns, PRTTIMESPEC pTime)
    33853390{
    3386     return pDevIns->pDevHlp->pfnUTCNow(pDevIns, pTime);
    3387 }
    3388 
    3389 /**
    3390  * @copydoc PDMDEVHLP::pfnGetVM
     3391    return pDevIns->pDevHlpR3->pfnUTCNow(pDevIns, pTime);
     3392}
     3393
     3394/**
     3395 * @copydoc PDMDEVHLPR3::pfnGetVM
    33913396 */
    33923397DECLINLINE(PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
    33933398{
    3394     return pDevIns->pDevHlp->pfnGetVM(pDevIns);
    3395 }
    3396 
    3397 /**
    3398  * @copydoc PDMDEVHLP::pfnPhysReadGCVirt
     3399    return pDevIns->pDevHlpR3->pfnGetVM(pDevIns);
     3400}
     3401
     3402/**
     3403 * @copydoc PDMDEVHLPR3::pfnPhysReadGCVirt
    33993404 */
    34003405DECLINLINE(int) PDMDevHlpPhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb)
    34013406{
    3402     return pDevIns->pDevHlp->pfnPhysReadGCVirt(pDevIns, pvDst, GCVirtSrc, cb);
    3403 }
    3404 
    3405 /**
    3406  * @copydoc PDMDEVHLP::pfnPhysWriteGCVirt
     3407    return pDevIns->pDevHlpR3->pfnPhysReadGCVirt(pDevIns, pvDst, GCVirtSrc, cb);
     3408}
     3409
     3410/**
     3411 * @copydoc PDMDEVHLPR3::pfnPhysWriteGCVirt
    34073412 */
    34083413DECLINLINE(int) PDMDevHlpPhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb)
    34093414{
    3410     return pDevIns->pDevHlp->pfnPhysWriteGCVirt(pDevIns, GCVirtDst, pvSrc, cb);
    3411 }
    3412 
    3413 /**
    3414  * @copydoc PDMDEVHLP::pfnPhysReserve
     3415    return pDevIns->pDevHlpR3->pfnPhysWriteGCVirt(pDevIns, GCVirtDst, pvSrc, cb);
     3416}
     3417
     3418/**
     3419 * @copydoc PDMDEVHLPR3::pfnPhysReserve
    34153420 */
    34163421DECLINLINE(int) PDMDevHlpPhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc)
    34173422{
    3418     return pDevIns->pDevHlp->pfnPhysReserve(pDevIns, GCPhys, cbRange, pszDesc);
    3419 }
    3420 
    3421 /**
    3422  * @copydoc PDMDEVHLP::pfnPhysGCPtr2GCPhys
     3423    return pDevIns->pDevHlpR3->pfnPhysReserve(pDevIns, GCPhys, cbRange, pszDesc);
     3424}
     3425
     3426/**
     3427 * @copydoc PDMDEVHLPR3::pfnPhysGCPtr2GCPhys
    34233428 */
    34243429DECLINLINE(int) PDMDevHlpPhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys)
    34253430{
    3426     return pDevIns->pDevHlp->pfnPhysGCPtr2GCPhys(pDevIns, GCPtr, pGCPhys);
    3427 }
    3428 
    3429 /**
    3430  * @copydoc PDMDEVHLP::pfnVMState
     3431    return pDevIns->pDevHlpR3->pfnPhysGCPtr2GCPhys(pDevIns, GCPtr, pGCPhys);
     3432}
     3433
     3434/**
     3435 * @copydoc PDMDEVHLPR3::pfnVMState
    34313436 */
    34323437DECLINLINE(VMSTATE) PDMDevHlpVMState(PPDMDEVINS pDevIns)
    34333438{
    3434     return pDevIns->pDevHlp->pfnVMState(pDevIns);
    3435 }
    3436 
    3437 /**
    3438  * @copydoc PDMDEVHLP::pfnA20Set
     3439    return pDevIns->pDevHlpR3->pfnVMState(pDevIns);
     3440}
     3441
     3442/**
     3443 * @copydoc PDMDEVHLPR3::pfnA20Set
    34393444 */
    34403445DECLINLINE(void) PDMDevHlpA20Set(PPDMDEVINS pDevIns, bool fEnable)
    34413446{
    3442     pDevIns->pDevHlp->pfnA20Set(pDevIns, fEnable);
    3443 }
    3444 
    3445 /**
    3446  * @copydoc PDMDEVHLP::pfnVMReset
     3447    pDevIns->pDevHlpR3->pfnA20Set(pDevIns, fEnable);
     3448}
     3449
     3450/**
     3451 * @copydoc PDMDEVHLPR3::pfnVMReset
    34473452 */
    34483453DECLINLINE(int) PDMDevHlpVMReset(PPDMDEVINS pDevIns)
    34493454{
    3450     return pDevIns->pDevHlp->pfnVMReset(pDevIns);
    3451 }
    3452 
    3453 /**
    3454  * @copydoc PDMDEVHLP::pfnVMSuspend
     3455    return pDevIns->pDevHlpR3->pfnVMReset(pDevIns);
     3456}
     3457
     3458/**
     3459 * @copydoc PDMDEVHLPR3::pfnVMSuspend
    34553460 */
    34563461DECLINLINE(int) PDMDevHlpVMSuspend(PPDMDEVINS pDevIns)
    34573462{
    3458     return pDevIns->pDevHlp->pfnVMSuspend(pDevIns);
    3459 }
    3460 
    3461 /**
    3462  * @copydoc PDMDEVHLP::pfnVMPowerOff
     3463    return pDevIns->pDevHlpR3->pfnVMSuspend(pDevIns);
     3464}
     3465
     3466/**
     3467 * @copydoc PDMDEVHLPR3::pfnVMPowerOff
    34633468 */
    34643469DECLINLINE(int) PDMDevHlpVMPowerOff(PPDMDEVINS pDevIns)
    34653470{
    3466     return pDevIns->pDevHlp->pfnVMPowerOff(pDevIns);
    3467 }
    3468 
    3469 /**
    3470  * @copydoc PDMDEVHLP::pfnDMARegister
     3471    return pDevIns->pDevHlpR3->pfnVMPowerOff(pDevIns);
     3472}
     3473
     3474/**
     3475 * @copydoc PDMDEVHLPR3::pfnDMARegister
    34713476 */
    34723477DECLINLINE(int) PDMDevHlpDMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser)
    34733478{
    3474     return pDevIns->pDevHlp->pfnDMARegister(pDevIns, uChannel, pfnTransferHandler, pvUser);
    3475 }
    3476 
    3477 /**
    3478  * @copydoc PDMDEVHLP::pfnDMAReadMemory
     3479    return pDevIns->pDevHlpR3->pfnDMARegister(pDevIns, uChannel, pfnTransferHandler, pvUser);
     3480}
     3481
     3482/**
     3483 * @copydoc PDMDEVHLPR3::pfnDMAReadMemory
    34793484 */
    34803485DECLINLINE(int) PDMDevHlpDMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead)
    34813486{
    3482     return pDevIns->pDevHlp->pfnDMAReadMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbRead);
    3483 }
    3484 
    3485 /**
    3486  * @copydoc PDMDEVHLP::pfnDMAWriteMemory
     3487    return pDevIns->pDevHlpR3->pfnDMAReadMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbRead);
     3488}
     3489
     3490/**
     3491 * @copydoc PDMDEVHLPR3::pfnDMAWriteMemory
    34873492 */
    34883493DECLINLINE(int) PDMDevHlpDMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten)
    34893494{
    3490     return pDevIns->pDevHlp->pfnDMAWriteMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbWritten);
    3491 }
    3492 
    3493 /**
    3494  * @copydoc PDMDEVHLP::pfnDMASetDREQ
     3495    return pDevIns->pDevHlpR3->pfnDMAWriteMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbWritten);
     3496}
     3497
     3498/**
     3499 * @copydoc PDMDEVHLPR3::pfnDMASetDREQ
    34953500 */
    34963501DECLINLINE(int) PDMDevHlpDMASetDREQ(PPDMDEVINS pDevIns, unsigned uChannel, unsigned uLevel)
    34973502{
    3498     return pDevIns->pDevHlp->pfnDMASetDREQ(pDevIns, uChannel, uLevel);
    3499 }
    3500 
    3501 /**
    3502  * @copydoc PDMDEVHLP::pfnDMAGetChannelMode
     3503    return pDevIns->pDevHlpR3->pfnDMASetDREQ(pDevIns, uChannel, uLevel);
     3504}
     3505
     3506/**
     3507 * @copydoc PDMDEVHLPR3::pfnDMAGetChannelMode
    35033508 */
    35043509DECLINLINE(uint8_t) PDMDevHlpDMAGetChannelMode(PPDMDEVINS pDevIns, unsigned uChannel)
    35053510{
    3506     return pDevIns->pDevHlp->pfnDMAGetChannelMode(pDevIns, uChannel);
    3507 }
    3508 
    3509 /**
    3510  * @copydoc PDMDEVHLP::pfnDMASchedule
     3511    return pDevIns->pDevHlpR3->pfnDMAGetChannelMode(pDevIns, uChannel);
     3512}
     3513
     3514/**
     3515 * @copydoc PDMDEVHLPR3::pfnDMASchedule
    35113516 */
    35123517DECLINLINE(void) PDMDevHlpDMASchedule(PPDMDEVINS pDevIns)
    35133518{
    3514     pDevIns->pDevHlp->pfnDMASchedule(pDevIns);
    3515 }
    3516 
    3517 /**
    3518  * @copydoc PDMDEVHLP::pfnCMOSWrite
     3519    pDevIns->pDevHlpR3->pfnDMASchedule(pDevIns);
     3520}
     3521
     3522/**
     3523 * @copydoc PDMDEVHLPR3::pfnCMOSWrite
    35193524 */
    35203525DECLINLINE(int) PDMDevHlpCMOSWrite(PPDMDEVINS pDevIns, unsigned iReg, uint8_t u8Value)
    35213526{
    3522     return pDevIns->pDevHlp->pfnCMOSWrite(pDevIns, iReg, u8Value);
    3523 }
    3524 
    3525 /**
    3526  * @copydoc PDMDEVHLP::pfnCMOSRead
     3527    return pDevIns->pDevHlpR3->pfnCMOSWrite(pDevIns, iReg, u8Value);
     3528}
     3529
     3530/**
     3531 * @copydoc PDMDEVHLPR3::pfnCMOSRead
    35273532 */
    35283533DECLINLINE(int) PDMDevHlpCMOSRead(PPDMDEVINS pDevIns, unsigned iReg, uint8_t *pu8Value)
    35293534{
    3530     return pDevIns->pDevHlp->pfnCMOSRead(pDevIns, iReg, pu8Value);
    3531 }
    3532 
    3533 /**
    3534  * @copydoc PDMDEVHLP::pfnGetCpuId
     3535    return pDevIns->pDevHlpR3->pfnCMOSRead(pDevIns, iReg, pu8Value);
     3536}
     3537
     3538/**
     3539 * @copydoc PDMDEVHLPR3::pfnGetCpuId
    35353540 */
    35363541DECLINLINE(void) PDMDevHlpGetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
    35373542{
    3538     pDevIns->pDevHlp->pfnGetCpuId(pDevIns, iLeaf, pEax, pEbx, pEcx, pEdx);
    3539 }
    3540 
    3541 /**
    3542  * @copydoc PDMDEVHLP::pfnPDMThreadCreate
     3543    pDevIns->pDevHlpR3->pfnGetCpuId(pDevIns, iLeaf, pEax, pEbx, pEcx, pEdx);
     3544}
     3545
     3546/**
     3547 * @copydoc PDMDEVHLPR3::pfnPDMThreadCreate
    35433548 */
    35443549DECLINLINE(int) PDMDevHlpPDMThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
    35453550                                         PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
    35463551{
    3547     return pDevIns->pDevHlp->pfnPDMThreadCreate(pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
     3552    return pDevIns->pDevHlpR3->pfnPDMThreadCreate(pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
    35483553}
    35493554#endif /* IN_RING3 */
     
    35513556
    35523557/**
    3553  * @copydoc PDMDEVHLP::pfnPCISetIrq
     3558 * @copydoc PDMDEVHLPR3::pfnPCISetIrq
    35543559 */
    35553560DECLINLINE(void) PDMDevHlpPCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
    35563561{
    3557 #ifdef IN_GC
    3558     pDevIns->pDevHlpGC->pfnPCISetIrq(pDevIns, iIrq, iLevel);
    3559 #elif defined(IN_RING0)
    3560     pDevIns->pDevHlpR0->pfnPCISetIrq(pDevIns, iIrq, iLevel);
    3561 #else
    3562     pDevIns->pDevHlp->pfnPCISetIrq(pDevIns, iIrq, iLevel);
    3563 #endif
    3564 }
    3565 
    3566 /**
    3567  * @copydoc PDMDEVHLP::pfnPCISetIrqNoWait
     3562    pDevIns->CTX_SUFF(pDevHlp)->pfnPCISetIrq(pDevIns, iIrq, iLevel);
     3563}
     3564
     3565/**
     3566 * @copydoc PDMDEVHLPR3::pfnPCISetIrqNoWait
    35683567 */
    35693568DECLINLINE(void) PDMDevHlpPCISetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel)
    35703569{
    3571 #ifdef IN_GC
    3572     pDevIns->pDevHlpGC->pfnPCISetIrq(pDevIns, iIrq, iLevel);
    3573 #elif defined(IN_RING0)
    3574     pDevIns->pDevHlpR0->pfnPCISetIrq(pDevIns, iIrq, iLevel);
    3575 #else
    3576     pDevIns->pDevHlp->pfnPCISetIrqNoWait(pDevIns, iIrq, iLevel);
    3577 #endif
    3578 }
    3579 
    3580 /**
    3581  * @copydoc PDMDEVHLP::pfnISASetIrq
     3570    pDevIns->CTX_SUFF(pDevHlp)->pfnPCISetIrq(pDevIns, iIrq, iLevel);
     3571}
     3572
     3573/**
     3574 * @copydoc PDMDEVHLPR3::pfnISASetIrq
    35823575 */
    35833576DECLINLINE(void) PDMDevHlpISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
    35843577{
    3585 #ifdef IN_GC
    3586     pDevIns->pDevHlpGC->pfnISASetIrq(pDevIns, iIrq, iLevel);
    3587 #elif defined(IN_RING0)
    3588     pDevIns->pDevHlpR0->pfnISASetIrq(pDevIns, iIrq, iLevel);
    3589 #else
    3590     pDevIns->pDevHlp->pfnISASetIrq(pDevIns, iIrq, iLevel);
    3591 #endif
    3592 }
    3593 
    3594 /**
    3595  * @copydoc PDMDEVHLP::pfnISASetIrqNoWait
     3578    pDevIns->CTX_SUFF(pDevHlp)->pfnISASetIrq(pDevIns, iIrq, iLevel);
     3579}
     3580
     3581/**
     3582 * @copydoc PDMDEVHLPR3::pfnISASetIrqNoWait
    35963583 */
    35973584DECLINLINE(void) PDMDevHlpISASetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel)
    35983585{
    3599 #ifdef IN_GC
    3600     pDevIns->pDevHlpGC->pfnISASetIrq(pDevIns, iIrq, iLevel);
    3601 #elif defined(IN_RING0)
    3602     pDevIns->pDevHlpR0->pfnISASetIrq(pDevIns, iIrq, iLevel);
    3603 #else
    3604     pDevIns->pDevHlp->pfnISASetIrqNoWait(pDevIns, iIrq, iLevel);
    3605 #endif
    3606 }
    3607 
    3608 /**
    3609  * @copydoc PDMDEVHLP::pfnPhysRead
     3586    pDevIns->CTX_SUFF(pDevHlp)->pfnISASetIrq(pDevIns, iIrq, iLevel);
     3587}
     3588
     3589/**
     3590 * @copydoc PDMDEVHLPR3::pfnPhysRead
    36103591 */
    36113592DECLINLINE(void) PDMDevHlpPhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
    36123593{
    3613 #ifdef IN_GC
    3614     pDevIns->pDevHlpGC->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead);
    3615 #elif defined(IN_RING0)
    3616     pDevIns->pDevHlpR0->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead);
    3617 #else
    3618     pDevIns->pDevHlp->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead);
    3619 #endif
    3620 }
    3621 
    3622 /**
    3623  * @copydoc PDMDEVHLP::pfnPhysWrite
     3594    pDevIns->CTX_SUFF(pDevHlp)->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead);
     3595}
     3596
     3597/**
     3598 * @copydoc PDMDEVHLPR3::pfnPhysWrite
    36243599 */
    36253600DECLINLINE(void) PDMDevHlpPhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
    36263601{
    3627 #ifdef IN_GC
    3628     pDevIns->pDevHlpGC->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite);
    3629 #elif defined(IN_RING0)
    3630     pDevIns->pDevHlpR0->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite);
    3631 #else
    3632     pDevIns->pDevHlp->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite);
    3633 #endif
    3634 }
    3635 
    3636 /**
    3637  * @copydoc PDMDEVHLP::pfnA20IsEnabled
     3602    pDevIns->CTX_SUFF(pDevHlp)->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite);
     3603}
     3604
     3605/**
     3606 * @copydoc PDMDEVHLPR3::pfnA20IsEnabled
    36383607 */
    36393608DECLINLINE(bool) PDMDevHlpA20IsEnabled(PPDMDEVINS pDevIns)
    36403609{
    3641 #ifdef IN_GC
    3642     return pDevIns->pDevHlpGC->pfnA20IsEnabled(pDevIns);
    3643 #elif defined(IN_RING0)
    3644     return pDevIns->pDevHlpR0->pfnA20IsEnabled(pDevIns);
    3645 #else
    3646     return pDevIns->pDevHlp->pfnA20IsEnabled(pDevIns);
    3647 #endif
    3648 }
    3649 
    3650 /**
    3651  * @copydoc PDMDEVHLP::pfnVMSetError
     3610    return pDevIns->CTX_SUFF(pDevHlp)->pfnA20IsEnabled(pDevIns);
     3611}
     3612
     3613/**
     3614 * @copydoc PDMDEVHLPR3::pfnVMSetError
    36523615 */
    36533616DECLINLINE(int) PDMDevHlpVMSetError(PPDMDEVINS pDevIns, const int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
     
    36553618    va_list va;
    36563619    va_start(va, pszFormat);
    3657 #ifdef IN_GC
    3658     pDevIns->pDevHlpGC->pfnVMSetErrorV(pDevIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
    3659 #elif defined(IN_RING0)
    3660     pDevIns->pDevHlpR0->pfnVMSetErrorV(pDevIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
    3661 #else
    3662     pDevIns->pDevHlp->pfnVMSetErrorV(pDevIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
    3663 #endif
     3620    pDevIns->CTX_SUFF(pDevHlp)->pfnVMSetErrorV(pDevIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
    36643621    va_end(va);
    36653622    return rc;
     
    36673624
    36683625/**
    3669  * @copydoc PDMDEVHLP::pfnVMSetRuntimeError
     3626 * @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError
    36703627 */
    36713628DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
     
    36743631    int rc;
    36753632    va_start(va, pszFormat);
    3676 #ifdef IN_GC
    3677     rc = pDevIns->pDevHlpGC->pfnVMSetRuntimeErrorV(pDevIns, fFatal, pszErrorID, pszFormat, va);
    3678 #elif defined(IN_RING0)
    3679     rc = pDevIns->pDevHlpR0->pfnVMSetRuntimeErrorV(pDevIns, fFatal, pszErrorID, pszFormat, va);
    3680 #else
    3681     rc = pDevIns->pDevHlp->pfnVMSetRuntimeErrorV(pDevIns, fFatal, pszErrorID, pszFormat, va);
    3682 #endif
     3633    rc = pDevIns->CTX_SUFF(pDevHlp)->pfnVMSetRuntimeErrorV(pDevIns, fFatal, pszErrorID, pszFormat, va);
    36833634    va_end(va);
    36843635    return rc;
  • trunk/include/VBox/pdmins.h

    r12653 r12970  
    5353 * Converts a PDM Device, USB Device, or Driver instance pointer to a RC pointer to the instance data.
    5454 */
    55 #define PDMINS_2_DATA_RCPTR(pIns)   ( (pIns)->pvInstanceDataGC )
     55#define PDMINS_2_DATA_RCPTR(pIns)   ( (pIns)->pvInstanceDataRC )
    5656
    5757/** @def PDMINS_2_DATA_R3PTR
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