Changeset 14592 in vbox for trunk/src/VBox/VMM/PGMPhys.cpp
- Timestamp:
- Nov 25, 2008 8:05:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r14589 r14592 674 674 PSUPPAGE paPages = (PSUPPAGE)RTMemTmpAlloc(cPages * sizeof(SUPPAGE)); 675 675 if (RT_SUCCESS(rc)) 676 rc = SUP PageAllocLockedEx(cPages, &pvPages, paPages);676 rc = SUPR3PageAllocEx(cPages, 0 /*fFlags*/, &pvPages, NULL /*pR0Ptr*/, paPages); 677 677 if (RT_SUCCESS(rc)) 678 678 { … … 723 723 } 724 724 725 SUP PageFreeLocked(pvPages, cPages);725 SUPR3PageFreeEx(pvPages, cPages); 726 726 } 727 727 RTMemTmpFree(paPages); … … 787 787 * Free the memory. 788 788 */ 789 int rc2 = SUP PageFreeLocked(pCur->pvR3, pCur->RamRange.cb >> PAGE_SHIFT);789 int rc2 = SUPR3PageFreeEx(pCur->pvR3, pCur->RamRange.cb >> PAGE_SHIFT); 790 790 AssertRC(rc2); 791 791 if (RT_FAILURE(rc2) && RT_SUCCESS(rc)) … … 1727 1727 size_t cbRam = RT_OFFSETOF(PGMRAMRANGE, aPages[cb >> PAGE_SHIFT]); 1728 1728 PPGMRAMRANGE pNew; 1729 RTRCPTR RCPtrNew;1730 1729 int rc = VERR_NO_MEMORY; 1731 1730 if (cbRam > PAGE_SIZE / 2) 1732 1731 { /* large */ 1733 1732 cbRam = RT_ALIGN_Z(cbRam, PAGE_SIZE); 1734 rc = SUPPageAlloc(cbRam >> PAGE_SHIFT, (void **)&pNew); 1735 if (RT_SUCCESS(rc)) 1736 { 1737 RTGCPTR GCPtrNew; 1738 rc = MMR3HyperMapHCRam(pVM, pNew, cbRam, true, 1739 MMR3HeapAPrintf(pVM, MM_TAG_PGM_PHYS, "ram range (%s)", pszDesc), 1740 &GCPtrNew); 1741 if (RT_SUCCESS(rc)) 1742 { 1743 RCPtrNew = GCPtrNew; 1744 Assert(MMHyperR3ToRC(pVM, pNew) == GCPtrNew && RCPtrNew == GCPtrNew); 1745 rc = MMR3HyperReserve(pVM, PAGE_SIZE, "fence", NULL); 1746 } 1747 else 1748 { 1749 AssertMsgFailed(("MMR3HyperMapHCRam(,,%#x,,,) -> %Rrc\n", cbRam, rc)); 1750 SUPPageFree(pNew, cbRam >> PAGE_SHIFT); 1751 } 1752 } 1753 else 1754 AssertMsgFailed(("SUPPageAlloc(%#x,,) -> %Rrc\n", cbRam >> PAGE_SHIFT, rc)); 1755 1756 } 1757 /** @todo Make VGA and VMMDev register their memory at init time before the hma size is fixated. */ 1758 if (RT_FAILURE(rc)) 1759 { /* small + fallback (vga) */ 1733 rc = MMR3HyperAllocOnceNoRel(pVM, cbRam, PAGE_SIZE, MM_TAG_PGM_PHYS, (void **)&pNew); 1734 AssertMsgRC(rc, ("MMR3HyperAllocOnceNoRel(,%#x,,) -> %Rrc\n", cbRam, rc)); 1735 } 1736 else 1737 { /* small */ 1760 1738 rc = MMHyperAlloc(pVM, cbRam, 16, MM_TAG_PGM, (void **)&pNew); 1761 if (RT_SUCCESS(rc)) 1762 RCPtrNew = MMHyperR3ToRC(pVM, pNew); 1763 else 1764 AssertMsgFailed(("MMHyperAlloc(,%#x,,,) -> %Rrc\n", cbRam, cb)); 1739 AssertMsgRC(rc, ("MMHyperAlloc(,%#x,,,) -> %Rrc\n", cbRam, rc)); 1765 1740 } 1766 1741 if (RT_SUCCESS(rc)) … … 1822 1797 pPrev->pNextR3 = pNew; 1823 1798 pPrev->pNextR0 = MMHyperCCToR0(pVM, pNew); 1824 pPrev->pNextRC = RCPtrNew;1799 pPrev->pNextRC = MMHyperCCToRC(pVM, pNew); 1825 1800 } 1826 1801 else … … 1828 1803 pVM->pgm.s.pRamRangesR3 = pNew; 1829 1804 pVM->pgm.s.pRamRangesR0 = MMHyperCCToR0(pVM, pNew); 1830 pVM->pgm.s.pRamRangesRC = RCPtrNew;1805 pVM->pgm.s.pRamRangesRC = MMHyperCCToRC(pVM, pNew); 1831 1806 } 1832 1807 pgmUnlock(pVM);
Note:
See TracChangeset
for help on using the changeset viewer.