Changeset 20866 in vbox
- Timestamp:
- Jun 23, 2009 7:33:23 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/VBox/sup.h (modified) (2 diffs)
-
src/VBox/HostDrivers/Support/SUPLib.cpp (modified) (1 diff)
-
src/VBox/VMM/MMInternal.h (modified) (1 diff)
-
src/VBox/VMM/MMPagePool.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r20864 r20866 701 701 * Use SUPR3PageFreeEx() to free memory allocated with this function. 702 702 * 703 * This SUPR3PageAllocEx and SUPR3PageFreeEx replaces SUPR3PageAllocLockedEx,704 * SUPR3PageFreeLocked, SUPR3PageAlloc, and SUPR3PageFree.705 *706 703 * @returns VBox status code. 707 704 * @param cPages The number of pages to allocate. … … 759 756 */ 760 757 SUPR3DECL(int) SUPR3PageFreeEx(void *pvPages, size_t cPages); 761 762 /**763 * Allocate non-zeroed locked pages.764 *765 * @returns VBox status code.766 * @param cPages Number of pages to allocate.767 * @param ppvPages Where to store the base pointer to the allocated pages.768 * @param paPages Where to store the physical page addresses returned.769 * On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries.770 * NULL is allowed.771 * @todo remove this.772 */773 SUPR3DECL(int) SUPR3PageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages);774 775 /**776 * Frees locked pages allocated with SUPPageAllocLockedEx().777 *778 * @returns VBox status.779 * @param pvPages Pointer returned by SUPR3PageAllocLockedEx().780 * @param cPages Number of pages that was allocated.781 * @todo remove this.782 */783 SUPR3DECL(int) SUPR3PageFreeLocked(void *pvPages, size_t cPages);784 758 785 759 /** -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r20864 r20866 968 968 969 969 970 SUPR3DECL(int) SUPR3PageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages)971 {972 return SUPR3PageAllocEx(cPages, 0 /*fFlags*/, ppvPages, NULL /*pR0Ptr*/, paPages);973 }974 975 976 SUPR3DECL(int) SUPR3PageFreeLocked(void *pvPages, size_t cPages)977 {978 /*979 * Validate.980 */981 AssertPtrReturn(pvPages, VERR_INVALID_POINTER);982 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);983 984 /*985 * Check if we're employing the fallback or not to avoid the986 * fuzzy handling of this in SUPR3PageFreeEx.987 */988 int rc;989 if (g_fSupportsPageAllocNoKernel)990 rc = SUPR3PageFreeEx(pvPages, cPages);991 else992 {993 /* fallback */994 rc = supR3PageUnlock(pvPages);995 if (RT_SUCCESS(rc))996 rc = suplibOsPageFree(&g_supLibData, pvPages, cPages);997 }998 return rc;999 }1000 1001 1002 970 /** 1003 * Fallback for SUPR3PageAlloc LockedEx on systems where RTR0MemObjPhysAllocNC1004 * isn'tsupported.971 * Fallback for SUPR3PageAllocEx on systems where RTR0MemObjPhysAllocNC isn't 972 * supported. 1005 973 */ 1006 974 static int supPagePageAllocNoKernelFallback(size_t cPages, void **ppvPages, PSUPPAGE paPages) -
trunk/src/VBox/VMM/MMInternal.h
r20864 r20866 527 527 /** Flag indicating the allocation method. 528 528 * Set: SUPR3LowAlloc(). 529 * Clear: SUPR3PageAlloc LockedEx(). */529 * Clear: SUPR3PageAllocEx(). */ 530 530 bool fLow; 531 531 /** Number of subpools. */ -
trunk/src/VBox/VMM/MMPagePool.cpp
r20864 r20866 68 68 * ring-0. Need to change the wasy we allocate it... */ 69 69 AssertReleaseReturn(sizeof(*pVM->mm.s.pPagePoolR3) + sizeof(*pVM->mm.s.pPagePoolLowR3) < PAGE_SIZE, VERR_INTERNAL_ERROR); 70 int rc = SUPR3PageAlloc LockedEx(1, (void **)&pVM->mm.s.pPagePoolR3, NULL);70 int rc = SUPR3PageAllocEx(1, 0 /*fFlags*/, (void **)&pVM->mm.s.pPagePoolR3, NULL /*pR0Ptr*/, NULL /*paPages*/); 71 71 if (RT_FAILURE(rc)) 72 72 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.

