#include "arch/mips/linux_process.hh"
#include "base/loader/object_file.hh"
#include "base/misc.hh"
+ #include "cpu/exec_context.hh"
+ #include "sim/builder.hh"
+ #include "sim/system.hh"
using namespace std;
+ using namespace MipsISA;
- namespace MipsISA
- {
- LiveProcess *
- createProcess(const string &nm, ObjectFile * objFile, System * system,
- int stdin_fd, int stdout_fd, int stderr_fd,
- vector<string> &argv, vector<string> &envp)
+ MipsLiveProcess *
+ MipsLiveProcess::create(const std::string &nm, System *system, int stdin_fd,
+ int stdout_fd, int stderr_fd, std::string executable,
+ std::vector<std::string> &argv, std::vector<std::string> &envp)
{
- LiveProcess * process = NULL;
+ MipsLiveProcess *process = NULL;
+
+ ObjectFile *objFile = createObjectFile(executable);
+ if (objFile == NULL) {
+ fatal("Can't load object file %s", executable);
+ }
+
+
- if (objFile->getArch() != ObjectFile::MIPS)
+ if (objFile->getArch() != ObjectFile::Mips)
fatal("Object file does not match architecture.");
switch (objFile->getOpSys()) {
case ObjectFile::Linux: