VirtualBox

Changeset 26847 in vbox for trunk/src


Ignore:
Timestamp:
Feb 26, 2010 1:19:14 PM (15 years ago)
Author:
vboxsync
Message:

Don't pass uAlignment=0 to rtR0MemObjNativeAllocPhys, resolve the alias like is done for the other APIs.

Location:
trunk/src/VBox/Runtime
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/memobj.h

    r26433 r26847  
    354354
    355355/**
    356  * Allocates contiguous page aligned physical memory without (necessarily) any kernel mapping.
     356 * Allocates contiguous page aligned physical memory without (necessarily) any
     357 * kernel mapping.
    357358 *
    358359 * @returns IPRT status code.
     
    362363 *                          NIL_RTHCPHYS if any address is acceptable.
    363364 * @param   uAlignment      The alignment of the reserved memory.
    364  *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G.
     365 *                          Supported values are PAGE_SIZE, _2M, _4M and _1G.
    365366 */
    366367int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment);
  • trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp

    r26430 r26847  
    570570int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
    571571{
    572     /** @todo */
    573     if (    uAlignment != 0
    574         &&  uAlignment != PAGE_SIZE)
     572    /** @todo alignment */
     573    if (uAlignment != PAGE_SIZE)
    575574        return VERR_NOT_SUPPORTED;
    576575
  • trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

    r26829 r26847  
    331331    /** @todo check if there is a more appropriate API somewhere.. */
    332332
    333     /** @todo */
    334     if (    uAlignment != 0
    335         &&  uAlignment != PAGE_SIZE)
     333    /** @todo alignment */
     334    if (uAlignment != PAGE_SIZE)
    336335        return VERR_NOT_SUPPORTED;
    337336
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r26430 r26847  
    702702int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
    703703{
    704     /* @todo */
    705     if (    uAlignment != 0
    706         &&  uAlignment != PAGE_SIZE)
     704    /** @todo alignment */
     705    if (uAlignment != PAGE_SIZE)
    707706        return VERR_NOT_SUPPORTED;
    708707
  • trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp

    r26492 r26847  
    587587RT_EXPORT_SYMBOL(RTR0MemObjAllocPhys);
    588588
     589
    589590/**
    590591 * Allocates contiguous physical memory without (necessarily) any kernel mapping.
     
    607608    AssertReturn(cb <= cbAligned, VERR_INVALID_PARAMETER);
    608609    AssertReturn(PhysHighest >= cb, VERR_INVALID_PARAMETER);
     610    if (uAlignment == 0)
     611        uAlignment = PAGE_SIZE;
     612    AssertReturn(    uAlignment == PAGE_SIZE
     613                 ||  uAlignment == _2M
     614                 ||  uAlignment == _4M
     615                 ||  uAlignment == _1G,
     616                 VERR_INVALID_PARAMETER);
    609617#if HC_ARCH_BITS == 32
    610     /* Memory allocated in this way is typically mapped into kernel space as well; simply don't allow this
    611      * on 32 bits hosts as the kernel space is too crowded already.
    612      */
    613     if (    uAlignment != 0
    614         &&  uAlignment != PAGE_SIZE)
     618    /* Memory allocated in this way is typically mapped into kernel space as well; simply
     619       don't allow this on 32 bits hosts as the kernel space is too crowded already. */
     620    if (uAlignment != PAGE_SIZE)
    615621        return VERR_NOT_SUPPORTED;
    616 #else
    617     AssertReturn((    uAlignment == 0
    618                   ||  uAlignment == PAGE_SIZE
    619                   ||  uAlignment == _2M
    620                   ||  uAlignment == _4M
    621                   ||  uAlignment == _1G), VERR_INVALID_PARAMETER);
    622622#endif
    623623    RT_ASSERT_PREEMPTIBLE();
  • trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp

    r26840 r26847  
    401401     * current limit is kind of random...
    402402     */
    403     if (cb < _128K
    404         && (uAlignment == 0 || uAlignment == PAGE_SIZE))
     403    if (   cb < _128K
     404        && uAlignment == PAGE_SIZE)
    405405
    406406    {
  • trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp

    r26430 r26847  
    199199    AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_IMPLEMENTED);
    200200
    201     /** @todo */
    202     if (    uAlignment != 0
    203         &&  uAlignment != PAGE_SIZE)
     201    /** @todo alignment  */
     202    if (uAlignment != PAGE_SIZE)
    204203        return VERR_NOT_SUPPORTED;
    205204
     
    228227{
    229228    /** @todo rtR0MemObjNativeAllocPhys / darwin. */
    230     return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest);
     229    return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE);
    231230}
    232231
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c

    r26430 r26847  
    196196    AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_IMPLEMENTED);
    197197
    198     /** @todo */
    199     if (    uAlignment != 0
    200         &&  uAlignment != PAGE_SIZE)
     198    /** @todo alignment */
     199    if (uAlignment != PAGE_SIZE)
    201200        return VERR_NOT_SUPPORTED;
    202201
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