VirtualBox

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

Stricter pointer typechecking. (R0 vs R3)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IOMAll.cpp

    r2230 r2270  
    435435        pRange->pfnWriteCallback= pfnWriteCallback;
    436436        pRange->pfnFillCallback = pfnFillCallback;
    437         #ifdef IN_GC
     437#ifdef IN_GC
    438438        pRange->pDevIns         = pDevIns;
    439439        pRange->pszDesc         = MMHyperGC2HC(pVM, (void *)pszDesc);
    440         #else
     440#else
    441441        pRange->pDevIns         = MMHyperHC2GC(pVM, pDevIns);
    442442        pRange->pszDesc         = pszDesc;
    443         #endif
     443#endif
    444444
    445445        /*
     
    478478 * @param   pszDesc             Pointer to description string. This must not be freed.
    479479 */
    480 IOMDECL(int)  IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
    481                                   HCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, HCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
    482                                   HCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, HCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
     480IOMDECL(int)  IOMIOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
     481                                  R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
     482                                  R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
    483483                                  const char *pszDesc)
    484484{
     
    548548        pRange->pfnInStrCallback = pfnInStrCallback;
    549549#ifdef IN_GC
    550         pRange->pDevIns         = MMHyperGC2HC(pVM, pDevIns);
    551         pRange->pszDesc         = MMHyperGC2HC(pVM, (void *)pszDesc);
     550        pRange->pDevIns         = MMHyperGCToR0(pVM, pDevIns);
     551        pRange->pszDesc         = MMHyperGCToR3(pVM, (void *)pszDesc);
     552#elif defined(IN_RING3)
     553        pRange->pDevIns         = MMHyperR3ToR0(pVM, pDevIns);
     554        pRange->pszDesc         = pszDesc;
    552555#else
    553556        pRange->pDevIns         = pDevIns;
    554         pRange->pszDesc         = pszDesc;
     557        pRange->pszDesc         = MMHyperR0ToR3(pVM, (RTR0PTR)pszDesc);
    555558#endif
    556559
     
    590593 * @param   pszDesc             Pointer to description string. This must not be freed.
    591594 */
    592 IOMDECL(int)  IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    593                                 HCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, HCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
    594                                 HCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc)
     595IOMDECL(int)  IOMMMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     596                                R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
     597                                R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc)
    595598{
    596599    LogFlow(("IOMMMIORegisterR0: pDevIns=%p GCPhysStart=%#x cbRange=%#x pvUser=%VHv pfnWriteCallback=%#x pfnReadCallback=%#x pfnFillCallback=%#x pszDesc=%s\n",
     
    658661        pRange->pfnFillCallback = pfnFillCallback;
    659662#ifdef IN_GC
    660         pRange->pDevIns         = MMHyperGC2HC(pVM, pDevIns);
    661         pRange->pszDesc         = MMHyperGC2HC(pVM, (void *)pszDesc);
     663        pRange->pDevIns         = MMHyperGCToR0(pVM, pDevIns);
     664        pRange->pszDesc         = MMHyperGCToR3(pVM, (void *)pszDesc);
     665#elif defined(IN_RING3)
     666        pRange->pDevIns         = MMHyperR3ToR0(pVM, pDevIns);
     667        pRange->pszDesc         = pszDesc;
    662668#else
    663669        pRange->pDevIns         = pDevIns;
    664         pRange->pszDesc         = pszDesc;
     670        pRange->pszDesc         = MMHyperR0ToR3(pVM, (RTR0PTR)pszDesc);
    665671#endif
    666672
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