Changeset 12970 in vbox for trunk/include/VBox
- Timestamp:
- Oct 3, 2008 7:04:11 AM (16 years ago)
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r12895 r12970 1660 1660 * PDM Device API. 1661 1661 */ 1662 typedef struct PDMDEVHLP 1662 typedef struct PDMDEVHLPR3 1663 1663 { 1664 1664 /** Structure version. PDM_DEVHLP_VERSION defines the current version. */ … … 1780 1780 * @param pszFill Name of the GC function which is gonna handle Fill/memset operations. (optional) 1781 1781 * @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. 1783 1783 */ 1784 1784 DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser, … … 1801 1801 * @param pszFill Name of the GC function which is gonna handle Fill/memset operations. (optional) 1802 1802 * @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. 1804 1804 */ 1805 1805 DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, … … 2716 2716 /** Just a safety precaution. (PDM_DEVHLP_VERSION) */ 2717 2717 uint32_t u32TheEnd; 2718 } PDMDEVHLP ;2718 } PDMDEVHLPR3; 2719 2719 #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. */ 2721 typedef R3PTRTYPE(struct PDMDEVHLPR3 *) PPDMDEVHLPR3; 2722 /** Pointer to the R3 PDM Device API, const variant. */ 2723 typedef R3PTRTYPE(const struct PDMDEVHLPR3 *) PCPDMDEVHLPR3; 2724 2724 2725 2725 /** Current PDMDEVHLP version number. */ … … 2728 2728 2729 2729 /** 2730 * PDM Device API - GC Variant.2731 */ 2732 typedef struct PDMDEVHLP GC2733 { 2734 /** Structure version. PDM_DEVHLP GC_VERSION defines the current version. */2730 * PDM Device API - RC Variant. 2731 */ 2732 typedef struct PDMDEVHLPRC 2733 { 2734 /** Structure version. PDM_DEVHLPRC_VERSION defines the current version. */ 2735 2735 uint32_t u32Version; 2736 2736 … … 2845 2845 /** Just a safety precaution. */ 2846 2846 uint32_t u32TheEnd; 2847 } PDMDEVHLP GC;2848 /** Pointer PDM Device GC API. */2849 typedef RCPTRTYPE(struct PDMDEVHLP GC *) PPDMDEVHLPGC;2850 /** Pointer PDM Device GC API. */2851 typedef RCPTRTYPE(const struct PDMDEVHLP GC *) PCPDMDEVHLPGC;2847 } PDMDEVHLPRC; 2848 /** Pointer PDM Device RC API. */ 2849 typedef RCPTRTYPE(struct PDMDEVHLPRC *) PPDMDEVHLPRC; 2850 /** Pointer PDM Device RC API. */ 2851 typedef RCPTRTYPE(const struct PDMDEVHLPRC *) PCPDMDEVHLPRC; 2852 2852 2853 2853 /** Current PDMDEVHLP version number. */ 2854 #define PDM_DEVHLP GC_VERSION 0xfb0100002854 #define PDM_DEVHLPRC_VERSION 0xfb010000 2855 2855 2856 2856 … … 2993 2993 /** Device instance number. */ 2994 2994 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 2995 3016 /** The base interface of the device. 2996 3017 * The device constructor initializes this if it has any … … 2998 3019 * call PDMR3QueryDevice(). */ 2999 3020 PDMIBASE IBase; 3021 /** Align the internal data more naturally. */ 3022 RTR3PTR R3PtrPadding; 3000 3023 3001 3024 /** Internal data. */ … … 3005 3028 PDMDEVINSINT s; 3006 3029 #endif 3007 uint8_t padding[HC_ARCH_BITS == 32 ? 48 : 96];3030 uint8_t padding[HC_ARCH_BITS == 32 ? 64 + 16 : 112]; 3008 3031 } Internal; 3009 3032 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];3028 3033 /** Device instance data. The size of this area is defined 3029 3034 * in the PDMDEVREG::cbInstanceData field. */ … … 3031 3036 } PDMDEVINS; 3032 3037 3033 /** Current DEVREGversion number. */3034 #define PDM_DEVINS_VERSION 0xf30 100003038 /** Current PDMDEVINS version number. */ 3039 #define PDM_DEVINS_VERSION 0xf3020000 3035 3040 3036 3041 /** Converts a pointer to the PDMDEVINS::IBase to a pointer to PDMDEVINS. */ … … 3042 3047 */ 3043 3048 #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__) 3045 3050 #else 3046 3051 # define PDMDEV_ASSERT_EMT(pDevIns) do { } while (0) … … 3051 3056 */ 3052 3057 #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__) 3054 3059 #else 3055 3060 # define PDMDEV_ASSERT_OTHER(pDevIns) do { } while (0) … … 3060 3065 */ 3061 3066 #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__) 3063 3068 #else 3064 3069 # define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns) do { } while (0) … … 3080 3085 * Converts a PDM Device instance pointer a RC PDM Device instance pointer. 3081 3086 */ 3082 #define PDMDEVINS_2_RCPTR(pDevIns) ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceData GC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )3087 #define PDMDEVINS_2_RCPTR(pDevIns) ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataRC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) ) 3083 3088 3084 3089 /** @def PDMDEVINS_2_R3PTR … … 3109 3114 va_list args; 3110 3115 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); 3112 3117 va_end(args); 3113 3118 return rc; … … 3128 3133 #ifdef IN_RING3 3129 3134 /** 3130 * @copydoc PDMDEVHLP ::pfnIOPortRegister3135 * @copydoc PDMDEVHLPR3::pfnIOPortRegister 3131 3136 */ 3132 3137 DECLINLINE(int) PDMDevHlpIOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser, … … 3134 3139 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc) 3135 3140 { 3136 return pDevIns->pDevHlp ->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);3137 } 3138 3139 /** 3140 * @copydoc PDMDEVHLP ::pfnIOPortRegisterGC3141 return pDevIns->pDevHlpR3->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc); 3142 } 3143 3144 /** 3145 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterGC 3141 3146 */ 3142 3147 DECLINLINE(int) PDMDevHlpIOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser, … … 3144 3149 const char *pszInStr, const char *pszDesc) 3145 3150 { 3146 return pDevIns->pDevHlp ->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);3147 } 3148 3149 /** 3150 * @copydoc PDMDEVHLP ::pfnIOPortRegisterR03151 return pDevIns->pDevHlpR3->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc); 3152 } 3153 3154 /** 3155 * @copydoc PDMDEVHLPR3::pfnIOPortRegisterR0 3151 3156 */ 3152 3157 DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser, … … 3154 3159 const char *pszInStr, const char *pszDesc) 3155 3160 { 3156 return pDevIns->pDevHlp ->pfnIOPortRegisterR0(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);3157 } 3158 3159 /** 3160 * @copydoc PDMDEVHLP ::pfnMMIORegister3161 return pDevIns->pDevHlpR3->pfnIOPortRegisterR0(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc); 3162 } 3163 3164 /** 3165 * @copydoc PDMDEVHLPR3::pfnMMIORegister 3161 3166 */ 3162 3167 DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, … … 3164 3169 const char *pszDesc) 3165 3170 { 3166 return pDevIns->pDevHlp ->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);3167 } 3168 3169 /** 3170 * @copydoc PDMDEVHLP ::pfnMMIORegisterGC3171 return pDevIns->pDevHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 3172 } 3173 3174 /** 3175 * @copydoc PDMDEVHLPR3::pfnMMIORegisterGC 3171 3176 */ 3172 3177 DECLINLINE(int) PDMDevHlpMMIORegisterGC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser, 3173 3178 const char *pszWrite, const char *pszRead, const char *pszFill) 3174 3179 { 3175 return pDevIns->pDevHlp ->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);3176 } 3177 3178 /** 3179 * @copydoc PDMDEVHLP ::pfnMMIORegisterR03180 return pDevIns->pDevHlpR3->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL); 3181 } 3182 3183 /** 3184 * @copydoc PDMDEVHLPR3::pfnMMIORegisterR0 3180 3185 */ 3181 3186 DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 3182 3187 const char *pszWrite, const char *pszRead, const char *pszFill) 3183 3188 { 3184 return pDevIns->pDevHlp ->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);3185 } 3186 3187 /** 3188 * @copydoc PDMDEVHLP ::pfnROMRegister3189 return pDevIns->pDevHlpR3->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL); 3190 } 3191 3192 /** 3193 * @copydoc PDMDEVHLPR3::pfnROMRegister 3189 3194 */ 3190 3195 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc) 3191 3196 { 3192 return pDevIns->pDevHlp ->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);3193 } 3194 /** 3195 * @copydoc PDMDEVHLP ::pfnROMProtectShadow3197 return pDevIns->pDevHlpR3->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 3198 } 3199 /** 3200 * @copydoc PDMDEVHLPR3::pfnROMProtectShadow 3196 3201 */ 3197 3202 DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3198 3203 { 3199 return pDevIns->pDevHlp ->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange);3200 } 3201 3202 /** 3203 * @copydoc PDMDEVHLP ::pfnMMIO2Register3204 return pDevIns->pDevHlpR3->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange); 3205 } 3206 3207 /** 3208 * @copydoc PDMDEVHLPR3::pfnMMIO2Register 3204 3209 */ 3205 3210 DECLINLINE(int) PDMDevHlpMMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc) 3206 3211 { 3207 return pDevIns->pDevHlp ->pfnMMIO2Register(pDevIns, iRegion, cb, fFlags, ppv, pszDesc);3208 } 3209 3210 /** 3211 * @copydoc PDMDEVHLP ::pfnMMIO2Deregister3212 return pDevIns->pDevHlpR3->pfnMMIO2Register(pDevIns, iRegion, cb, fFlags, ppv, pszDesc); 3213 } 3214 3215 /** 3216 * @copydoc PDMDEVHLPR3::pfnMMIO2Deregister 3212 3217 */ 3213 3218 DECLINLINE(int) PDMDevHlpMMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion) 3214 3219 { 3215 return pDevIns->pDevHlp ->pfnMMIO2Deregister(pDevIns, iRegion);3216 } 3217 3218 /** 3219 * @copydoc PDMDEVHLP ::pfnMMIO2Map3220 return pDevIns->pDevHlpR3->pfnMMIO2Deregister(pDevIns, iRegion); 3221 } 3222 3223 /** 3224 * @copydoc PDMDEVHLPR3::pfnMMIO2Map 3220 3225 */ 3221 3226 DECLINLINE(int) PDMDevHlpMMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3222 3227 { 3223 return pDevIns->pDevHlp ->pfnMMIO2Map(pDevIns, iRegion, GCPhys);3224 } 3225 3226 /** 3227 * @copydoc PDMDEVHLP ::pfnMMIO2Unmap3228 return pDevIns->pDevHlpR3->pfnMMIO2Map(pDevIns, iRegion, GCPhys); 3229 } 3230 3231 /** 3232 * @copydoc PDMDEVHLPR3::pfnMMIO2Unmap 3228 3233 */ 3229 3234 DECLINLINE(int) PDMDevHlpMMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3230 3235 { 3231 return pDevIns->pDevHlp ->pfnMMIO2Unmap(pDevIns, iRegion, GCPhys);3232 } 3233 3234 /** 3235 * @copydoc PDMDEVHLP ::pfnMMHyperMapMMIO23236 return pDevIns->pDevHlpR3->pfnMMIO2Unmap(pDevIns, iRegion, GCPhys); 3237 } 3238 3239 /** 3240 * @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2 3236 3241 */ 3237 3242 DECLINLINE(int) PDMDevHlpMMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, 3238 3243 const char *pszDesc, PRTRCPTR pRCPtr) 3239 3244 { 3240 return pDevIns->pDevHlp ->pfnMMHyperMapMMIO2(pDevIns, iRegion, off, cb, pszDesc, pRCPtr);3241 } 3242 3243 /** 3244 * @copydoc PDMDEVHLP ::pfnRegisterVMMDevHeap3245 return pDevIns->pDevHlpR3->pfnMMHyperMapMMIO2(pDevIns, iRegion, off, cb, pszDesc, pRCPtr); 3246 } 3247 3248 /** 3249 * @copydoc PDMDEVHLPR3::pfnRegisterVMMDevHeap 3245 3250 */ 3246 3251 DECLINLINE(int) PDMDevHlpRegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize) 3247 3252 { 3248 return pDevIns->pDevHlp ->pfnRegisterVMMDevHeap(pDevIns, GCPhys, pvHeap, cbSize);3249 } 3250 3251 /** 3252 * @copydoc PDMDEVHLP ::pfnUnregisterVMMDevHeap3253 return pDevIns->pDevHlpR3->pfnRegisterVMMDevHeap(pDevIns, GCPhys, pvHeap, cbSize); 3254 } 3255 3256 /** 3257 * @copydoc PDMDEVHLPR3::pfnUnregisterVMMDevHeap 3253 3258 */ 3254 3259 DECLINLINE(int) PDMDevHlpUnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys) 3255 3260 { 3256 return pDevIns->pDevHlp ->pfnUnregisterVMMDevHeap(pDevIns, GCPhys);3257 } 3258 3259 /** 3260 * @copydoc PDMDEVHLP ::pfnSSMRegister3261 return pDevIns->pDevHlpR3->pfnUnregisterVMMDevHeap(pDevIns, GCPhys); 3262 } 3263 3264 /** 3265 * @copydoc PDMDEVHLPR3::pfnSSMRegister 3261 3266 */ 3262 3267 DECLINLINE(int) PDMDevHlpSSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess, … … 3264 3269 PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone) 3265 3270 { 3266 return pDevIns->pDevHlp ->pfnSSMRegister(pDevIns, pszName, u32Instance, u32Version, cbGuess,3271 return pDevIns->pDevHlpR3->pfnSSMRegister(pDevIns, pszName, u32Instance, u32Version, cbGuess, 3267 3272 pfnSavePrep, pfnSaveExec, pfnSaveDone, 3268 3273 pfnLoadPrep, pfnLoadExec, pfnLoadDone); … … 3270 3275 3271 3276 /** 3272 * @copydoc PDMDEVHLP ::pfnTMTimerCreate3277 * @copydoc PDMDEVHLPR3::pfnTMTimerCreate 3273 3278 */ 3274 3279 DECLINLINE(int) PDMDevHlpTMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer) 3275 3280 { 3276 return pDevIns->pDevHlp ->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pszDesc, ppTimer);3277 } 3278 3279 /** 3280 * @copydoc PDMDEVHLP ::pfnPCIRegister3281 return pDevIns->pDevHlpR3->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pszDesc, ppTimer); 3282 } 3283 3284 /** 3285 * @copydoc PDMDEVHLPR3::pfnPCIRegister 3281 3286 */ 3282 3287 DECLINLINE(int) PDMDevHlpPCIRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev) 3283 3288 { 3284 return pDevIns->pDevHlp ->pfnPCIRegister(pDevIns, pPciDev);3285 } 3286 3287 /** 3288 * @copydoc PDMDEVHLP ::pfnPCIIORegionRegister3289 return pDevIns->pDevHlpR3->pfnPCIRegister(pDevIns, pPciDev); 3290 } 3291 3292 /** 3293 * @copydoc PDMDEVHLPR3::pfnPCIIORegionRegister 3289 3294 */ 3290 3295 DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback) 3291 3296 { 3292 return pDevIns->pDevHlp ->pfnPCIIORegionRegister(pDevIns, iRegion, cbRegion, enmType, pfnCallback);3293 } 3294 3295 /** 3296 * @copydoc PDMDEVHLP ::pfnPCISetConfigCallbacks3297 return pDevIns->pDevHlpR3->pfnPCIIORegionRegister(pDevIns, iRegion, cbRegion, enmType, pfnCallback); 3298 } 3299 3300 /** 3301 * @copydoc PDMDEVHLPR3::pfnPCISetConfigCallbacks 3297 3302 */ 3298 3303 DECLINLINE(void) PDMDevHlpPCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld, 3299 3304 PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld) 3300 3305 { 3301 pDevIns->pDevHlp ->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);3302 } 3303 3304 /** 3305 * @copydoc PDMDEVHLP ::pfnDriverAttach3306 pDevIns->pDevHlpR3->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld); 3307 } 3308 3309 /** 3310 * @copydoc PDMDEVHLPR3::pfnDriverAttach 3306 3311 */ 3307 3312 DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc) 3308 3313 { 3309 return pDevIns->pDevHlp ->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);3310 } 3311 3312 /** 3313 * @copydoc PDMDEVHLP ::pfnMMHeapAlloc3314 return pDevIns->pDevHlpR3->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc); 3315 } 3316 3317 /** 3318 * @copydoc PDMDEVHLPR3::pfnMMHeapAlloc 3314 3319 */ 3315 3320 DECLINLINE(void *) PDMDevHlpMMHeapAlloc(PPDMDEVINS pDevIns, size_t cb) 3316 3321 { 3317 return pDevIns->pDevHlp ->pfnMMHeapAlloc(pDevIns, cb);3318 } 3319 3320 /** 3321 * @copydoc PDMDEVHLP ::pfnMMHeapAllocZ3322 return pDevIns->pDevHlpR3->pfnMMHeapAlloc(pDevIns, cb); 3323 } 3324 3325 /** 3326 * @copydoc PDMDEVHLPR3::pfnMMHeapAllocZ 3322 3327 */ 3323 3328 DECLINLINE(void *) PDMDevHlpMMHeapAllocZ(PPDMDEVINS pDevIns, size_t cb) 3324 3329 { 3325 return pDevIns->pDevHlp ->pfnMMHeapAllocZ(pDevIns, cb);3326 } 3327 3328 /** 3329 * @copydoc PDMDEVHLP ::pfnMMHeapFree3330 return pDevIns->pDevHlpR3->pfnMMHeapAllocZ(pDevIns, cb); 3331 } 3332 3333 /** 3334 * @copydoc PDMDEVHLPR3::pfnMMHeapFree 3330 3335 */ 3331 3336 DECLINLINE(void) PDMDevHlpMMHeapFree(PPDMDEVINS pDevIns, void *pv) 3332 3337 { 3333 pDevIns->pDevHlp ->pfnMMHeapFree(pDevIns, pv);3334 } 3335 3336 /** 3337 * @copydoc PDMDEVHLP ::pfnDBGFInfoRegister3338 pDevIns->pDevHlpR3->pfnMMHeapFree(pDevIns, pv); 3339 } 3340 3341 /** 3342 * @copydoc PDMDEVHLPR3::pfnDBGFInfoRegister 3338 3343 */ 3339 3344 DECLINLINE(int) PDMDevHlpDBGFInfoRegister(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler) 3340 3345 { 3341 return pDevIns->pDevHlp ->pfnDBGFInfoRegister(pDevIns, pszName, pszDesc, pfnHandler);3342 } 3343 3344 /** 3345 * @copydoc PDMDEVHLP ::pfnSTAMRegister3346 return pDevIns->pDevHlpR3->pfnDBGFInfoRegister(pDevIns, pszName, pszDesc, pfnHandler); 3347 } 3348 3349 /** 3350 * @copydoc PDMDEVHLPR3::pfnSTAMRegister 3346 3351 */ 3347 3352 DECLINLINE(void) PDMDevHlpSTAMRegister(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc) 3348 3353 { 3349 pDevIns->pDevHlp ->pfnSTAMRegister(pDevIns, pvSample, enmType, pszName, enmUnit, pszDesc);3350 } 3351 3352 /** 3353 * @copydoc PDMDEVHLP ::pfnSTAMRegisterF3354 pDevIns->pDevHlpR3->pfnSTAMRegister(pDevIns, pvSample, enmType, pszName, enmUnit, pszDesc); 3355 } 3356 3357 /** 3358 * @copydoc PDMDEVHLPR3::pfnSTAMRegisterF 3354 3359 */ 3355 3360 DECLINLINE(void) PDMDevHlpSTAMRegisterF(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit, … … 3358 3363 va_list va; 3359 3364 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); 3361 3366 va_end(va); 3362 3367 } 3363 3368 3364 3369 /** 3365 * @copydoc PDMDEVHLP ::pfnPDMQueueCreate3370 * @copydoc PDMDEVHLPR3::pfnPDMQueueCreate 3366 3371 */ 3367 3372 DECLINLINE(int) PDMDevHlpPDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 3368 3373 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue) 3369 3374 { 3370 return pDevIns->pDevHlp ->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue);3371 } 3372 3373 /** 3374 * @copydoc PDMDEVHLP ::pfnCritSectInit3375 return pDevIns->pDevHlpR3->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue); 3376 } 3377 3378 /** 3379 * @copydoc PDMDEVHLPR3::pfnCritSectInit 3375 3380 */ 3376 3381 DECLINLINE(int) PDMDevHlpCritSectInit(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName) 3377 3382 { 3378 return pDevIns->pDevHlp ->pfnCritSectInit(pDevIns, pCritSect, pszName);3379 } 3380 3381 /** 3382 * @copydoc PDMDEVHLP ::pfnUTCNow3383 return pDevIns->pDevHlpR3->pfnCritSectInit(pDevIns, pCritSect, pszName); 3384 } 3385 3386 /** 3387 * @copydoc PDMDEVHLPR3::pfnUTCNow 3383 3388 */ 3384 3389 DECLINLINE(PRTTIMESPEC) PDMDevHlpUTCNow(PPDMDEVINS pDevIns, PRTTIMESPEC pTime) 3385 3390 { 3386 return pDevIns->pDevHlp ->pfnUTCNow(pDevIns, pTime);3387 } 3388 3389 /** 3390 * @copydoc PDMDEVHLP ::pfnGetVM3391 return pDevIns->pDevHlpR3->pfnUTCNow(pDevIns, pTime); 3392 } 3393 3394 /** 3395 * @copydoc PDMDEVHLPR3::pfnGetVM 3391 3396 */ 3392 3397 DECLINLINE(PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns) 3393 3398 { 3394 return pDevIns->pDevHlp ->pfnGetVM(pDevIns);3395 } 3396 3397 /** 3398 * @copydoc PDMDEVHLP ::pfnPhysReadGCVirt3399 return pDevIns->pDevHlpR3->pfnGetVM(pDevIns); 3400 } 3401 3402 /** 3403 * @copydoc PDMDEVHLPR3::pfnPhysReadGCVirt 3399 3404 */ 3400 3405 DECLINLINE(int) PDMDevHlpPhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb) 3401 3406 { 3402 return pDevIns->pDevHlp ->pfnPhysReadGCVirt(pDevIns, pvDst, GCVirtSrc, cb);3403 } 3404 3405 /** 3406 * @copydoc PDMDEVHLP ::pfnPhysWriteGCVirt3407 return pDevIns->pDevHlpR3->pfnPhysReadGCVirt(pDevIns, pvDst, GCVirtSrc, cb); 3408 } 3409 3410 /** 3411 * @copydoc PDMDEVHLPR3::pfnPhysWriteGCVirt 3407 3412 */ 3408 3413 DECLINLINE(int) PDMDevHlpPhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb) 3409 3414 { 3410 return pDevIns->pDevHlp ->pfnPhysWriteGCVirt(pDevIns, GCVirtDst, pvSrc, cb);3411 } 3412 3413 /** 3414 * @copydoc PDMDEVHLP ::pfnPhysReserve3415 return pDevIns->pDevHlpR3->pfnPhysWriteGCVirt(pDevIns, GCVirtDst, pvSrc, cb); 3416 } 3417 3418 /** 3419 * @copydoc PDMDEVHLPR3::pfnPhysReserve 3415 3420 */ 3416 3421 DECLINLINE(int) PDMDevHlpPhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc) 3417 3422 { 3418 return pDevIns->pDevHlp ->pfnPhysReserve(pDevIns, GCPhys, cbRange, pszDesc);3419 } 3420 3421 /** 3422 * @copydoc PDMDEVHLP ::pfnPhysGCPtr2GCPhys3423 return pDevIns->pDevHlpR3->pfnPhysReserve(pDevIns, GCPhys, cbRange, pszDesc); 3424 } 3425 3426 /** 3427 * @copydoc PDMDEVHLPR3::pfnPhysGCPtr2GCPhys 3423 3428 */ 3424 3429 DECLINLINE(int) PDMDevHlpPhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys) 3425 3430 { 3426 return pDevIns->pDevHlp ->pfnPhysGCPtr2GCPhys(pDevIns, GCPtr, pGCPhys);3427 } 3428 3429 /** 3430 * @copydoc PDMDEVHLP ::pfnVMState3431 return pDevIns->pDevHlpR3->pfnPhysGCPtr2GCPhys(pDevIns, GCPtr, pGCPhys); 3432 } 3433 3434 /** 3435 * @copydoc PDMDEVHLPR3::pfnVMState 3431 3436 */ 3432 3437 DECLINLINE(VMSTATE) PDMDevHlpVMState(PPDMDEVINS pDevIns) 3433 3438 { 3434 return pDevIns->pDevHlp ->pfnVMState(pDevIns);3435 } 3436 3437 /** 3438 * @copydoc PDMDEVHLP ::pfnA20Set3439 return pDevIns->pDevHlpR3->pfnVMState(pDevIns); 3440 } 3441 3442 /** 3443 * @copydoc PDMDEVHLPR3::pfnA20Set 3439 3444 */ 3440 3445 DECLINLINE(void) PDMDevHlpA20Set(PPDMDEVINS pDevIns, bool fEnable) 3441 3446 { 3442 pDevIns->pDevHlp ->pfnA20Set(pDevIns, fEnable);3443 } 3444 3445 /** 3446 * @copydoc PDMDEVHLP ::pfnVMReset3447 pDevIns->pDevHlpR3->pfnA20Set(pDevIns, fEnable); 3448 } 3449 3450 /** 3451 * @copydoc PDMDEVHLPR3::pfnVMReset 3447 3452 */ 3448 3453 DECLINLINE(int) PDMDevHlpVMReset(PPDMDEVINS pDevIns) 3449 3454 { 3450 return pDevIns->pDevHlp ->pfnVMReset(pDevIns);3451 } 3452 3453 /** 3454 * @copydoc PDMDEVHLP ::pfnVMSuspend3455 return pDevIns->pDevHlpR3->pfnVMReset(pDevIns); 3456 } 3457 3458 /** 3459 * @copydoc PDMDEVHLPR3::pfnVMSuspend 3455 3460 */ 3456 3461 DECLINLINE(int) PDMDevHlpVMSuspend(PPDMDEVINS pDevIns) 3457 3462 { 3458 return pDevIns->pDevHlp ->pfnVMSuspend(pDevIns);3459 } 3460 3461 /** 3462 * @copydoc PDMDEVHLP ::pfnVMPowerOff3463 return pDevIns->pDevHlpR3->pfnVMSuspend(pDevIns); 3464 } 3465 3466 /** 3467 * @copydoc PDMDEVHLPR3::pfnVMPowerOff 3463 3468 */ 3464 3469 DECLINLINE(int) PDMDevHlpVMPowerOff(PPDMDEVINS pDevIns) 3465 3470 { 3466 return pDevIns->pDevHlp ->pfnVMPowerOff(pDevIns);3467 } 3468 3469 /** 3470 * @copydoc PDMDEVHLP ::pfnDMARegister3471 return pDevIns->pDevHlpR3->pfnVMPowerOff(pDevIns); 3472 } 3473 3474 /** 3475 * @copydoc PDMDEVHLPR3::pfnDMARegister 3471 3476 */ 3472 3477 DECLINLINE(int) PDMDevHlpDMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser) 3473 3478 { 3474 return pDevIns->pDevHlp ->pfnDMARegister(pDevIns, uChannel, pfnTransferHandler, pvUser);3475 } 3476 3477 /** 3478 * @copydoc PDMDEVHLP ::pfnDMAReadMemory3479 return pDevIns->pDevHlpR3->pfnDMARegister(pDevIns, uChannel, pfnTransferHandler, pvUser); 3480 } 3481 3482 /** 3483 * @copydoc PDMDEVHLPR3::pfnDMAReadMemory 3479 3484 */ 3480 3485 DECLINLINE(int) PDMDevHlpDMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead) 3481 3486 { 3482 return pDevIns->pDevHlp ->pfnDMAReadMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbRead);3483 } 3484 3485 /** 3486 * @copydoc PDMDEVHLP ::pfnDMAWriteMemory3487 return pDevIns->pDevHlpR3->pfnDMAReadMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbRead); 3488 } 3489 3490 /** 3491 * @copydoc PDMDEVHLPR3::pfnDMAWriteMemory 3487 3492 */ 3488 3493 DECLINLINE(int) PDMDevHlpDMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten) 3489 3494 { 3490 return pDevIns->pDevHlp ->pfnDMAWriteMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbWritten);3491 } 3492 3493 /** 3494 * @copydoc PDMDEVHLP ::pfnDMASetDREQ3495 return pDevIns->pDevHlpR3->pfnDMAWriteMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbWritten); 3496 } 3497 3498 /** 3499 * @copydoc PDMDEVHLPR3::pfnDMASetDREQ 3495 3500 */ 3496 3501 DECLINLINE(int) PDMDevHlpDMASetDREQ(PPDMDEVINS pDevIns, unsigned uChannel, unsigned uLevel) 3497 3502 { 3498 return pDevIns->pDevHlp ->pfnDMASetDREQ(pDevIns, uChannel, uLevel);3499 } 3500 3501 /** 3502 * @copydoc PDMDEVHLP ::pfnDMAGetChannelMode3503 return pDevIns->pDevHlpR3->pfnDMASetDREQ(pDevIns, uChannel, uLevel); 3504 } 3505 3506 /** 3507 * @copydoc PDMDEVHLPR3::pfnDMAGetChannelMode 3503 3508 */ 3504 3509 DECLINLINE(uint8_t) PDMDevHlpDMAGetChannelMode(PPDMDEVINS pDevIns, unsigned uChannel) 3505 3510 { 3506 return pDevIns->pDevHlp ->pfnDMAGetChannelMode(pDevIns, uChannel);3507 } 3508 3509 /** 3510 * @copydoc PDMDEVHLP ::pfnDMASchedule3511 return pDevIns->pDevHlpR3->pfnDMAGetChannelMode(pDevIns, uChannel); 3512 } 3513 3514 /** 3515 * @copydoc PDMDEVHLPR3::pfnDMASchedule 3511 3516 */ 3512 3517 DECLINLINE(void) PDMDevHlpDMASchedule(PPDMDEVINS pDevIns) 3513 3518 { 3514 pDevIns->pDevHlp ->pfnDMASchedule(pDevIns);3515 } 3516 3517 /** 3518 * @copydoc PDMDEVHLP ::pfnCMOSWrite3519 pDevIns->pDevHlpR3->pfnDMASchedule(pDevIns); 3520 } 3521 3522 /** 3523 * @copydoc PDMDEVHLPR3::pfnCMOSWrite 3519 3524 */ 3520 3525 DECLINLINE(int) PDMDevHlpCMOSWrite(PPDMDEVINS pDevIns, unsigned iReg, uint8_t u8Value) 3521 3526 { 3522 return pDevIns->pDevHlp ->pfnCMOSWrite(pDevIns, iReg, u8Value);3523 } 3524 3525 /** 3526 * @copydoc PDMDEVHLP ::pfnCMOSRead3527 return pDevIns->pDevHlpR3->pfnCMOSWrite(pDevIns, iReg, u8Value); 3528 } 3529 3530 /** 3531 * @copydoc PDMDEVHLPR3::pfnCMOSRead 3527 3532 */ 3528 3533 DECLINLINE(int) PDMDevHlpCMOSRead(PPDMDEVINS pDevIns, unsigned iReg, uint8_t *pu8Value) 3529 3534 { 3530 return pDevIns->pDevHlp ->pfnCMOSRead(pDevIns, iReg, pu8Value);3531 } 3532 3533 /** 3534 * @copydoc PDMDEVHLP ::pfnGetCpuId3535 return pDevIns->pDevHlpR3->pfnCMOSRead(pDevIns, iReg, pu8Value); 3536 } 3537 3538 /** 3539 * @copydoc PDMDEVHLPR3::pfnGetCpuId 3535 3540 */ 3536 3541 DECLINLINE(void) PDMDevHlpGetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx) 3537 3542 { 3538 pDevIns->pDevHlp ->pfnGetCpuId(pDevIns, iLeaf, pEax, pEbx, pEcx, pEdx);3539 } 3540 3541 /** 3542 * @copydoc PDMDEVHLP ::pfnPDMThreadCreate3543 pDevIns->pDevHlpR3->pfnGetCpuId(pDevIns, iLeaf, pEax, pEbx, pEcx, pEdx); 3544 } 3545 3546 /** 3547 * @copydoc PDMDEVHLPR3::pfnPDMThreadCreate 3543 3548 */ 3544 3549 DECLINLINE(int) PDMDevHlpPDMThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread, 3545 3550 PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName) 3546 3551 { 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); 3548 3553 } 3549 3554 #endif /* IN_RING3 */ … … 3551 3556 3552 3557 /** 3553 * @copydoc PDMDEVHLP ::pfnPCISetIrq3558 * @copydoc PDMDEVHLPR3::pfnPCISetIrq 3554 3559 */ 3555 3560 DECLINLINE(void) PDMDevHlpPCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel) 3556 3561 { 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 3568 3567 */ 3569 3568 DECLINLINE(void) PDMDevHlpPCISetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel) 3570 3569 { 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 3582 3575 */ 3583 3576 DECLINLINE(void) PDMDevHlpISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel) 3584 3577 { 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 3596 3583 */ 3597 3584 DECLINLINE(void) PDMDevHlpISASetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel) 3598 3585 { 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 3610 3591 */ 3611 3592 DECLINLINE(void) PDMDevHlpPhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 3612 3593 { 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 3624 3599 */ 3625 3600 DECLINLINE(void) PDMDevHlpPhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 3626 3601 { 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 3638 3607 */ 3639 3608 DECLINLINE(bool) PDMDevHlpA20IsEnabled(PPDMDEVINS pDevIns) 3640 3609 { 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 3652 3615 */ 3653 3616 DECLINLINE(int) PDMDevHlpVMSetError(PPDMDEVINS pDevIns, const int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) … … 3655 3618 va_list va; 3656 3619 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); 3664 3621 va_end(va); 3665 3622 return rc; … … 3667 3624 3668 3625 /** 3669 * @copydoc PDMDEVHLP ::pfnVMSetRuntimeError3626 * @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError 3670 3627 */ 3671 3628 DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...) … … 3674 3631 int rc; 3675 3632 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); 3683 3634 va_end(va); 3684 3635 return rc; -
trunk/include/VBox/pdmins.h
r12653 r12970 53 53 * Converts a PDM Device, USB Device, or Driver instance pointer to a RC pointer to the instance data. 54 54 */ 55 #define PDMINS_2_DATA_RCPTR(pIns) ( (pIns)->pvInstanceData GC )55 #define PDMINS_2_DATA_RCPTR(pIns) ( (pIns)->pvInstanceDataRC ) 56 56 57 57 /** @def PDMINS_2_DATA_R3PTR
Note:
See TracChangeset
for help on using the changeset viewer.