VirtualBox

Changeset 55489 in vbox


Ignore:
Timestamp:
Apr 28, 2015 3:40:59 PM (10 years ago)
Author:
vboxsync
Message:

MM: Added MMHyperHeapOffsetToPtr, MMHyperHeapPtrToOffset and MMR3IsInitialized.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/mm.h

    r53615 r55489  
    112112    MM_TAG_PGM_CHUNK_MAPPING,
    113113    MM_TAG_PGM_HANDLERS,
     114    MM_TAG_PGM_HANDLER_TYPES,
    114115    MM_TAG_PGM_MAPPINGS,
    115116    MM_TAG_PGM_PHYS,
     
    216217VMMDECL(size_t)     MMHyperHeapGetFreeSize(PVM pVM);
    217218VMMDECL(size_t)     MMHyperHeapGetSize(PVM pVM);
     219VMMDECL(void *)     MMHyperHeapOffsetToPtr(PVM pVM, uint32_t offHeap);
     220VMMDECL(uint32_t)   MMHyperHeapPtrToOffset(PVM pVM, void *pv);
    218221VMMDECL(RTGCPTR)    MMHyperGetArea(PVM pVM, size_t *pcb);
    219222VMMDECL(bool)       MMHyperIsInsideArea(PVM pVM, RTGCPTR GCPtr);
     
    251254VMMR3DECL(int)      MMR3Term(PVM pVM);
    252255VMMR3DECL(void)     MMR3TermUVM(PUVM pUVM);
     256VMMR3_INT_DECL(bool) MMR3IsInitialized(PVM pVM);
    253257VMMR3DECL(int)      MMR3ReserveHandyPages(PVM pVM, uint32_t cHandyPages);
    254258VMMR3DECL(int)      MMR3IncreaseBaseReservation(PVM pVM, uint64_t cAddBasePages);
  • trunk/src/VBox/VMM/VMMAll/MMAll.cpp

    r49893 r55489  
    624624        TAG2STR(PGM_CHUNK_MAPPING);
    625625        TAG2STR(PGM_HANDLERS);
     626        TAG2STR(PGM_HANDLER_TYPES);
    626627        TAG2STR(PGM_MAPPINGS);
    627628        TAG2STR(PGM_PHYS);
  • trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp

    r51271 r55489  
    12591259}
    12601260
     1261
    12611262/**
    12621263 * Query the size the hypervisor heap.
     
    12671268{
    12681269    return pVM->mm.s.CTX_SUFF(pHyperHeap)->cbHeap;
     1270}
     1271
     1272
     1273/**
     1274 * Converts a context neutral heap offset into a pointer.
     1275 *
     1276 * @returns Pointer to hyper heap data.
     1277 * @param   pVM         Pointer to the cross context VM structure.
     1278 * @param   offHeap     The hyper heap offset.
     1279 */
     1280VMMDECL(void *) MMHyperHeapOffsetToPtr(PVM pVM, uint32_t offHeap)
     1281{
     1282    Assert(offHeap - MMYPERHEAP_HDR_SIZE <= pVM->mm.s.CTX_SUFF(pHyperHeap)->cbHeap);
     1283    return (uint8_t *)pVM->mm.s.CTX_SUFF(pHyperHeap) + offHeap;
     1284}
     1285
     1286
     1287/**
     1288 * Converts a context specific heap pointer into a neutral heap offset.
     1289 *
     1290 * @returns Heap offset.
     1291 * @param   pVM         Pointer to the cross context VM structure.
     1292 * @param   pv          Pointer to the heap data.
     1293 */
     1294VMMDECL(uint32_t) MMHyperHeapPtrToOffset(PVM pVM, void *pv)
     1295{
     1296    size_t offHeap = (uint8_t *)pv - (uint8_t *)pVM->mm.s.CTX_SUFF(pHyperHeap);
     1297    Assert(offHeap - MMYPERHEAP_HDR_SIZE <= pVM->mm.s.CTX_SUFF(pHyperHeap)->cbHeap);
     1298    return (uint32_t)offHeap;
    12691299}
    12701300
  • trunk/src/VBox/VMM/VMMR3/MM.cpp

    r52764 r55489  
    503503
    504504/**
     505 * Checks if the both VM and UVM parts of MM have been initialized.
     506 *
     507 * @returns true if initialized, false if not.
     508 * @param   pVM         Pointer to the cross context VM structure.
     509 */
     510VMMR3_INT_DECL(bool) MMR3IsInitialized(PVM pVM)
     511{
     512    return pVM->mm.s.pHyperHeapR3 != NULL;
     513}
     514
     515
     516/**
    505517 * Execute state save operation.
    506518 *
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