- Timestamp:
- 10/14/08 19:37:36 (1 month ago)
- Files:
-
- 1 modified
-
Whitix/branches/keobject/fs/vfs/load.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/fs/vfs/load.c
r1079 r1133 34 34 */ 35 35 36 #define NUM_ARG_PAGES 32 37 #define STACK_SIZE 32 /* megabytes */ 38 #define LOAD_STACK_SIZE STACK_SIZE*1024*1024 39 36 40 struct ExecArgs 37 41 { … … 45 49 DWORD entryPoint,stackPos; 46 50 DWORD* stackP; 47 DWORD argPages[ 32];51 DWORD argPages[NUM_ARG_PAGES]; 48 52 }; 49 53 … … 261 265 ***********************************************************************/ 262 266 263 #define ARG_MAX_PAGES 32 /* Good number of arguments. */264 265 267 static int ExecCopyArgs(struct ExecArgs* args) 266 268 { 267 269 int argCount; 268 270 269 argCount=ExecCountArgs(args->argv, PAGE_SIZE* ARG_MAX_PAGES);271 argCount=ExecCountArgs(args->argv, PAGE_SIZE*NUM_ARG_PAGES); 270 272 if (argCount < 0) 271 273 return argCount; … … 336 338 execArgs->argc=0; 337 339 338 ZeroMemory(execArgs->argPages, sizeof(DWORD)* 32);340 ZeroMemory(execArgs->argPages, sizeof(DWORD)*NUM_ARG_PAGES); 339 341 execArgs->stackPos=0; 340 342 } … … 427 429 SYMBOL_EXPORT(Exec); 428 430 429 #define ARG_PAGES 30 /* 30 pages is a good enough size for a stack */430 431 431 static int ExecAllocateStack(struct ExecArgs* args) 432 432 { 433 if (!MMapDo(args->process, NULL, ARCH_STACK_TOP-(ARG_PAGES*PAGE_SIZE), ARG_PAGES*PAGE_SIZE, PAGE_RW | PAGE_PRESENT | PAGE_USER, 0, 433 if (!MMapDo(args->process, NULL, ARCH_STACK_TOP - LOAD_STACK_SIZE, 434 LOAD_STACK_SIZE, PAGE_RW | PAGE_PRESENT | PAGE_USER, 0, 434 435 MMAP_PRIVATE | MMAP_FIXED, NULL)) 435 436 return -EFAULT;
