Changeset 22680 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Sep 1, 2009 3:27:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r22679 r22680 1207 1207 int rc = VERR_NO_MEMORY; 1208 1208 PRTR0MEMOBJLNX pMemLnx; 1209 #ifdef VBOX_USE_PAE_HACK 1210 struct page *pDummyPage; 1211 RTHCPHYS DummyPhys; 1212 #endif 1209 1213 1210 1214 /* … … 1215 1219 if (uAlignment > PAGE_SIZE) 1216 1220 return VERR_NOT_SUPPORTED; 1221 1222 #ifdef VBOX_USE_PAE_HACK 1223 /* 1224 * Allocate a dummy page for use when mapping the memory. 1225 */ 1226 pDummyPage = alloc_page(GFP_USER); 1227 if (!pDummyPage) 1228 return VERR_NO_MEMORY; 1229 SetPageReserved(pDummyPage); 1230 DummyPhys = page_to_phys(pDummyPage); 1231 #endif 1217 1232 1218 1233 /* … … 1238 1253 const size_t cPages = pMemLnxToMap->Core.cb >> PAGE_SHIFT; 1239 1254 size_t iPage; 1240 #ifdef VBOX_USE_PAE_HACK1241 struct page *pDummyPage = alloc_page(GFP_USER);1242 RTHCPHYS DummyPhys;1243 1244 if (!pDummyPage)1245 goto l_error;1246 SetPageReserved(pDummyPage);1247 DummyPhys = page_to_phys(pDummyPage);1248 #endif1249 1255 1250 1256 rc = 0; … … 1330 1336 } 1331 1337 } 1338 if (!rc) 1339 { 1340 up_write(&pTask->mm->mmap_sem); 1332 1341 #ifdef VBOX_USE_PAE_HACK 1333 __free_page(pDummyPage); 1334 #endif 1335 if (!rc) 1336 { 1337 up_write(&pTask->mm->mmap_sem); 1342 __free_page(pDummyPage); 1343 #endif 1338 1344 1339 1345 pMemLnx->Core.pv = pv; … … 1348 1354 MY_DO_MUNMAP(pTask->mm, (unsigned long)pv, pMemLnxToMap->Core.cb); 1349 1355 } 1350 1356 up_write(&pTask->mm->mmap_sem); 1357 rtR0MemObjDelete(&pMemLnx->Core); 1358 } 1351 1359 #ifdef VBOX_USE_PAE_HACK 1352 l_error: 1353 #endif 1354 up_write(&pTask->mm->mmap_sem); 1355 1356 rtR0MemObjDelete(&pMemLnx->Core); 1357 } 1360 __free_page(pDummyPage); 1361 #endif 1358 1362 1359 1363 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.