VirtualBox

Changeset 22531 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 27, 2009 3:17:53 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51553
Message:

IPRT/r0drv/Linux: fixed comments about allocations

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  
    240240    cOrder = CalcPowerOf2Order(cPages);
    241241#if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
     242    /* ZONE_DMA32: 0-4GB */
    242243    paPages = alloc_pages(GFP_DMA32, cOrder);
    243244    if (!paPages)
    244245#endif
    245246#ifdef RT_ARCH_AMD64
     247        /* ZONE_DMA; 0-16MB */
    246248        paPages = alloc_pages(GFP_DMA, cOrder);
    247249#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 */
    251251        paPages = alloc_pages(GFP_USER, cOrder);
    252252#endif
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r22508 r22531  
    526526    /* Try to avoid GFP_DMA. GFM_DMA32 was introduced with Linux 2.6.15. */
    527527#if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
     528    /* ZONE_DMA32: 0-4GB */
    528529    rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_DMA32, false /* non-contiguous */);
    529530    if (RT_FAILURE(rc))
    530531#endif
    531532#ifdef RT_ARCH_AMD64
     533        /* ZONE_DMA: 0-16MB */
    532534        rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_DMA, false /* non-contiguous */);
    533535#else
    534536# ifdef CONFIG_X86_PAE
    535         /** XXX GFP_USER can return page frames above 4GB on PAE systems => GFP_DMA? */
    536537# endif
     538        /* ZONE_NORMAL: 0-896MB */
    537539        rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, GFP_USER, false /* non-contiguous */);
    538540#endif
     
    560562
    561563#if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
     564    /* ZONE_DMA32: 0-4GB */
    562565    rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_DMA32, true /* contiguous */);
    563566    if (RT_FAILURE(rc))
    564567#endif
    565568#ifdef RT_ARCH_AMD64
     569        /* ZONE_DMA: 0-16MB */
    566570        rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_DMA, true /* contiguous */);
    567571#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 */
    571573        rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, GFP_USER, true /* contiguous */);
    572574#endif
     
    666668     */
    667669    if (PhysHighest == NIL_RTHCPHYS)
     670        /* ZONE_HIGHMEM: the whole physical memory */
    668671        rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_HIGHUSER);
    669672    else if (PhysHighest <= _1M * 16)
     673        /* ZONE_DMA: 0-16MB */
    670674        rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA);
    671675    else
     
    673677        rc = VERR_NO_MEMORY;
    674678        if (RT_FAILURE(rc))
     679            /* ZONE_HIGHMEM: the whole physical memory */
    675680            rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_HIGHUSER);
    676681        if (RT_FAILURE(rc))
     682            /* ZONE_NORMAL: 0-896MB */
    677683            rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_USER);
    678684#ifdef GFP_DMA32
    679685        if (RT_FAILURE(rc))
     686            /* ZONE_DMA32: 0-4GB */
    680687            rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA32);
    681688#endif
    682689        if (RT_FAILURE(rc))
     690            /* ZONE_DMA: 0-16MB */
    683691            rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, PhysHighest, GFP_DMA);
    684692    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette