diff options
author | Brandon Potter <brandon.potter@amd.com> | 2016-11-09 14:27:41 -0600 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2016-11-09 14:27:41 -0600 |
commit | 49009f170a631eea259dc031b3ce4593f8783d19 (patch) | |
tree | 3a424b1a3aa32e067a7d008dd7f4c85524bd2b44 /src/sim/process.cc | |
parent | ea8461885ffffa0933cedeb9143a9b01be4c70f0 (diff) | |
download | gem5-49009f170a631eea259dc031b3ce4593f8783d19.tar.xz |
syscall_emul: [patch 8/22] refactor process class
Moves aux_vector into its own .hh and .cc files just to get it out of the
already crowded Process files. Arguably, it could stay there, but it's
probably better just to move it and give it files.
The changeset looks ugly around the Process header file, but the goal here is
to move methods and members around so that they're not defined randomly
throughout the entire header file. I expect this is likely one of the reasons
why I several unused variables related to this class. So, the methods are
declared first followed by members. I've tried to aggregate them together
so that similar entries reside near one another.
There are other changes coming to this code so this is by no means the
final product.
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r-- | src/sim/process.cc | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc index bcb9b582f..50ebc9cec 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -93,17 +93,6 @@ using namespace TheISA; // current number of allocated processes int num_processes = 0; -template<class IntType> - -AuxVector<IntType>::AuxVector(IntType type, IntType val) -{ - a_type = TheISA::htog(type); - a_val = TheISA::htog(val); -} - -template struct AuxVector<uint32_t>; -template struct AuxVector<uint64_t>; - static int openFile(const string& filename, int flags, mode_t mode) { @@ -205,7 +194,6 @@ Process::Process(ProcessParams * params, ObjectFile * obj_file) } } - void Process::regStats() { @@ -497,7 +485,6 @@ Process::unserialize(CheckpointIn &cp) // found. } - bool Process::map(Addr vaddr, Addr paddr, int size, bool cacheable) { @@ -506,7 +493,6 @@ Process::map(Addr vaddr, Addr paddr, int size, bool cacheable) return true; } - void Process::syscall(int64_t callnum, ThreadContext *tc) { @@ -525,7 +511,6 @@ Process::getSyscallArg(ThreadContext *tc, int &i, int width) return getSyscallArg(tc, i); } - EmulatedDriver * Process::findDriver(std::string filename) { @@ -561,14 +546,12 @@ Process::updateBias() interp->updateBias(ld_bias); } - ObjectFile * Process::getInterpreter() { return objFile->getInterpreter(); } - Addr Process::getBias() { @@ -577,7 +560,6 @@ Process::getBias() return interp ? interp->bias() : objFile->bias(); } - Addr Process::getStartPC() { @@ -586,7 +568,6 @@ Process::getStartPC() return interp ? interp->entryPoint() : objFile->entryPoint(); } - Process * ProcessParams::create() { @@ -634,7 +615,6 @@ ProcessParams::create() } break; - case ObjectFile::Solaris: process = new SparcSolarisProcess(this, obj_file); break; @@ -743,3 +723,17 @@ ProcessParams::create() fatal("Unknown error creating process object."); return process; } + +std::string +Process::fullPath(const std::string &file_name) +{ + if (file_name[0] == '/' || cwd.empty()) + return file_name; + + std::string full = cwd; + + if (cwd[cwd.size() - 1] != '/') + full += '/'; + + return full + file_name; +} |