VirtualBox

Changeset 2268 in vbox


Ignore:
Timestamp:
Apr 20, 2007 12:57:49 PM (18 years ago)
Author:
vboxsync
Message:

Stricter pointer typechecking. (R0 vs R3)

Location:
trunk/include/VBox
Files:
4 edited

Legend:

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

    r2225 r2268  
    230230 * @param   pszDesc             Pointer to description string. This must not be freed.
    231231 */
    232 IOMDECL(int)  IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
    233                                   HCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, HCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
    234                                   HCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, HCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
     232IOMDECL(int)  IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
     233                                  R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
     234                                  R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
    235235                                  const char *pszDesc);
    236236
     
    254254 * @param   pszDesc             Pointer to description string. This must not be freed.
    255255 */
    256 IOMDECL(int)  IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    257                                 HCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, HCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
    258                                 HCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc);
     256IOMDECL(int)  IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     257                                R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
     258                                R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc);
    259259
    260260
  • trunk/include/VBox/mm.h

    r1480 r2268  
    419419#endif
    420420
    421 
    422421/**
    423422 * Converts a HC address in the Hypervisor memory region to a GC address.
  • trunk/include/VBox/pdm.h

    r2246 r2268  
    45014501     * @param   pszDesc             Pointer to description string. This must not be freed.
    45024502     */
    4503     DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterR0,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
     4503    DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterR0,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
    45044504                                                   const char *pszOut, const char *pszIn,
    45054505                                                   const char *pszOutStr, const char *pszInStr, const char *pszDesc));
     
    45764576     * @param   pszDesc             Pointer to description string. This must not be freed.
    45774577     */
    4578     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     4578    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    45794579                                                 const char *pszWrite, const char *pszRead, const char *pszFill,
    45804580                                                 const char *pszDesc));
     
    54995499
    55005500    /** Pointer the HC PDM Device API. */
    5501     HCPTRTYPE(PCPDMDEVHLP)      pDevHlp;
     5501    R3PTRTYPE(PCPDMDEVHLP)      pDevHlp;
    55025502    /** Pointer the R0 PDM Device API. */
    55035503    R0PTRTYPE(PCPDMDEVHLPR0)    pDevHlpR0;
    55045504    /** Pointer to device registration structure.  */
    5505     HCPTRTYPE(PCPDMDEVREG)      pDevReg;
     5505    R3PTRTYPE(PCPDMDEVREG)      pDevReg;
    55065506    /** Configuration handle. */
    5507     HCPTRTYPE(PCFGMNODE)        pCfgHandle;
     5507    R3PTRTYPE(PCFGMNODE)        pCfgHandle;
    55085508    /** Pointer to device instance data. */
    5509     HCPTRTYPE(void *)           pvInstanceDataHC;
     5509    R3PTRTYPE(void *)           pvInstanceDataR3;
     5510    /** Pointer to device instance data. */
     5511    R0PTRTYPE(void *)           pvInstanceDataR0;
    55105512    /** Pointer the GC PDM Device API. */
    55115513    GCPTRTYPE(PCPDMDEVHLPGC)    pDevHlpGC;
     
    55145516#if HC_ARCH_BITS == 32
    55155517    /* padding to make achInstanceData aligned at 16 byte boundrary. */
    5516     uint32_t                    au32Padding[HC_ARCH_BITS == 32 ? 2 : 0];
     5518    uint32_t                    au32Padding[HC_ARCH_BITS == 32 ? 1 : 0];
    55175519#endif
    55185520    /** Device instance data. The size of this area is defined
     
    55725574#define PDMINS2DATA_GCPTR(pIns)     ( (pIns)->pvInstanceDataGC )
    55735575
    5574 /** @def PDMINS2DATA_HCPTR
     5576/** @def PDMINS2DATA_R3PTR
    55755577 * Converts a PDM Device or Driver instance pointer to a HC pointer to the instance data.
    55765578 */
    5577 #define PDMINS2DATA_HCPTR(pIns)     ( (pIns)->pvInstanceDataHC )
     5579#define PDMINS2DATA_R3PTR(pIns)     ( (pIns)->pvInstanceDataR3 )
     5580
     5581 /** @def PDMINS2DATA_R0PTR
     5582 * Converts a PDM Device or Driver instance pointer to a R0 pointer to the instance data.
     5583 */
     5584#define PDMINS2DATA_R0PTR(pIns)     ( (pIns)->pvInstanceDataR0 )
    55785585
    55795586/** @def PDMDEVINS_2_GCPTR
     
    55825589#define PDMDEVINS_2_GCPTR(pDevIns)  ( (GCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataGC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
    55835590
    5584 /** @def PDMDEVINS_2_HCPTR
     5591/** @def PDMDEVINS_2_R3PTR
    55855592 * Converts a PDM Device instance pointer a HC PDM Device instance pointer.
    55865593 */
    5587 #define PDMDEVINS_2_HCPTR(pDevIns)  ( (HCPTRTYPE(PPDMDEVINS))((RTHCUINTPTR)(pDevIns)->pvInstanceDataHC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
     5594#define PDMDEVINS_2_R3PTR(pDevIns)  ( (HCPTRTYPE(PPDMDEVINS))((RTHCUINTPTR)(pDevIns)->pvInstanceDataR3 - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
     5595
     5596/** @def PDMDEVINS_2_R0PTR
     5597 * Converts a PDM Device instance pointer a R0 PDM Device instance pointer.
     5598 */
     5599#define PDMDEVINS_2_R0PTR(pDevIns)  ( (R0PTRTYPE(PPDMDEVINS))((RTR0UINTPTR)(pDevIns)->pvInstanceDataR0 - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
    55885600
    55895601
     
    56405652 * @copydoc PDMDEVHLP::pfnIOPortRegisterR0
    56415653 */
    5642 DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
     5654DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
    56435655                                          const char *pszOut, const char *pszIn, const char *pszOutStr,
    56445656                                          const char *pszInStr, const char *pszDesc)
     
    56695681 * @copydoc PDMDEVHLP::pfnMMIORegisterR0
    56705682 */
    5671 DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     5683DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    56725684                                        const char *pszWrite, const char *pszRead, const char *pszFill, const char *pszDesc)
    56735685{
  • trunk/include/VBox/pgm.h

    r1832 r2268  
    619619 */
    620620PGMDECL(int) PGMHandlerPhysicalRegisterEx(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS GCPhysLast,
    621                                           HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTHCPTR pvUserR3,
    622                                           R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTHCPTR pvUserR0,
     621                                          R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTR3PTR pvUserR3,
     622                                          R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTR0PTR pvUserR0,
    623623                                          GCPTRTYPE(PFNPGMGCPHYSHANDLER) pfnHandlerGC, RTGCPTR pvUserGC,
    624                                           HCPTRTYPE(const char *) pszDesc);
     624                                          R3PTRTYPE(const char *) pszDesc);
    625625
    626626/**
     
    664664 */
    665665PGMDECL(int) PGMHandlerPhysicalChangeCallbacks(PVM pVM, RTGCPHYS GCPhys,
    666                                                HCPTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTHCPTR pvUserR3,
    667                                                R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTHCPTR pvUserR0,
     666                                               R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3, RTR3PTR pvUserR3,
     667                                               R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0, RTR0PTR pvUserR0,
    668668                                               GCPTRTYPE(PFNPGMGCPHYSHANDLER) pfnHandlerGC, RTGCPTR pvUserGC,
    669                                                HCPTRTYPE(const char *) pszDesc);
     669                                               R3PTRTYPE(const char *) pszDesc);
    670670
    671671/**
     
    14471447PGMR3DECL(int) PGMR3HandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS GCPhysLast,
    14481448                                            PFNPGMR3PHYSHANDLER pfnHandlerR3, void *pvUserR3,
    1449                                             const char *pszModR0, const char *pszHandlerR0, RTHCPTR pvUserR0,
     1449                                            const char *pszModR0, const char *pszHandlerR0, RTR0PTR pvUserR0,
    14501450                                            const char *pszModGC, const char *pszHandlerGC, RTGCPTR pvUserGC, const char *pszDesc);
    14511451
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