VirtualBox

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


Ignore:
Timestamp:
Jan 17, 2007 1:11:29 PM (18 years ago)
Author:
vboxsync
Message:

Patch2GuestAddrTree / RECPATCHTOGUEST: changed from PV to U32 AVL tree. (first in a series of 64-bit fixes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATMSSM.cpp

    r93 r94  
    5656#define PATM_ADD_PTR(a, b)      *(uintptr_t *)&(a) = (uintptr_t)(a) + (uintptr_t)(b)
    5757
     58#ifdef VBOX_STRICT
    5859/**
    5960 * Callback function for RTAvlPVDoWithAll
     
    6566 * @param   pcPatches       Pointer to patch counter
    6667 */
    67 static DECLCALLBACK(int) patmCountLeaf(PAVLPVNODECORE pNode, void *pcPatches)
     68static DECLCALLBACK(int) patmCountLeafPV(PAVLPVNODECORE pNode, void *pcPatches)
    6869{
    6970    *(uint32_t *)pcPatches = *(uint32_t *)pcPatches + 1;
    7071    return VINF_SUCCESS;
    7172}
     73#endif
     74
     75/**
     76 * Callback function for RTAvlU32DoWithAll
     77 *
     78 * Counts the number of patches in the tree
     79 *
     80 * @returns VBox status code.
     81 * @param   pNode           Current node
     82 * @param   pcPatches       Pointer to patch counter
     83 */
     84static DECLCALLBACK(int) patmCountLeaf(PAVLU32NODECORE pNode, void *pcPatches)
     85{
     86    *(uint32_t *)pcPatches = *(uint32_t *)pcPatches + 1;
     87    return VINF_SUCCESS;
     88}
    7289
    7390/**
     
    87104
    88105/**
    89  * Callback function for RTAvlPVDoWithAll
     106 * Callback function for RTAvlU32DoWithAll
    90107 *
    91108 * Saves all patch to guest lookup records.
     
    95112 * @param   pVM1            VM Handle
    96113 */
    97 static DECLCALLBACK(int) patmSaveP2GLookupRecords(PAVLPVNODECORE pNode, void *pVM1)
     114static DECLCALLBACK(int) patmSaveP2GLookupRecords(PAVLU32NODECORE pNode, void *pVM1)
    98115{
    99116    PVM                 pVM    = (PVM)pVM1;
     
    173190#ifdef VBOX_STRICT
    174191    int nrFixupRecs = 0;
    175     RTAvlPVDoWithAll(&pPatch->patch.FixupTree, true, patmCountLeaf, &nrFixupRecs);
     192    RTAvlPVDoWithAll(&pPatch->patch.FixupTree, true, patmCountLeafPV, &nrFixupRecs);
    176193    AssertMsg(nrFixupRecs == pPatch->patch.nrFixups, ("Fixup inconsistency! counted %d vs %d\n", nrFixupRecs, pPatch->patch.nrFixups));
    177194#endif
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