changeset cf7c4345ea82 in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=cf7c4345ea82 description: process: get rid of some unused code & vars
diffstat: src/sim/process.cc | 72 ------------------------------------------------------ src/sim/process.hh | 7 ----- 2 files changed, 0 insertions(+), 79 deletions(-) diffs (120 lines): diff -r 2a5e4070155e -r cf7c4345ea82 src/sim/process.cc --- a/src/sim/process.cc Mon Jul 05 21:39:38 2010 -0700 +++ b/src/sim/process.cc Mon Jul 05 21:39:38 2010 -0700 @@ -496,7 +496,6 @@ void Process::serialize(std::ostream &os) { - SERIALIZE_SCALAR(initialContextLoaded); SERIALIZE_SCALAR(brk_point); SERIALIZE_SCALAR(stack_base); SERIALIZE_SCALAR(stack_size); @@ -519,7 +518,6 @@ void Process::unserialize(Checkpoint *cp, const std::string §ion) { - UNSERIALIZE_SCALAR(initialContextLoaded); UNSERIALIZE_SCALAR(brk_point); UNSERIALIZE_SCALAR(stack_base); UNSERIALIZE_SCALAR(stack_size); @@ -579,76 +577,6 @@ } void -LiveProcess::argsInit(int intSize, int pageSize) -{ - Process::startup(); - - // load object file into target memory - objFile->loadSections(initVirtMem); - - // Calculate how much space we need for arg & env arrays. - int argv_array_size = intSize * (argv.size() + 1); - int envp_array_size = intSize * (envp.size() + 1); - int arg_data_size = 0; - for (vector<string>::size_type i = 0; i < argv.size(); ++i) { - arg_data_size += argv[i].size() + 1; - } - int env_data_size = 0; - for (vector<string>::size_type i = 0; i < envp.size(); ++i) { - env_data_size += envp[i].size() + 1; - } - - int space_needed = - argv_array_size + envp_array_size + arg_data_size + env_data_size; - if (space_needed < 32*1024) - space_needed = 32*1024; - - // set bottom of stack - stack_min = stack_base - space_needed; - // align it - stack_min = roundDown(stack_min, pageSize); - stack_size = stack_base - stack_min; - // map memory - pTable->allocate(stack_min, roundUp(stack_size, pageSize)); - - // map out initial stack contents - Addr argv_array_base = stack_min + intSize; // room for argc - Addr envp_array_base = argv_array_base + argv_array_size; - Addr arg_data_base = envp_array_base + envp_array_size; - Addr env_data_base = arg_data_base + arg_data_size; - - // write contents to stack - uint64_t argc = argv.size(); - if (intSize == 8) - argc = htog((uint64_t)argc); - else if (intSize == 4) - argc = htog((uint32_t)argc); - else - panic("Unknown int size"); - - initVirtMem->writeBlob(stack_min, (uint8_t*)&argc, intSize); - - copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem); - copyStringArray(envp, envp_array_base, env_data_base, initVirtMem); - - ThreadContext *tc = system->getThreadContext(contextIds[0]); - - setSyscallArg(tc, 0, argc); - setSyscallArg(tc, 1, argv_array_base); - tc->setIntReg(StackPointerReg, stack_min); - - Addr prog_entry = objFile->entryPoint(); - tc->setPC(prog_entry); - tc->setNextPC(prog_entry + sizeof(MachInst)); - -#if THE_ISA != ALPHA_ISA && THE_ISA != POWER_ISA //e.g. MIPS or Sparc - tc->setNextNPC(prog_entry + (2 * sizeof(MachInst))); -#endif - - num_processes++; -} - -void LiveProcess::syscall(int64_t callnum, ThreadContext *tc) { num_syscalls++; diff -r 2a5e4070155e -r cf7c4345ea82 src/sim/process.hh --- a/src/sim/process.hh Mon Jul 05 21:39:38 2010 -0700 +++ b/src/sim/process.hh Mon Jul 05 21:39:38 2010 -0700 @@ -79,11 +79,6 @@ /// running on. System *system; - // have we initialized a thread context from this process? If - // yes, subsequent contexts are assumed to be for dynamically - // created threads and are not initialized. - bool initialContextLoaded; - bool checkpointRestored; // thread contexts associated with this process @@ -250,8 +245,6 @@ LiveProcess(LiveProcessParams * params, ObjectFile *objFile); - virtual void argsInit(int intSize, int pageSize); - // Id of the owner of the process uint64_t __uid; uint64_t __euid; _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev