Changeset 14645
- Timestamp:
- 11/26/08 15:09:41 (1 month ago)
- Files:
-
- trunk/include/VBox/param.h (modified) (3 diffs)
- trunk/include/iprt/err.h (modified) (1 diff)
- trunk/src/VBox/HostDrivers/Support/SUPDrv.c (modified) (4 diffs)
- trunk/src/VBox/HostDrivers/Support/SUPLib.cpp (modified) (8 diffs)
- trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv (modified) (1 diff)
- trunk/src/VBox/VMM/MMHyper.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/param.h
r11177 r14645 38 38 */ 39 39 40 /** The maximum number of pages that can be allocated and mapped 41 * by various MM, PGM and SUP APIs. */ 42 #define VBOX_MAX_ALLOC_PAGE_COUNT (128 * _1M / PAGE_SIZE) 43 40 44 41 45 /** @defgroup grp_vbox_param_mm Memory Monitor Parameters … … 46 50 /** Initial address of Hypervisor Memory Area. 47 51 * MUST BE PAGE TABLE ALIGNED! */ 48 #define MM_HYPER_AREA_ADDRESS 0xa000000052 #define MM_HYPER_AREA_ADDRESS UINT32_C(0xa0000000) 49 53 50 54 /** The max size of the hypervisor memory area. */ 51 #define MM_HYPER_AREA_MAX_SIZE (20 * _1M)55 #define MM_HYPER_AREA_MAX_SIZE (20 * _1M) 52 56 53 57 /** Maximum number of bytes we can dynamically map into the hypervisor region. 54 58 * This must be a power of 2 number of pages! 55 59 */ 56 #define MM_HYPER_DYNAMIC_SIZE (8 * PAGE_SIZE)60 #define MM_HYPER_DYNAMIC_SIZE (8 * PAGE_SIZE) 57 61 58 62 /** @} */ … … 65 69 66 70 /** VMM stack size. */ 67 #define VMM_STACK_SIZE 819271 #define VMM_STACK_SIZE 8192 68 72 69 73 /** @} */ trunk/include/iprt/err.h
r14494 r14645 493 493 /** End of string. */ 494 494 #define VINF_END_OF_STRING 83 495 /** A page count is ouf of range. */ 496 #define VERR_PAGE_COUNT_OUT_OF_RANGE (-84) 495 497 /** @} */ 496 498 trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r14575 r14645 46 46 #include <iprt/cpuset.h> 47 47 #include <iprt/uuid.h> 48 #include <VBox/param.h> 48 49 #include <VBox/log.h> 49 50 #include <VBox/err.h> … … 2071 2072 if (cPages < 1 || cPages >= 256) 2072 2073 { 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; 2075 2076 } 2076 2077 … … 2152 2153 2153 2154 } 2154 if (cPages < 1 || cPages > 256)2155 if (cPages < 1 || cPages >= 256) 2155 2156 { 2156 2157 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; 2158 2159 } 2159 2160 … … 2393 2394 AssertReturn(ppvR3 || ppvR0, VERR_INVALID_PARAMETER); 2394 2395 AssertReturn(!fFlags, VERR_INVALID_PARAMETER); 2395 if (cPages < 1 || cPages > (128 * _1M)/PAGE_SIZE)2396 if (cPages < 1 || cPages > VBOX_MAX_ALLOC_PAGE_COUNT) 2396 2397 { 2397 2398 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; 2399 2400 } 2400 2401 trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r14632 r14645 727 727 AssertPtrReturn(ppvPages, VERR_INVALID_POINTER); 728 728 *ppvPages = NULL; 729 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);729 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 730 730 731 731 #ifdef RT_OS_WINDOWS … … 750 750 */ 751 751 AssertPtrReturn(pvPages, VERR_INVALID_POINTER); 752 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);752 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 753 753 754 754 #ifdef RT_OS_WINDOWS … … 863 863 */ 864 864 AssertPtrReturn(pvPages, VERR_INVALID_POINTER); 865 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);865 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 866 866 867 867 /* … … 912 912 *pR0Ptr = NIL_RTR0PTR; 913 913 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); 915 915 916 916 /* fake */ … … 998 998 */ 999 999 AssertPtrReturn(pvPages, VERR_INVALID_POINTER); 1000 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);1000 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 1001 1001 1002 1002 /* fake */ … … 1099 1099 return VINF_SUCCESS; 1100 1100 AssertPtrReturn(pv, VERR_INVALID_POINTER); 1101 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);1101 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 1102 1102 1103 1103 /* fake */ … … 1134 1134 *ppvPages = NULL; 1135 1135 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); 1137 1137 1138 1138 /* fake */ … … 1199 1199 return VINF_SUCCESS; 1200 1200 AssertPtrReturn(pv, VERR_INVALID_POINTER); 1201 AssertReturn(cPages > 0, VERR_ INVALID_PARAMETER);1201 AssertReturn(cPages > 0, VERR_PAGE_COUNT_OUT_OF_RANGE); 1202 1202 1203 1203 /* fake */ trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv
r14432 r14645 59 59 ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \ 60 60 ${PATH_ROOT}/include/VBox/log.h=>include/VBox/log.h \ 61 ${PATH_ROOT}/include/VBox/param.h=>include/VBox/param.h \ 61 62 ${PATH_ROOT}/include/VBox/sup.h=>include/VBox/sup.h \ 62 63 ${PATH_ROOT}/include/VBox/types.h=>include/VBox/types.h \ trunk/src/VBox/VMM/MMHyper.cpp
r14637 r14645 537 537 AssertPtrReturn(pvR3, VERR_INVALID_POINTER); 538 538 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); 541 541 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER); 542 542 AssertReturn(*pszDesc, VERR_INVALID_PARAMETER);

