/*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2001-2004 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "sim/builder.hh"
#include "sim/fake_syscall.hh"
#include "sim/process.hh"
-#include "sim/sim_stats.hh"
+#include "sim/stats.hh"
#ifdef TARGET_ALPHA
#include "arch/alpha/alpha_tru64_process.hh"
// allocate initial register file
init_regs = new RegFile;
+ memset(init_regs, 0, sizeof(RegFile));
// initialize first 3 fds (stdin, stdout, stderr)
fd_map[STDIN_FILENO] = stdin_fd;
void
Process::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
num_syscalls
.name(name() + ".PROG:num_syscalls")
// copy process's initial regs struct
xc->regs = *init_regs;
- // mark this context as active
- xc->setStatus(ExecContext::Active);
+ // mark this context as active.
+ // activate with zero delay so that we start ticking right
+ // away on cycle 0
+ xc->activate(0);
}
// return CPU number to caller and increment available CPU count
void
-Process::replaceExecContext(int xcIndex, ExecContext *xc)
+Process::replaceExecContext(ExecContext *xc, int xcIndex)
{
if (xcIndex >= execContexts.size()) {
panic("replaceExecContext: bad xcIndex, %d >= %d\n",
// that can be constructed (i.e., no REGISTER_SIM_OBJECT() macro call,
// which is where these get declared for concrete types).
//
-DEFINE_SIM_OBJECT_CLASS_NAME("Process object", Process)
+DEFINE_SIM_OBJECT_CLASS_NAME("Process", Process)
////////////////////////////////////////////////////////////////////////
// dummy for default env
vector<string> null_vec;
- // We do this with "temp" because of the bogus compiler warning
- // you get with g++ 2.95 -O if you just "return new LiveProcess(..."
- LiveProcess *temp = LiveProcess::create(getInstanceName(),
- stdin_fd, stdout_fd, stderr_fd,
- cmd,
- env.isValid() ? env : null_vec);
-
- return temp;
+ return LiveProcess::create(getInstanceName(),
+ stdin_fd, stdout_fd, stderr_fd,
+ cmd,
+ env.isValid() ? env : null_vec);
}