- Timestamp:
- Aug 19, 2009 8:09:45 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r21337 r22355 239 239 cPages = cb >> PAGE_SHIFT; 240 240 cOrder = CalcPowerOf2Order(cPages); 241 #ifdef RT_ARCH_AMD64 /** @todo check out if there is a correct way of getting memory below 4GB (physically). */ 241 #ifdef RT_ARCH_AMD64 242 /** @todo check out if there is a correct way of getting memory below 4GB (physically). 243 * GFP_DMA32 is available since Linux 2.6.15 */ 242 244 paPages = alloc_pages(GFP_DMA, cOrder); 243 245 #else 246 /** XXX Wrong: GFP_USER can return page frames above 4GB! */ 244 247 paPages = alloc_pages(GFP_USER, cOrder); 245 248 #endif -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r21497 r22355 531 531 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_DMA, false /* non-contiguous */); 532 532 #else 533 /** XXX Wrong: GFP_USER can return page frames above 4GB! */ 533 534 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_USER, false /* non-contiguous */); 534 535 #endif … … 1174 1175 for (iPage = 0; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE) 1175 1176 { 1177 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) 1178 uint64_t u64Phys = page_to_phys(pMemLnxToMap->apPages[iPage]); 1179 #endif 1176 1180 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE) 1177 1181 struct vm_area_struct *vma = find_vma(pTask->mm, ulAddrCur); /* this is probably the same for all the pages... */ 1178 1182 AssertBreakStmt(vma, rc = VERR_INTERNAL_ERROR); 1183 #endif 1184 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) && defined(RT_ARCH_X86) 1185 /* remap_page_range() limitation on x86 */ 1186 AssertBreakStmt(u64Phys < _4G, rc = VERR_NO_MEMORY); 1179 1187 #endif 1180 1188 … … 1185 1193 rc = remap_pfn_range(vma, ulAddrCur, page_to_pfn(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg); 1186 1194 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE) 1187 rc = remap_page_range(vma, ulAddrCur, page_to_phys(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg);1195 rc = remap_page_range(vma, ulAddrCur, u64Phys, PAGE_SIZE, fPg); 1188 1196 #else /* 2.4 */ 1189 rc = remap_page_range(ulAddrCur, page_to_phys(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg);1197 rc = remap_page_range(ulAddrCur, u64Phys, PAGE_SIZE, fPg); 1190 1198 #endif 1191 1199 if (rc) … … 1213 1221 AssertBreakStmt(vma, rc = VERR_INTERNAL_ERROR); 1214 1222 #endif 1223 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) && defined(RT_ARCH_X86) 1224 /* remap_page_range() limitation on x86 */ 1225 AssertBreakStmt(Phys < _4G, rc = VERR_NO_MEMORY); 1226 #endif 1215 1227 1216 1228 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
Note:
See TracChangeset
for help on using the changeset viewer.