1/* 2 * Copyright (c) 2003-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 324 unchanged lines hidden (view full) --- 333 (uint8_t*)&zero, 2 * intSize); 334 335 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); 336 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem); 337 338 initVirtMem->writeBlob(argc_base, (uint8_t*)&guestArgc, intSize); 339 340 //Set up the thread context to start running the process |
341 assert(NumArgumentRegs >= 2); 342 threadContexts[0]->setIntReg(ArgumentReg[0], argc); 343 threadContexts[0]->setIntReg(ArgumentReg[1], argv_array_base); |
344 threadContexts[0]->setIntReg(StackPointerReg, stack_min); 345 346 Addr prog_entry = objFile->entryPoint(); 347 threadContexts[0]->setPC(prog_entry); 348 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst)); 349 350 //Align the "stack_min" to a page boundary. 351 stack_min = roundDown(stack_min, pageSize); 352 353// num_processes++; 354} |