VirtualBox

Changeset 36490 in vbox


Ignore:
Timestamp:
Apr 1, 2011 12:16:47 PM (14 years ago)
Author:
vboxsync
Message:

rem: Use cpu_register_physical_memory_offset instead of cpu_register_physical_memory so we can specify region_offset to be the same the memory address. This avoids having to hack region_offset usage in exec.c.

Location:
trunk/src/recompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxRecompiler.c

    r36430 r36490  
    31463146
    31473147    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    3148     cpu_register_physical_memory(GCPhys, cb, GCPhys);
     3148    cpu_register_physical_memory_offset(GCPhys, cb, GCPhys, GCPhys);
    31493149    PDMCritSectLeave(&pVM->rem.s.CritSectRegister);
    31503150
     
    31823182
    31833183    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    3184     cpu_register_physical_memory(GCPhys, cb, GCPhys | (fShadow ? 0 : IO_MEM_ROM));
     3184    cpu_register_physical_memory_offset(GCPhys, cb, GCPhys | (fShadow ? 0 : IO_MEM_ROM), GCPhys);
    31853185    PDMCritSectLeave(&pVM->rem.s.CritSectRegister);
    31863186
     
    32143214
    32153215    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    3216     cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
     3216    cpu_register_physical_memory_offset(GCPhys, cb, IO_MEM_UNASSIGNED, GCPhys);
    32173217    PDMCritSectLeave(&pVM->rem.s.CritSectRegister);
    32183218
     
    32473247    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    32483248    if (enmType == PGMPHYSHANDLERTYPE_MMIO)
    3249         cpu_register_physical_memory(GCPhys, cb, pVM->rem.s.iMMIOMemType);
     3249        cpu_register_physical_memory_offset(GCPhys, cb, pVM->rem.s.iMMIOMemType, GCPhys);
    32503250    else if (fHasHCHandler)
    3251         cpu_register_physical_memory(GCPhys, cb, pVM->rem.s.iHandlerMemType);
     3251        cpu_register_physical_memory_offset(GCPhys, cb, pVM->rem.s.iHandlerMemType, GCPhys);
    32523252    PDMCritSectLeave(&pVM->rem.s.CritSectRegister);
    32533253
     
    32963296    /** @todo this isn't right, MMIO can (in theory) be restored as RAM. */
    32973297    if (enmType == PGMPHYSHANDLERTYPE_MMIO)
    3298         cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
     3298        cpu_register_physical_memory_offset(GCPhys, cb, IO_MEM_UNASSIGNED, GCPhys);
    32993299    else if (fHasHCHandler)
    33003300    {
     
    33023302        {
    33033303            Assert(GCPhys > MMR3PhysGetRamSize(pVM));
    3304             cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
     3304            cpu_register_physical_memory_offset(GCPhys, cb, IO_MEM_UNASSIGNED, GCPhys);
    33053305        }
    33063306        else
     
    33083308            Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys);
    33093309            Assert(RT_ALIGN_T(cb, PAGE_SIZE, RTGCPHYS) == cb);
    3310             cpu_register_physical_memory(GCPhys, cb, GCPhys);
     3310            cpu_register_physical_memory_offset(GCPhys, cb, GCPhys, GCPhys);
    33113311        }
    33123312    }
     
    33603360        PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    33613361        if (!fRestoreAsRAM)
    3362             cpu_register_physical_memory(GCPhysOld, cb, IO_MEM_UNASSIGNED);
     3362            cpu_register_physical_memory_offset(GCPhysOld, cb, IO_MEM_UNASSIGNED, GCPhysOld);
    33633363        else
    33643364        {
     
    33663366            Assert(cb == PAGE_SIZE);
    33673367            Assert(RT_ALIGN_T(GCPhysOld, PAGE_SIZE, RTGCPHYS) == GCPhysOld);
    3368             cpu_register_physical_memory(GCPhysOld, cb, GCPhysOld);
     3368            cpu_register_physical_memory_offset(GCPhysOld, cb, GCPhysOld, GCPhysOld);
    33693369        }
    33703370
     
    33743374        Assert(RT_ALIGN_T(GCPhysNew, PAGE_SIZE, RTGCPHYS) == GCPhysNew);
    33753375        Assert(RT_ALIGN_T(cb, PAGE_SIZE, RTGCPHYS) == cb);
    3376         cpu_register_physical_memory(GCPhysNew, cb, pVM->rem.s.iHandlerMemType);
     3376        cpu_register_physical_memory_offset(GCPhysNew, cb, pVM->rem.s.iHandlerMemType, GCPhysNew);
    33773377        PDMCritSectLeave(&pVM->rem.s.CritSectRegister);
    33783378
  • trunk/src/recompiler/exec.c

    r36250 r36490  
    23312331           IO_MEM_ROMD uses these as a ram address.  */
    23322332        iotlb = (pd & ~TARGET_PAGE_MASK);
    2333 #ifndef VBOX
    23342333        if (p) {
    2335 #else
    2336         if (   p
    2337             && p->phys_offset
    2338             && (pd & ~TARGET_PAGE_MASK) != env->pVM->rem.s.iMMIOMemType
    2339             && (pd & ~TARGET_PAGE_MASK) != env->pVM->rem.s.iHandlerMemType) {
    2340 #endif
    23412334            iotlb += p->region_offset;
    23422335        } else {
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