VirtualBox

Changeset 108250 in vbox


Ignore:
Timestamp:
Feb 17, 2025 1:01:56 AM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167571
Message:

VMM/IEM: Splitting up IEMAll.cpp. [build fix] jiraref:VBP-1531

File:
1 edited

Legend:

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

    r108248 r108250  
    6969 * @{
    7070 */
    71 
    72 #if 0 /*unused*/
    73 /**
    74  * Looks up a memory mapping entry.
    75  *
    76  * @returns The mapping index (positive) or VERR_NOT_FOUND (negative).
    77  * @param   pVCpu           The cross context virtual CPU structure of the calling thread.
    78  * @param   pvMem           The memory address.
    79  * @param   fAccess         The access to.
    80  */
    81 DECLINLINE(int) iemMapLookup(PVMCPUCC pVCpu, void *pvMem, uint32_t fAccess)
    82 {
    83     Assert(pVCpu->iem.s.cActiveMappings <= RT_ELEMENTS(pVCpu->iem.s.aMemMappings));
    84     fAccess &= IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_MASK;
    85     if (   pVCpu->iem.s.aMemMappings[0].pv == pvMem
    86         && (pVCpu->iem.s.aMemMappings[0].fAccess & (IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_MASK)) == fAccess)
    87         return 0;
    88     if (   pVCpu->iem.s.aMemMappings[1].pv == pvMem
    89         && (pVCpu->iem.s.aMemMappings[1].fAccess & (IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_MASK)) == fAccess)
    90         return 1;
    91     if (   pVCpu->iem.s.aMemMappings[2].pv == pvMem
    92         && (pVCpu->iem.s.aMemMappings[2].fAccess & (IEM_ACCESS_WHAT_MASK | IEM_ACCESS_TYPE_MASK)) == fAccess)
    93         return 2;
    94     return VERR_NOT_FOUND;
    95 }
    96 #endif
    97 
    98 /**
    99  * Finds a free memmap entry when using iNextMapping doesn't work.
    100  *
    101  * @returns Memory mapping index, 1024 on failure.
    102  * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
    103  */
    104 static unsigned iemMemMapFindFree(PVMCPUCC pVCpu)
    105 {
    106     /*
    107      * The easy case.
    108      */
    109     if (pVCpu->iem.s.cActiveMappings == 0)
    110     {
    111         pVCpu->iem.s.iNextMapping = 1;
    112         return 0;
    113     }
    114 
    115     /* There should be enough mappings for all instructions. */
    116     AssertReturn(pVCpu->iem.s.cActiveMappings < RT_ELEMENTS(pVCpu->iem.s.aMemMappings), 1024);
    117 
    118     for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->iem.s.aMemMappings); i++)
    119         if (pVCpu->iem.s.aMemMappings[i].fAccess == IEM_ACCESS_INVALID)
    120             return i;
    121 
    122     AssertFailedReturn(1024);
    123 }
    124 
    12571
    12672/**
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