Changeset 20862 in vbox
- Timestamp:
- Jun 23, 2009 6:25:31 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/sup.h (modified) (1 diff)
-
src/VBox/HostDrivers/Support/SUPLib.cpp (modified) (5 diffs)
-
src/VBox/HostDrivers/Support/SUPLibInternal.h (modified) (1 diff)
-
src/VBox/HostDrivers/Support/testcase/tstPin.cpp (modified) (6 diffs)
-
src/VBox/Runtime/VBox/VBoxRTDeps.cpp (modified) (1 diff)
-
src/VBox/VMM/testcase/tstCFGM.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r20860 r20862 697 697 698 698 /** 699 * Locks down the physical memory backing a virtual memory700 * range in the current process.701 *702 * @returns VBox status code.703 * @param pvStart Start of virtual memory range.704 * Must be page aligned.705 * @param cPages Number of pages.706 * @param paPages Where to store the physical page addresses returned.707 * On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries.708 */709 SUPR3DECL(int) SUPPageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);710 711 /**712 * Releases locked down pages.713 *714 * @returns VBox status code.715 * @param pvStart Start of virtual memory range previously locked716 * down by SUPPageLock().717 */718 SUPR3DECL(int) SUPPageUnlock(void *pvStart);719 720 /**721 699 * Allocate non-zeroed, locked, pages with user and, optionally, kernel 722 700 * mappings. -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r20861 r20862 865 865 866 866 867 SUPR3DECL(int) SUPPageLock(void *pvStart, size_t cPages, PSUPPAGE paPages) 867 /** 868 * Locks down the physical memory backing a virtual memory 869 * range in the current process. 870 * 871 * @returns VBox status code. 872 * @param pvStart Start of virtual memory range. 873 * Must be page aligned. 874 * @param cPages Number of pages. 875 * @param paPages Where to store the physical page addresses returned. 876 * On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries. 877 */ 878 int supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages) 868 879 { 869 880 /* … … 920 931 921 932 922 SUPR3DECL(int) SUPPageUnlock(void *pvStart) 933 /** 934 * Releases locked down pages. 935 * 936 * @returns VBox status code. 937 * @param pvStart Start of virtual memory range previously locked 938 * down by SUPPageLock(). 939 */ 940 int supR3PageUnlock(void *pvStart) 923 941 { 924 942 /* … … 974 992 { 975 993 /* fallback */ 976 rc = SUPPageUnlock(pvPages);994 rc = supR3PageUnlock(pvPages); 977 995 if (RT_SUCCESS(rc)) 978 996 rc = suplibOsPageFree(&g_supLibData, pvPages, cPages); … … 992 1010 if (!paPages) 993 1011 paPages = (PSUPPAGE)alloca(sizeof(paPages[0]) * cPages); 994 rc = SUPPageLock(*ppvPages, cPages, paPages);1012 rc = supR3PageLock(*ppvPages, cPages, paPages); 995 1013 if (RT_FAILURE(rc)) 996 1014 suplibOsPageFree(&g_supLibData, *ppvPages, cPages); … … 1207 1225 && !g_fSupportsPageAllocNoKernel) 1208 1226 { 1209 int rc2 = SUPPageUnlock(pvPages);1227 int rc2 = supR3PageUnlock(pvPages); 1210 1228 if (RT_SUCCESS(rc2)) 1211 1229 rc = suplibOsPageFree(&g_supLibData, pvPages, cPages); -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r20374 r20862 315 315 316 316 317 int supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages); 318 int supR3PageUnlock(void *pvStart); 319 317 320 RT_C_DECLS_END 318 321 -
trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
r14831 r20862 42 42 #include <iprt/string.h> 43 43 44 #include "../SUPLibInternal.h" 45 44 46 45 47 int main(int argc, char **argv) … … 63 65 RTPrintf("pv=%p\n", pv); 64 66 SUPPAGE aPages[1]; 65 rc = SUPPageLock(pv, 1, &aPages[0]);67 rc = supR3PageLock(pv, 1, &aPages[0]); 66 68 RTPrintf("rc=%d aPages[0]=%RHp\n", rc, pv, aPages[0]); 67 69 RTThreadSleep(1500); … … 88 90 SUPPageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv); 89 91 aPinnings[i].pvAligned = RT_ALIGN_P(aPinnings[i].pv, PAGE_SIZE); 90 rc = SUPPageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]);92 rc = supR3PageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]); 91 93 if (!rc) 92 94 { … … 116 118 if (aPinnings[i].pvAligned) 117 119 { 118 rc = SUPPageUnlock(aPinnings[i].pvAligned);120 rc = supR3PageUnlock(aPinnings[i].pvAligned); 119 121 if (rc) 120 122 { … … 177 179 static SUPPAGE aPages[BIG_SIZE >> PAGE_SHIFT]; 178 180 void *pvAligned = RT_ALIGN_P(pv, PAGE_SIZE); 179 rc = SUPPageLock(pvAligned, BIG_SIZE >> PAGE_SHIFT, &aPages[0]);181 rc = supR3PageLock(pvAligned, BIG_SIZE >> PAGE_SHIFT, &aPages[0]); 180 182 if (!rc) 181 183 { … … 189 191 190 192 /* unlock */ 191 rc = SUPPageUnlock(pvAligned);193 rc = supR3PageUnlock(pvAligned); 192 194 if (rc) 193 195 { -
trunk/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
r19892 r20862 53 53 { 54 54 (PFNRT)SUPR3Init, 55 (PFNRT)SUP PageLock,55 (PFNRT)SUPR3PageAllocEx, 56 56 (PFNRT)SUPSemEventCreate, 57 57 #ifdef VBOX_WITH_LIBXML2_IN_VBOXRT -
trunk/src/VBox/VMM/testcase/tstCFGM.cpp
r13818 r20862 51 51 int rc = SUPR3Init(NULL); 52 52 if (RT_SUCCESS(rc)) 53 rc = SUPPageAlloc(RT_ALIGN_Z(sizeof(*pVM), PAGE_SIZE) >> PAGE_SHIFT, (void **)&pVM);53 rc = RTMemPageAlloc(RT_ALIGN_Z(sizeof(*pVM), PAGE_SIZE) >> PAGE_SHIFT, (void **)&pVM); 54 54 if (RT_FAILURE(rc)) 55 55 {
Note:
See TracChangeset
for help on using the changeset viewer.

