VirtualBox

Changeset 4416 in vbox


Ignore:
Timestamp:
Aug 29, 2007 9:02:17 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23988
Message:

Backed out 23986

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r4414 r4416  
    281281DECLINLINE(int) emRamRead(PVM pVM, void *pDest, RTGCPTR GCSrc, uint32_t cb)
    282282{
    283 #ifdef IN_GC
    284     int rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
     283    int rc;
     284#ifdef IN_GC
     285    rc = MMGCRamRead(pVM, pDest, GCSrc, cb);
    285286    if (RT_LIKELY(rc != VERR_ACCESS_DENIED))
    286287        return rc;
     
    290291     * instruction and it either flushed the TLB or the CPU reused it.
    291292     */
     293#endif
    292294    RTGCPHYS    GCPhys;
    293295    RTGCUINTPTR offset;
     
    299301    PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
    300302    return VINF_SUCCESS;
    301 #else
    302     return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
    303 #endif
    304303}
    305304
     
    330329
    331330#else
    332     return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
     331
     332    int         rc;
     333    RTGCPHYS    GCPhys;
     334    RTGCUINTPTR offset;
     335
     336    offset = GCDest & PAGE_OFFSET_MASK;
     337    rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
     338    AssertRCReturn(rc, rc);
     339    PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
     340    return VINF_SUCCESS;
    333341#endif
    334342}
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r4414 r4416  
    461461    return MMGCRamReadNoTrapHandler(pDest, GCSrc, cb);
    462462#else
    463     return PGMPhysReadGCPtrSafe(pVM, pDest, GCSrc, cb);
     463    int         rc;
     464    RTGCPHYS    GCPhys;
     465    RTGCUINTPTR offset;
     466
     467    offset = GCSrc & PAGE_OFFSET_MASK;
     468
     469    /** @todo optimize the loop; no need to convert the address all the time */
     470    rc = PGMPhysGCPtr2GCPhys(pVM, GCSrc, &GCPhys);
     471    AssertRCReturn(rc, rc);
     472    PGMPhysRead(pVM, GCPhys + offset, pDest, cb);
     473    return VINF_SUCCESS;
    464474#endif
    465475}
     
    470480    return MMGCRamWriteNoTrapHandler(GCDest, pSrc, cb);
    471481#else
    472     return PGMPhysWriteGCPtrSafe(pVM, GCDest, pSrc, cb);
     482    int         rc;
     483    RTGCPHYS    GCPhys;
     484    RTGCUINTPTR offset;
     485
     486    /** @todo optimize the loop; no need to convert the address all the time */
     487    offset = GCDest & PAGE_OFFSET_MASK;
     488    rc = PGMPhysGCPtr2GCPhys(pVM, GCDest, &GCPhys);
     489    AssertRCReturn(rc, rc);
     490    PGMPhysWrite(pVM, GCPhys + offset, pSrc, cb);
     491    return VINF_SUCCESS;
    473492#endif
    474493}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette