This patch pulls out the auxiliary vector struct from individual ISA
LiveProcesses to the base LiveProcess definition so anyone can use them.
This commit is contained in:
parent
041ca19edc
commit
e2c7618e50
|
@ -71,26 +71,6 @@ class SparcLiveProcess : public LiveProcess
|
||||||
virtual void flushWindows(ThreadContext *tc) = 0;
|
virtual void flushWindows(ThreadContext *tc) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class IntType>
|
|
||||||
struct M5_auxv_t
|
|
||||||
{
|
|
||||||
IntType a_type;
|
|
||||||
union {
|
|
||||||
IntType a_val;
|
|
||||||
IntType a_ptr;
|
|
||||||
IntType a_fcn;
|
|
||||||
};
|
|
||||||
|
|
||||||
M5_auxv_t()
|
|
||||||
{}
|
|
||||||
|
|
||||||
M5_auxv_t(IntType type, IntType val)
|
|
||||||
{
|
|
||||||
a_type = SparcISA::htog(type);
|
|
||||||
a_val = SparcISA::htog(val);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Sparc32LiveProcess : public SparcLiveProcess
|
class Sparc32LiveProcess : public SparcLiveProcess
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -103,11 +103,6 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace X86ISA;
|
using namespace X86ISA;
|
||||||
|
|
||||||
M5_64_auxv_t::M5_64_auxv_t(int64_t type, int64_t val)
|
|
||||||
{
|
|
||||||
a_type = X86ISA::htog(type);
|
|
||||||
a_val = X86ISA::htog(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
X86LiveProcess::X86LiveProcess(LiveProcessParams * params,
|
X86LiveProcess::X86LiveProcess(LiveProcessParams * params,
|
||||||
ObjectFile *objFile)
|
ObjectFile *objFile)
|
||||||
|
@ -205,7 +200,9 @@ X86LiveProcess::startup()
|
||||||
void
|
void
|
||||||
X86LiveProcess::argsInit(int intSize, int pageSize)
|
X86LiveProcess::argsInit(int intSize, int pageSize)
|
||||||
{
|
{
|
||||||
typedef M5_64_auxv_t auxv_t;
|
typedef M5_auxv_t<uint64_t> auxv_t;
|
||||||
|
std::vector<auxv_t> auxv;
|
||||||
|
|
||||||
Process::startup();
|
Process::startup();
|
||||||
|
|
||||||
string filename;
|
string filename;
|
||||||
|
|
|
@ -64,26 +64,10 @@
|
||||||
|
|
||||||
namespace X86ISA
|
namespace X86ISA
|
||||||
{
|
{
|
||||||
struct M5_64_auxv_t
|
|
||||||
{
|
|
||||||
int64_t a_type;
|
|
||||||
union {
|
|
||||||
int64_t a_val;
|
|
||||||
int64_t a_ptr;
|
|
||||||
int64_t a_fcn;
|
|
||||||
};
|
|
||||||
|
|
||||||
M5_64_auxv_t()
|
|
||||||
{}
|
|
||||||
|
|
||||||
M5_64_auxv_t(int64_t type, int64_t val);
|
|
||||||
};
|
|
||||||
|
|
||||||
class X86LiveProcess : public LiveProcess
|
class X86LiveProcess : public LiveProcess
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::vector<M5_64_auxv_t> auxv;
|
|
||||||
|
|
||||||
X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile);
|
X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile);
|
||||||
|
|
||||||
void startup();
|
void startup();
|
||||||
|
|
|
@ -86,6 +86,16 @@ using namespace TheISA;
|
||||||
// current number of allocated processes
|
// current number of allocated processes
|
||||||
int num_processes = 0;
|
int num_processes = 0;
|
||||||
|
|
||||||
|
template<class IntType>
|
||||||
|
M5_auxv_t<IntType>::M5_auxv_t(IntType type, IntType val)
|
||||||
|
{
|
||||||
|
a_type = TheISA::htog(type);
|
||||||
|
a_val = TheISA::htog(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
template class M5_auxv_t<uint32_t>;
|
||||||
|
template class M5_auxv_t<uint64_t>;
|
||||||
|
|
||||||
Process::Process(ProcessParams * params)
|
Process::Process(ProcessParams * params)
|
||||||
: SimObject(params), system(params->system), checkpointRestored(false),
|
: SimObject(params), system(params->system), checkpointRestored(false),
|
||||||
max_stack_size(params->max_stack_size)
|
max_stack_size(params->max_stack_size)
|
||||||
|
|
|
@ -61,6 +61,22 @@ namespace TheISA
|
||||||
class RemoteGDB;
|
class RemoteGDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class IntType>
|
||||||
|
struct M5_auxv_t
|
||||||
|
{
|
||||||
|
IntType a_type;
|
||||||
|
union {
|
||||||
|
IntType a_val;
|
||||||
|
IntType a_ptr;
|
||||||
|
IntType a_fcn;
|
||||||
|
};
|
||||||
|
|
||||||
|
M5_auxv_t()
|
||||||
|
{}
|
||||||
|
|
||||||
|
M5_auxv_t(IntType type, IntType val);
|
||||||
|
};
|
||||||
|
|
||||||
class Process : public SimObject
|
class Process : public SimObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue