Changeset 14590 in vbox
- Timestamp:
- Nov 25, 2008 6:47:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/MMHyper.cpp
r14589 r14590 784 784 AssertReturn(cbAligned >= cb, VERR_INVALID_PARAMETER); 785 785 uint32_t const cPages = cb >> PAGE_SHIFT; 786 int rc;787 void *pv;788 RTR0PTR pvR0 = NIL_RTR0PTR;789 #if 0790 PSUPPAGE paPages = NULL;791 rc = SUPPageAlloc(cbAligned >> PAGE_SHIFT, &pv); /** @todo #1865: heap allocation must be changed for osx (only). */792 #else /**@todo resume here. */793 786 PSUPPAGE paPages = (PSUPPAGE)MMR3HeapAlloc(pVM, MM_TAG_MM, cPages * sizeof(paPages[0])); 794 787 if (!paPages) 795 788 return VERR_NO_MEMORY; 796 rc = SUPR3PageAllocEx(cPages, 797 0 /*fFlags*/, 798 &pv, 799 VMMIsHwVirtExtForced(pVM) ? &pvR0 : NULL, 800 paPages); 801 #endif 789 void *pv; 790 RTR0PTR pvR0 = NIL_RTR0PTR; 791 int rc = SUPR3PageAllocEx(cPages, 792 0 /*fFlags*/, 793 &pv, 794 VMMIsHwVirtExtForced(pVM) ? &pvR0 : NULL, 795 paPages); 802 796 if (RT_SUCCESS(rc)) 803 797 { … … 839 833 return VINF_SUCCESS; 840 834 } 841 AssertMsgFailed(("SUP PageAlloc(%d,) -> %Rrc\n", cbAligned >> PAGE_SHIFT, rc));835 AssertMsgFailed(("SUPR3PageAllocEx(%d,,,,) -> %Rrc\n", cbAligned >> PAGE_SHIFT, rc)); 842 836 843 837 *ppHeap = NULL; … … 945 939 946 940 /* 947 * Allocate the pages and theHMA space.941 * Allocate the pages and map them into HMA space. 948 942 */ 949 943 cb = RT_ALIGN(cb, PAGE_SIZE); 950 void *pvPages; 951 int rc = SUPPageAlloc(cb >> PAGE_SHIFT, &pvPages); 944 uint32_t const cPages = cb >> PAGE_SHIFT; 945 PSUPPAGE paPages = (PSUPPAGE)RTMemTmpAlloc(cPages * sizeof(paPages[0])); 946 if (!paPages) 947 return VERR_NO_TMP_MEMORY; 948 void *pvPages; 949 RTR0PTR pvR0 = NIL_RTR0PTR; 950 int rc = SUPR3PageAllocEx(cPages, 951 0 /*fFlags*/, 952 &pvPages, 953 VMMIsHwVirtExtForced(pVM) ? &pvR0 : NULL, 954 paPages); 952 955 if (RT_SUCCESS(rc)) 953 956 { 957 if (!VMMIsHwVirtExtForced(pVM)) 958 pvR0 = (uintptr_t)pvPages; 959 memset(pvPages, 0, cb); 960 954 961 RTGCPTR GCPtr; 955 rc = MMR3HyperMapHCRam(pVM, pvPages, cb, true, 962 rc = MMR3HyperMapPages(pVM, 963 pvPages, 964 pvR0, 965 cPages, 966 paPages, 956 967 MMR3HeapAPrintf(pVM, MM_TAG_MM, "alloc once (%s)", mmR3GetTagName(enmTag)), 957 968 &GCPtr); … … 964 975 } 965 976 AssertMsgFailed(("Failed to allocate %zd bytes! %Rrc\n", cb, rc)); 966 SUPPageFree(pvPages, cb >> PAGE_SHIFT); 977 SUPR3PageFreeEx(pvPages, cPages); 978 967 979 968 980 /*
Note:
See TracChangeset
for help on using the changeset viewer.