VirtualBox

Changeset 2679 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 16, 2007 7:11:24 PM (18 years ago)
Author:
vboxsync
Message:

fixed alignment issue, move the code to the right place and fixed the style.

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

Legend:

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

    r2663 r2679  
    158158static DECLCALLBACK(int) pgmR3RelocatePhysHandler(PAVLROGCPHYSNODECORE pNode, void *pvUser);
    159159static DECLCALLBACK(int) pgmR3RelocateVirtHandler(PAVLROGCPTRNODECORE pNode, void *pvUser);
     160static DECLCALLBACK(void) pgmR3ResetNoMorePhysWritesFlag(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
    160161static DECLCALLBACK(int) pgmR3Save(PVM pVM, PSSMHANDLE pSSM);
    161162static DECLCALLBACK(int) pgmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version);
     
    447448
    448449/**
    449  * The only purpose of this function is to clear the fNoMorePhysWrites flag
    450  * which prevents writing to physical memory once pgmR3Save() is called.
    451  */
    452 #ifdef VBOX_STRICT
    453 DECLCALLBACK(void)
    454 PGMR3ResetNoMorePhysWritesFlag(PVM pVM, VMSTATE aState, VMSTATE aOldState, void *aUser)
    455 {
    456     if (aState == VMSTATE_RUNNING)
    457         pVM->pgm.s.fNoMorePhysWrites = false;
    458 }
    459 #endif
    460 
    461 
    462 /**
    463450 * Initiates the paging of VM.
    464451 *
     
    495482
    496483#ifdef VBOX_STRICT
    497     VMR3AtStateRegister (pVM, PGMR3ResetNoMorePhysWritesFlag, NULL);
     484    VMR3AtStateRegister(pVM, pgmR3ResetNoMorePhysWritesFlag, NULL);
    498485#endif
    499486
     
    799786#if HC_ARCH_BITS == 64
    800787LogRel(("Debug: HCPhys32BitPD=%VHp aHCPhysPaePDs={%VHp,%VHp,%VHp,%VHp} HCPhysPaePDPTR=%VHp HCPhysPaePML4=%VHp\n",
    801         pVM->pgm.s.HCPhys32BitPD, pVM->pgm.s.aHCPhysPaePDs[0], pVM->pgm.s.aHCPhysPaePDs[1], pVM->pgm.s.aHCPhysPaePDs[2], pVM->pgm.s.aHCPhysPaePDs[3], 
     788        pVM->pgm.s.HCPhys32BitPD, pVM->pgm.s.aHCPhysPaePDs[0], pVM->pgm.s.aHCPhysPaePDs[1], pVM->pgm.s.aHCPhysPaePDs[2], pVM->pgm.s.aHCPhysPaePDs[3],
    802789        pVM->pgm.s.HCPhysPaePDPTR, pVM->pgm.s.HCPhysPaePML4));
    803790LogRel(("Debug: HCPhysInterPD=%VHp HCPhysInterPaePDPTR=%VHp HCPhysInterPaePML4=%VHp\n",
     
    806793        MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPTs[1]),
    807794        MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePTs[1]),
    808         MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[1]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[2]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[3]), 
     795        MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[0]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[1]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[2]), MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[3]),
    809796        MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPTR64)));
    810797#endif
     
    13341321
    13351322
     1323#ifdef VBOX_STRICT
     1324/**
     1325 * VM state change callback for clearing fNoMorePhysWrites after
     1326 * a snapshot has been created.
     1327 */
     1328static DECLCALLBACK(void) pgmR3ResetNoMorePhysWritesFlag(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser)
     1329{
     1330    if (enmState == VMSTATE_RUNNING)
     1331        pVM->pgm.s.fNoMorePhysWrites = false;
     1332}
     1333#endif
     1334
     1335
    13361336/**
    13371337 * Execute state save operation.
     
    13451345    PPGM pPGM = &pVM->pgm.s;
    13461346
    1347 #ifdef VBOX_STRICT
    13481347    /* No more writes to physical memory after this point! */
    13491348    pVM->pgm.s.fNoMorePhysWrites = true;
    1350 #endif
    13511349
    13521350    /*
  • trunk/src/VBox/VMM/PGMInternal.h

    r2663 r2679  
    720720#if HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64
    721721    bool                Alignment[4];   /**< Align the structure size on a 64-bit boundrary. */
    722 #endif 
     722#endif
    723723} PGMPOOLPAGE, *PPGMPOOLPAGE, **PPPGMPOOLPAGE;
    724724
     
    12701270#if GC_ARCH_BITS == 32 && HC_ARCH_BITS == 64
    12711271    RTGCPTR                    alignment0; /**< structure size alignment. */
    1272 #endif 
     1272#endif
    12731273
    12741274    DECLR0CALLBACKMEMBER(int,  pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     
    13431343#if GC_ARCH_BITS == 32 && HC_ARCH_BITS == 64
    13441344    RTGCPTR                         alignment2; /**< structure size alignment. */
    1345 #endif 
     1345#endif
    13461346    /** @} */
    13471347
     
    14581458    GCPTRTYPE(PPGMPOOL)             pPoolGC;
    14591459
     1460    /** We're not in a state which permits writes to guest memory.
     1461     * (Only used in strict builds.) */
     1462    bool                            fNoMorePhysWrites;
     1463
    14601464    /** Flush the cache on the next access. */
    14611465    bool                            fPhysCacheFlushPending;
     
    14651469    /** PGMPhysWrite cache */
    14661470    PGMPHYSCACHE                    pgmphyswritecache;
    1467 
    1468 #ifdef VBOX_STRICT
    1469     /** Physical memory was already saved, no more writes which wouldn't be part of the
    1470      *  saved state! */
    1471     bool                            fNoMorePhysWrites;
    1472 #endif
    14731471
    14741472    /** @name Release Statistics
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r2663 r2679  
    942942#endif
    943943
     944    AssertMsg(!pVM->pgm.s.fNoMorePhysWrites, ("Calling PGMPhysWrite after pgmR3Save()!\n"));
    944945    AssertMsg(cbWrite > 0, ("don't even think about writing zero bytes!\n"));
    945946    if (cbWrite == 0)
    946947        return;
    947948
    948 #ifdef VBOX_STRICT
    949     /*
    950      * pgmR3Save() was already called, any bytes we write now will not be part of the
    951      * saved state!
    952      */
    953     AssertMsg(pVM->pgm.s.fNoMorePhysWrites == false, ("Calling PGMPhysWrite after pgmR3Save()!\n"));
    954 
    955949    LogFlow(("PGMPhysWrite: %VGp %d\n", GCPhys, cbWrite));
    956 #endif
    957950
    958951#ifdef IN_RING3
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