VirtualBox

Changeset 6816 in vbox


Ignore:
Timestamp:
Feb 5, 2008 9:50:07 PM (17 years ago)
Author:
vboxsync
Message:

Made MMR3HyperAllocOnceNoRel suitable for allocating the PGMRAMRANGE structures.

File:
1 edited

Legend:

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

    r6529 r6816  
    745745{
    746746    AssertMsg(cb >= 8, ("Hey! Do you really mean to allocate less than 8 bytes?! cb=%d\n", cb));
    747     AssertMsg(cb <= _4M, ("Allocating more than 4MB!? (cb=%#x) HMA limit might need adjusting if you allocate more.\n", cb));
    748747
    749748    /*
     
    759758            ||  cb <= 8*_1K)
    760759        {
    761             Log2(("MMR3HyperAllocOnceNoRel: cb=%#x uAlignment=%#x returns %Rrc and *ppv=%p\n",
     760            Log2(("MMR3HyperAllocOnceNoRel: cb=%#zx uAlignment=%#x returns %Rrc and *ppv=%p\n",
    762761                  cb, uAlignment, rc, *ppv));
    763762            return rc;
     
    798797            return rc;
    799798        }
     799        AssertMsgFailed(("Failed to allocate %zd bytes! %Rrc\n", cb, rc));
    800800        SUPPageFree(pvPages, cb >> PAGE_SHIFT);
    801     }
     801
     802        /*
     803         * HACK ALERT! Try allocate it off the heap so that we don't freak
     804         * out during vga/vmmdev mmio2 allocation with certain ram sizes.
     805         */
     806        /** @todo make a proper fix for this so we will never end up in this kind of situation! */
     807        Log(("MMR3HyperAllocOnceNoRel: MMR3HyperMapHCRam failed with rc=%Rrc, try MMHyperAlloc(,%#d,,) instead\n",  rc, cb));
     808        int rc2 = MMHyperAlloc(pVM, cb, uAlignment, enmTag, ppv);
     809        if (RT_SUCCESS(rc2))
     810        {
     811            Log2(("MMR3HyperAllocOnceNoRel: cb=%#x uAlignment=%#x returns %Rrc and *ppv=%p\n",
     812                  cb, uAlignment, rc, *ppv));
     813            return rc;
     814        }
     815    }
     816    else
     817        AssertMsgFailed(("Failed to allocate %zd bytes! %Rrc\n", cb, rc));
     818
    802819    if (rc == VERR_NO_MEMORY)
    803820        rc = VERR_MM_HYPER_NO_MEMORY;
    804     Log2(("MMR3HyperAllocOnceNoRel: cb=%#x uAlignment=%#x returns %Rrc\n", cb, uAlignment, rc));
    805     AssertMsgFailed(("Failed to allocate %d bytes!\n", cb));
     821    LogRel(("MMR3HyperAllocOnceNoRel: cb=%#zx uAlignment=%#x returns %Rrc\n", cb, uAlignment, rc));
    806822    return rc;
    807823}
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