VirtualBox

Ignore:
Timestamp:
Apr 3, 2013 11:15:02 AM (12 years ago)
Author:
vboxsync
Message:

IOM: Adding pVCpu to a lot of calls and moving the lookup caches from VM to VMCPU.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IOMInline.h

    r45301 r45305  
    6363 *
    6464 * @param   pVM     Pointer to the VM.
    65  * @param   GCPhys  Physical address to lookup.
    66  */
    67 DECLINLINE(PIOMMMIORANGE) iomMmioGetRange(PVM pVM, RTGCPHYS GCPhys)
     65 * @param   pVCpu   Pointer to the virtual CPU structure of the caller.
     66 * @param   GCPhys  Physical address to lookup.
     67 */
     68DECLINLINE(PIOMMMIORANGE) iomMmioGetRange(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys)
    6869{
    6970    Assert(IOM_IS_SHARED_LOCK_OWNER(pVM));
    70     PIOMMMIORANGE pRange = pVM->iom.s.CTX_SUFF(pMMIORangeLast);
     71    PIOMMMIORANGE pRange = pVCpu->iom.s.CTX_SUFF(pMMIORangeLast);
    7172    if (    !pRange
    7273        ||  GCPhys - pRange->GCPhys >= pRange->cb)
    73         pVM->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
     74        pVCpu->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
    7475            = (PIOMMMIORANGE)RTAvlroGCPhysRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->MMIOTree, GCPhys);
    7576    return pRange;
     
    9899 *
    99100 * @param   pVM     Pointer to the VM.
    100  * @param   GCPhys  Physical address to lookup.
    101  */
    102 DECLINLINE(PIOMMMIORANGE) iomMmioGetRangeWithRef(PVM pVM, RTGCPHYS GCPhys)
     101 * @param   pVCpu   Pointer to the virtual CPU structure of the caller.
     102 * @param   GCPhys  Physical address to lookup.
     103 */
     104DECLINLINE(PIOMMMIORANGE) iomMmioGetRangeWithRef(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys)
    103105{
    104106    int rc = IOM_LOCK_SHARED_EX(pVM, VINF_SUCCESS);
    105107    AssertRCReturn(rc, NULL);
    106108
    107     PIOMMMIORANGE pRange = pVM->iom.s.CTX_SUFF(pMMIORangeLast);
     109    PIOMMMIORANGE pRange = pVCpu->iom.s.CTX_SUFF(pMMIORangeLast);
    108110    if (   !pRange
    109111        || GCPhys - pRange->GCPhys >= pRange->cb)
    110         pVM->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
     112        pVCpu->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
    111113            = (PIOMMMIORANGE)RTAvlroGCPhysRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->MMIOTree, GCPhys);
    112114    if (pRange)
     
    140142 *
    141143 * @param   pVM     Pointer to the VM.
    142  * @param   GCPhys  Physical address to lookup.
    143  */
    144 DECLINLINE(PIOMMMIORANGE) iomMMIOGetRangeUnsafe(PVM pVM, RTGCPHYS GCPhys)
    145 {
    146     PIOMMMIORANGE pRange = pVM->iom.s.CTX_SUFF(pMMIORangeLast);
     144 * @param   pVCpu   Pointer to the virtual CPU structure of the caller.
     145 * @param   GCPhys  Physical address to lookup.
     146 */
     147DECLINLINE(PIOMMMIORANGE) iomMMIOGetRangeUnsafe(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys)
     148{
     149    PIOMMMIORANGE pRange = pVCpu->iom.s.CTX_SUFF(pMMIORangeLast);
    147150    if (    !pRange
    148151        ||  GCPhys - pRange->GCPhys >= pRange->cb)
    149         pVM->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
     152        pVCpu->iom.s.CTX_SUFF(pMMIORangeLast) = pRange
    150153            = (PIOMMMIORANGE)RTAvlroGCPhysRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->MMIOTree, GCPhys);
    151154    return pRange;
     
    164167 * @returns NULL if not found (R0/GC), or out of memory (R3).
    165168 *
    166  * @param   pVM         Pointer to the VM.
    167  * @param   GCPhys      Physical address to lookup.
    168  * @param   pRange      The MMIO range.
    169  */
    170 DECLINLINE(PIOMMMIOSTATS) iomMmioGetStats(PVM pVM, RTGCPHYS GCPhys, PIOMMMIORANGE pRange)
     169 * @param   pVM     Pointer to the VM.
     170 * @param   pVCpu   Pointer to the virtual CPU structure of the caller.
     171 * @param   GCPhys  Physical address to lookup.
     172 * @param   pRange  The MMIO range.
     173 */
     174DECLINLINE(PIOMMMIOSTATS) iomMmioGetStats(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, PIOMMMIORANGE pRange)
    171175{
    172176    IOM_LOCK_SHARED_EX(pVM, VINF_SUCCESS);
     
    176180        GCPhys = pRange->GCPhys;
    177181
    178     PIOMMMIOSTATS pStats = pVM->iom.s.CTX_SUFF(pMMIOStatsLast);
     182    PIOMMMIOSTATS pStats = pVCpu->iom.s.CTX_SUFF(pMMIOStatsLast);
    179183    if (    !pStats
    180184        ||  pStats->Core.Key != GCPhys)
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