VirtualBox

Changeset 31206 in vbox


Ignore:
Timestamp:
Jul 29, 2010 1:05:31 PM (14 years ago)
Author:
vboxsync
Message:

PGM: Always make sure to have the original bits around for verification in strict builds.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r31198 r31206  
    24442444    pgmLock(pVM);
    24452445    pgmR3PhysRamTerm(pVM);
     2446    pgmR3PhysRomTerm(pVM);
    24462447    pgmUnlock(pVM);
    24472448
  • trunk/src/VBox/VMM/PGMInternal.h

    r31178 r31206  
    35833583int             pgmR3PhysChunkMap(PVM pVM, uint32_t idChunk, PPPGMCHUNKR3MAP ppChunk);
    35843584int             pgmR3PhysRamTerm(PVM pVM);
     3585void            pgmR3PhysRomTerm(PVM pVM);
    35853586
    35863587int             pgmR3PoolInit(PVM pVM);
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r31127 r31206  
    879879
    880880    /* Flush the recompiler's TLB as well. */
    881     for (unsigned i = 0; i < pVM->cCpus; i++)
     881    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    882882        CPUMSetChangedFlags(&pVM->aCpus[i], CPUM_CHANGED_GLOBAL_TLB_FLUSH);
    883883
     
    28082808                    pRomNew->fFlags = fFlags;
    28092809                    pRomNew->idSavedState = UINT8_MAX;
     2810#ifdef VBOX_STRICT
     2811                    pRomNew->pvOriginal = fFlags & PGMPHYS_ROM_FLAGS_PERMANENT_BINARY
     2812                                        ? pvBinary : RTMemDup(pvBinary, cPages * PAGE_SIZE);
     2813#else
    28102814                    pRomNew->pvOriginal = fFlags & PGMPHYS_ROM_FLAGS_PERMANENT_BINARY ? pvBinary : NULL;
     2815#endif
    28112816                    pRomNew->pszDesc = pszDesc;
    28122817
     
    28892894 * @param   pvUser          User argument.
    28902895 */
    2891 static DECLCALLBACK(int) pgmR3PhysRomWriteHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser)
     2896static DECLCALLBACK(int) pgmR3PhysRomWriteHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf,
     2897                                                  PGMACCESSTYPE enmAccessType, void *pvUser)
    28922898{
    28932899    PPGMROMRANGE    pRom     = (PPGMROMRANGE)pvUser;
     
    29292935
    29302936            /*
    2931              * Write to the ram page.
     2937             * Write to the RAM page.
    29322938             */
    29332939            case PGMROMPROT_READ_ROM_WRITE_RAM:
     
    30733079
    30743080/**
     3081 * Called by PGMR3Term to free resources.
     3082 *
     3083 * ASSUMES that the caller owns the PGM lock.
     3084 *
     3085 * @param   pVM         The VM handle.
     3086 */
     3087void pgmR3PhysRomTerm(PVM pVM)
     3088{
     3089#ifdef RT_STRICT
     3090    /*
     3091     * Free the heap copy of the original bits.
     3092     */
     3093    for (PPGMROMRANGE pRom = pVM->pgm.s.pRomRangesR3; pRom; pRom = pRom->pNextR3)
     3094    {
     3095        if (   pRom->pvOriginal
     3096            && !(pRom->fFlags & PGMPHYS_ROM_FLAGS_PERMANENT_BINARY))
     3097        {
     3098            RTMemFree((void *)pRom->pvOriginal);
     3099            pRom->pvOriginal = NULL;
     3100        }
     3101    }
     3102#endif
     3103}
     3104
     3105
     3106/**
    30753107 * Change the shadowing of a range of ROM pages.
    30763108 *
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