Changeset 22531 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Aug 27, 2009 3:17:53 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 51553
- Location:
- trunk/src/VBox/Runtime/r0drv/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r22508 r22531 240 240 cOrder = CalcPowerOf2Order(cPages); 241 241 #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) 242 /* ZONE_DMA32: 0-4GB */ 242 243 paPages = alloc_pages(GFP_DMA32, cOrder); 243 244 if (!paPages) 244 245 #endif 245 246 #ifdef RT_ARCH_AMD64 247 /* ZONE_DMA; 0-16MB */ 246 248 paPages = alloc_pages(GFP_DMA, cOrder); 247 249 #else 248 # if defined(CONFIG_X86_PAE) 249 /** GFP_USER can return page frames above 4GB on PAE systems => GFP_DMA? */ 250 # endif 250 /* ZONE_NORMAL: 0-896MB */ 251 251 paPages = alloc_pages(GFP_USER, cOrder); 252 252 #endif -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r22508 r22531 526 526 /* Try to avoid GFP_DMA. GFM_DMA32 was introduced with Linux 2.6.15. */ 527 527 #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) 528 /* ZONE_DMA32: 0-4GB */ 528 529 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_DMA32, false /* non-contiguous */); 529 530 if (RT_FAILURE(rc)) 530 531 #endif 531 532 #ifdef RT_ARCH_AMD64 533 /* ZONE_DMA: 0-16MB */ 532 534 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_DMA, false /* non-contiguous */); 533 535 #else 534 536 # ifdef CONFIG_X86_PAE 535 /** XXX GFP_USER can return page frames above 4GB on PAE systems => GFP_DMA? */536 537 # endif 538 /* ZONE_NORMAL: 0-896MB */ 537 539 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_USER, false /* non-contiguous */); 538 540 #endif … … 560 562 561 563 #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) 564 /* ZONE_DMA32: 0-4GB */ 562 565 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_DMA32, true /* contiguous */); 563 566 if (RT_FAILURE(rc)) 564 567 #endif 565 568 #ifdef RT_ARCH_AMD64 569 /* ZONE_DMA: 0-16MB */ 566 570 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_DMA, true /* contiguous */); 567 571 #else 568 # if defined(CONFIG_X86_PAE) 569 /** XXX GFP_USER can return page frames above 4GB on PAE systems => GFP_DMA? */ 570 # endif 572 /* ZONE_NORMAL (32-bit hosts): 0-896MB */ 571 573 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_USER, true /* contiguous */); 572 574 #endif … … 666 668 */ 667 669 if (PhysHighest == NIL_RTHCPHYS) 670 /* ZONE_HIGHMEM: the whole physical memory */ 668 671 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_HIGHUSER); 669 672 else if (PhysHighest <= _1M * 16) 673 /* ZONE_DMA: 0-16MB */ 670 674 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA); 671 675 else … … 673 677 rc = VERR_NO_MEMORY; 674 678 if (RT_FAILURE(rc)) 679 /* ZONE_HIGHMEM: the whole physical memory */ 675 680 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_HIGHUSER); 676 681 if (RT_FAILURE(rc)) 682 /* ZONE_NORMAL: 0-896MB */ 677 683 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_USER); 678 684 #ifdef GFP_DMA32 679 685 if (RT_FAILURE(rc)) 686 /* ZONE_DMA32: 0-4GB */ 680 687 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA32); 681 688 #endif 682 689 if (RT_FAILURE(rc)) 690 /* ZONE_DMA: 0-16MB */ 683 691 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA); 684 692 }
Note:
See TracChangeset
for help on using the changeset viewer.