VirtualBox

Changeset 14645 in vbox for trunk/src


Ignore:
Timestamp:
Nov 26, 2008 2:09:41 PM (16 years ago)
Author:
vboxsync
Message:

SUP, VMM: Moved the max alloc/map page count to VBox/param.h

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r14575 r14645  
    4646#include <iprt/cpuset.h>
    4747#include <iprt/uuid.h>
     48#include <VBox/param.h>
    4849#include <VBox/log.h>
    4950#include <VBox/err.h>
     
    20712072    if (cPages < 1 || cPages >= 256)
    20722073    {
    2073         Log(("Illegal request cPages=%d, must be greater than 0 and smaller than 256\n", cPages));
    2074         return VERR_INVALID_PARAMETER;
     2074        Log(("Illegal request cPages=%d, must be greater than 0 and smaller than 256.\n", cPages));
     2075        return VERR_PAGE_COUNT_OUT_OF_RANGE;
    20752076    }
    20762077
     
    21522153
    21532154    }
    2154     if (cPages < 1 || cPages > 256)
     2155    if (cPages < 1 || cPages >= 256)
    21552156    {
    21562157        Log(("Illegal request cPages=%d, must be greater than 0 and smaller than 256.\n", cPages));
    2157         return VERR_INVALID_PARAMETER;
     2158        return VERR_PAGE_COUNT_OUT_OF_RANGE;
    21582159    }
    21592160
     
    23932394    AssertReturn(ppvR3 || ppvR0, VERR_INVALID_PARAMETER);
    23942395    AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
    2395     if (cPages < 1 || cPages > (128 * _1M)/PAGE_SIZE)
     2396    if (cPages < 1 || cPages > VBOX_MAX_ALLOC_PAGE_COUNT)
    23962397    {
    23972398        Log(("SUPR0PageAlloc: Illegal request cb=%u; must be greater than 0 and smaller than 128MB.\n", cPages));
    2398         return VERR_INVALID_PARAMETER;
     2399        return VERR_PAGE_COUNT_OUT_OF_RANGE;
    23992400    }
    24002401
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r14632 r14645  
    727727    AssertPtrReturn(ppvPages, VERR_INVALID_POINTER);
    728728    *ppvPages = NULL;
    729     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     729    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    730730
    731731#ifdef RT_OS_WINDOWS
     
    750750     */
    751751    AssertPtrReturn(pvPages, VERR_INVALID_POINTER);
    752     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     752    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    753753
    754754#ifdef RT_OS_WINDOWS
     
    863863     */
    864864    AssertPtrReturn(pvPages, VERR_INVALID_POINTER);
    865     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     865    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    866866
    867867    /*
     
    912912        *pR0Ptr = NIL_RTR0PTR;
    913913    AssertPtrNullReturn(paPages, VERR_INVALID_POINTER);
    914     AssertMsgReturn(cPages > 0 && cPages < 16384, ("cPages=%zu\n", cPages), VERR_INVALID_PARAMETER);
     914    AssertMsgReturn(cPages > 0 && cPages <= VBOX_MAX_ALLOC_PAGE_COUNT, ("cPages=%zu\n", cPages), VERR_PAGE_COUNT_OUT_OF_RANGE);
    915915
    916916    /* fake */
     
    998998     */
    999999    AssertPtrReturn(pvPages, VERR_INVALID_POINTER);
    1000     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     1000    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    10011001
    10021002    /* fake */
     
    10991099        return VINF_SUCCESS;
    11001100    AssertPtrReturn(pv, VERR_INVALID_POINTER);
    1101     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     1101    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    11021102
    11031103    /* fake */
     
    11341134    *ppvPages = NULL;
    11351135    AssertPtrReturn(paPages, VERR_INVALID_POINTER);
    1136     AssertMsgReturn(cPages > 0 && cPages < 256, ("cPages=%d must be > 0 and < 256\n", cPages), VERR_INVALID_PARAMETER);
     1136    AssertMsgReturn(cPages > 0 && cPages < 256, ("cPages=%d must be > 0 and < 256\n", cPages), VERR_PAGE_COUNT_OUT_OF_RANGE);
    11371137
    11381138    /* fake */
     
    11991199        return VINF_SUCCESS;
    12001200    AssertPtrReturn(pv, VERR_INVALID_POINTER);
    1201     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
     1201    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
    12021202
    12031203    /* fake */
  • trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv

    r14432 r14645  
    5959    ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
    6060    ${PATH_ROOT}/include/VBox/log.h=>include/VBox/log.h \
     61    ${PATH_ROOT}/include/VBox/param.h=>include/VBox/param.h \
    6162    ${PATH_ROOT}/include/VBox/sup.h=>include/VBox/sup.h \
    6263    ${PATH_ROOT}/include/VBox/types.h=>include/VBox/types.h \
  • trunk/src/VBox/VMM/MMHyper.cpp

    r14637 r14645  
    537537    AssertPtrReturn(pvR3, VERR_INVALID_POINTER);
    538538    AssertPtrReturn(paPages, VERR_INVALID_POINTER);
    539     AssertReturn(cPages > 0, VERR_INVALID_PARAMETER);
    540     AssertReturn(cPages < 128 * _1M / PAGE_SIZE, VERR_INVALID_PARAMETER);
     539    AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE);
     540    AssertReturn(cPages <= VBOX_MAX_ALLOC_PAGE_COUNT, VERR_PAGE_COUNT_OUT_OF_RANGE);
    541541    AssertPtrReturn(pszDesc, VERR_INVALID_POINTER);
    542542    AssertReturn(*pszDesc, VERR_INVALID_PARAMETER);
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