func(self, isa, os)
- def makeLiveProcessArgs(self, **kwargs):
- # set up default args for LiveProcess object
+ def makeProcessArgs(self, **kwargs):
+ # set up default args for Process object
process_args = {}
process_args['cmd'] = [ self.name ] + self.args
process_args['executable'] = self.executable
return process_args
- def makeLiveProcess(self, **kwargs):
- process_args = self.makeLiveProcessArgs(**kwargs)
+ def makeProcess(self, **kwargs):
+ process_args = self.makeProcessArgs(**kwargs)
# figure out working directory: use m5's outdir unless
- # overridden by LiveProcess's cwd param
+ # overridden by Process's cwd param
cwd = process_args.get('cwd')
if not cwd:
# copy input files to working directory
for d in self.inputs_dir:
copyfiles(d, cwd)
- # generate LiveProcess object
- from m5.objects import LiveProcess
- return LiveProcess(**process_args)
+ # generate Process object
+ from m5.objects import Process
+ return Process(**process_args)
def __str__(self):
return self.name
print 'class: %s' % bench.__name__
x = bench('alpha', 'tru64', input_set)
print '%s: %s' % (x, input_set)
- pprint(x.makeLiveProcessArgs())
+ pprint(x.makeProcessArgs())
print
# OpenCL driver
driver = ClDriver(filename="hsa", codefile=kernel_files)
for cpu in cpu_list:
- cpu.workload = LiveProcess(executable = executable,
- cmd = [options.cmd] + options.options.split(),
- drivers = [driver])
+ cpu.workload = Process(executable = executable,
+ cmd = [options.cmd] + options.options.split(),
+ drivers = [driver])
for cp in cp_list:
cp.workload = host_cpu.workload
idx = 0
for wrkld in workloads:
- process = LiveProcess()
+ process = Process()
process.executable = wrkld
process.cwd = os.getcwd()
else:
exec("workload = %s(buildEnv['TARGET_ISA', 'linux', '%s')" % (
app, options.spec_input))
- multiprocesses.append(workload.makeLiveProcess())
+ multiprocesses.append(workload.makeProcess())
except:
print >>sys.stderr, "Unable to find workload for %s: %s" % (
buildEnv['TARGET_ISA'], app)
binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello'
# Create a process for a simple "Hello World" application
-process = LiveProcess()
+process = Process()
# Set the command
# cmd is a list which begins with the executable (like argv)
process.cmd = [binary]
system.mem_ctrl.port = system.membus.master
# Create a process for a simple "Hello World" application
-process = LiveProcess()
+process = Process()
# Set the command
# cmd is a list which begins with the executable (like argv)
process.cmd = [binary]
# --------------------
# Define Splash2 Benchmarks
# ====================
-class Cholesky(LiveProcess):
+class Cholesky(Process):
executable = options.rootdir + '/kernels/cholesky/CHOLESKY'
cmd = 'CHOLESKY -p' + str(options.numcpus) + ' '\
+ options.rootdir + '/kernels/cholesky/inputs/tk23.O'
-class FFT(LiveProcess):
+class FFT(Process):
executable = options.rootdir + 'kernels/fft/FFT'
cmd = 'FFT -p' + str(options.numcpus) + ' -m18'
-class LU_contig(LiveProcess):
+class LU_contig(Process):
executable = options.rootdir + 'kernels/lu/contiguous_blocks/LU'
cmd = 'LU -p' + str(options.numcpus)
-class LU_noncontig(LiveProcess):
+class LU_noncontig(Process):
executable = options.rootdir + 'kernels/lu/non_contiguous_blocks/LU'
cmd = 'LU -p' + str(options.numcpus)
-class Radix(LiveProcess):
+class Radix(Process):
executable = options.rootdir + 'kernels/radix/RADIX'
cmd = 'RADIX -n524288 -p' + str(options.numcpus)
-class Barnes(LiveProcess):
+class Barnes(Process):
executable = options.rootdir + 'apps/barnes/BARNES'
cmd = 'BARNES'
input = options.rootdir + 'apps/barnes/input.p' + str(options.numcpus)
-class FMM(LiveProcess):
+class FMM(Process):
executable = options.rootdir + 'apps/fmm/FMM'
cmd = 'FMM'
input = options.rootdir + 'apps/fmm/inputs/input.2048.p' + str(options.numcpus)
-class Ocean_contig(LiveProcess):
+class Ocean_contig(Process):
executable = options.rootdir + 'apps/ocean/contiguous_partitions/OCEAN'
cmd = 'OCEAN -p' + str(options.numcpus)
-class Ocean_noncontig(LiveProcess):
+class Ocean_noncontig(Process):
executable = options.rootdir + 'apps/ocean/non_contiguous_partitions/OCEAN'
cmd = 'OCEAN -p' + str(options.numcpus)
-class Raytrace(LiveProcess):
+class Raytrace(Process):
executable = options.rootdir + 'apps/raytrace/RAYTRACE'
cmd = 'RAYTRACE -p' + str(options.numcpus) + ' ' \
+ options.rootdir + 'apps/raytrace/inputs/teapot.env'
-class Water_nsquared(LiveProcess):
+class Water_nsquared(Process):
executable = options.rootdir + 'apps/water-nsquared/WATER-NSQUARED'
cmd = 'WATER-NSQUARED'
input = options.rootdir + 'apps/water-nsquared/input.p' + str(options.numcpus)
-class Water_spatial(LiveProcess):
+class Water_spatial(Process):
executable = options.rootdir + 'apps/water-spatial/WATER-SPATIAL'
cmd = 'WATER-SPATIAL'
input = options.rootdir + 'apps/water-spatial/input.p' + str(options.numcpus)
# --------------------
# Define Splash2 Benchmarks
# ====================
-class Cholesky(LiveProcess):
+class Cholesky(Process):
cwd = options.rootdir + '/kernels/cholesky'
executable = options.rootdir + '/kernels/cholesky/CHOLESKY'
cmd = ['CHOLESKY', '-p' + str(options.numcpus),
options.rootdir + '/kernels/cholesky/inputs/tk23.O']
-class FFT(LiveProcess):
+class FFT(Process):
cwd = options.rootdir + '/kernels/fft'
executable = options.rootdir + '/kernels/fft/FFT'
cmd = ['FFT', '-p', str(options.numcpus), '-m18']
-class LU_contig(LiveProcess):
+class LU_contig(Process):
executable = options.rootdir + '/kernels/lu/contiguous_blocks/LU'
cmd = ['LU', '-p', str(options.numcpus)]
cwd = options.rootdir + '/kernels/lu/contiguous_blocks'
-class LU_noncontig(LiveProcess):
+class LU_noncontig(Process):
executable = options.rootdir + '/kernels/lu/non_contiguous_blocks/LU'
cmd = ['LU', '-p', str(options.numcpus)]
cwd = options.rootdir + '/kernels/lu/non_contiguous_blocks'
-class Radix(LiveProcess):
+class Radix(Process):
executable = options.rootdir + '/kernels/radix/RADIX'
cmd = ['RADIX', '-n524288', '-p', str(options.numcpus)]
cwd = options.rootdir + '/kernels/radix'
-class Barnes(LiveProcess):
+class Barnes(Process):
executable = options.rootdir + '/apps/barnes/BARNES'
cmd = ['BARNES']
input = options.rootdir + '/apps/barnes/input.p' + str(options.numcpus)
cwd = options.rootdir + '/apps/barnes'
-class FMM(LiveProcess):
+class FMM(Process):
executable = options.rootdir + '/apps/fmm/FMM'
cmd = ['FMM']
if str(options.numcpus) == '1':
input = options.rootdir + '/apps/fmm/inputs/input.2048.p' + str(options.numcpus)
cwd = options.rootdir + '/apps/fmm'
-class Ocean_contig(LiveProcess):
+class Ocean_contig(Process):
executable = options.rootdir + '/apps/ocean/contiguous_partitions/OCEAN'
cmd = ['OCEAN', '-p', str(options.numcpus)]
cwd = options.rootdir + '/apps/ocean/contiguous_partitions'
-class Ocean_noncontig(LiveProcess):
+class Ocean_noncontig(Process):
executable = options.rootdir + '/apps/ocean/non_contiguous_partitions/OCEAN'
cmd = ['OCEAN', '-p', str(options.numcpus)]
cwd = options.rootdir + '/apps/ocean/non_contiguous_partitions'
-class Raytrace(LiveProcess):
+class Raytrace(Process):
executable = options.rootdir + '/apps/raytrace/RAYTRACE'
cmd = ['RAYTRACE', '-p' + str(options.numcpus),
options.rootdir + '/apps/raytrace/inputs/teapot.env']
cwd = options.rootdir + '/apps/raytrace'
-class Water_nsquared(LiveProcess):
+class Water_nsquared(Process):
executable = options.rootdir + '/apps/water-nsquared/WATER-NSQUARED'
cmd = ['WATER-NSQUARED']
if options.numcpus==1:
input = options.rootdir + '/apps/water-nsquared/input.p' + str(options.numcpus)
cwd = options.rootdir + '/apps/water-nsquared'
-class Water_spatial(LiveProcess):
+class Water_spatial(Process):
executable = options.rootdir + '/apps/water-spatial/WATER-SPATIAL'
cmd = ['WATER-SPATIAL']
if options.numcpus==1:
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// borrowed from Tru64, the subcases that get used appear to be
/// different in practice from those used by Tru64 processes.
static SyscallReturn
-osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target osf_setsysinfo() handler.
static SyscallReturn
-osf_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 441 */ SyscallDesc("keyctl", unimplementedFunc)
};
-AlphaLinuxProcess::AlphaLinuxProcess(LiveProcessParams * params,
+AlphaLinuxProcess::AlphaLinuxProcess(ProcessParams * params,
ObjectFile *objFile)
- : AlphaLiveProcess(params, objFile),
+ : AlphaProcess(params, objFile),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
//init_regs->intRegFile[0] = 0;
namespace AlphaISA {
/// A process with emulated Alpha/Linux syscalls.
-class AlphaLinuxProcess : public AlphaLiveProcess
+class AlphaLinuxProcess : public AlphaProcess
{
public:
/// Constructor.
- AlphaLinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ AlphaLinuxProcess(ProcessParams * params, ObjectFile *objFile);
virtual SyscallDesc* getDesc(int callnum);
using namespace AlphaISA;
using namespace std;
-AlphaLiveProcess::AlphaLiveProcess(LiveProcessParams *params,
- ObjectFile *objFile)
- : LiveProcess(params, objFile)
+AlphaProcess::AlphaProcess(ProcessParams *params, ObjectFile *objFile)
+ : Process(params, objFile)
{
brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
brk_point = roundUp(brk_point, PageBytes);
}
void
-AlphaLiveProcess::argsInit(int intSize, int pageSize)
+AlphaProcess::argsInit(int intSize, int pageSize)
{
// Patch the ld_bias for dynamic executables.
updateBias();
}
void
-AlphaLiveProcess::setupASNReg()
+AlphaProcess::setupASNReg()
{
ThreadContext *tc = system->getThreadContext(contextIds[0]);
tc->setMiscRegNoEffect(IPR_DTB_ASN, _pid << 57);
void
-AlphaLiveProcess::loadState(CheckpointIn &cp)
+AlphaProcess::loadState(CheckpointIn &cp)
{
- LiveProcess::loadState(cp);
+ Process::loadState(cp);
// need to set up ASN after unserialization since _pid value may
// come from checkpoint
setupASNReg();
void
-AlphaLiveProcess::initState()
+AlphaProcess::initState()
{
// need to set up ASN before further initialization since init
// will involve writing to virtual memory addresses
setupASNReg();
- LiveProcess::initState();
+ Process::initState();
argsInit(MachineBytes, PageBytes);
}
AlphaISA::IntReg
-AlphaLiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+AlphaProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(FirstArgumentReg + i++);
}
void
-AlphaLiveProcess::setSyscallArg(ThreadContext *tc,
- int i, AlphaISA::IntReg val)
+AlphaProcess::setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val)
{
assert(i < 6);
tc->setIntReg(FirstArgumentReg + i, val);
}
void
-AlphaLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+AlphaProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
// check for error condition. Alpha syscall convention is to
// indicate success/failure in reg a3 (r19) and put the
#include "mem/page_table.hh"
#include "sim/process.hh"
-class AlphaLiveProcess : public LiveProcess
+class AlphaProcess : public Process
{
private:
void setupASNReg();
protected:
- AlphaLiveProcess(LiveProcessParams *params, ObjectFile *objFile);
+ AlphaProcess(ProcessParams *params, ObjectFile *objFile);
void loadState(CheckpointIn &cp) override;
void initState() override;
public:
AlphaISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override;
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, AlphaISA::IntReg val) override;
void setSyscallReturn(ThreadContext *tc,
SyscallReturn return_value) override;
- // override default implementation in LiveProcess as the mmap
+ // override default implementation in Process as the mmap
// region for Alpha platforms grows upward
virtual bool mmapGrowsDown() const override { return false; }
};
using namespace ArmISA;
static SyscallReturn
-issetugidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+issetugidFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
}
static SyscallReturn
-sysctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+sysctlFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 547 */ SyscallDesc("unused#547", unimplementedFunc),
};
-ArmFreebsdProcess32::ArmFreebsdProcess32(LiveProcessParams * params,
+ArmFreebsdProcess32::ArmFreebsdProcess32(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess32(params, objFile, _arch)
+ : ArmProcess32(params, objFile, _arch)
{
SyscallTable table;
syscallTables.push_back(table);
}
-ArmFreebsdProcess64::ArmFreebsdProcess64(LiveProcessParams * params,
+ArmFreebsdProcess64::ArmFreebsdProcess64(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess64(params, objFile, _arch)
+ : ArmProcess64(params, objFile, _arch)
{
SyscallTable table;
void
ArmFreebsdProcess32::initState()
{
- ArmLiveProcess32::initState();
+ ArmProcess32::initState();
// The 32 bit equivalent of the comm page would be set up here.
}
void
ArmFreebsdProcess64::initState()
{
- ArmLiveProcess64::initState();
+ ArmProcess64::initState();
// The 64 bit equivalent of the comm page would be set up here.
}
};
/// A process with emulated Arm/Freebsd syscalls.
-class ArmFreebsdProcess32 : public ArmLiveProcess32, public ArmFreebsdProcessBits
+class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
{
public:
- ArmFreebsdProcess32(LiveProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmFreebsdProcess32(ProcessParams * params, ObjectFile *objFile,
+ ObjectFile::Arch _arch);
void initState();
/// Explicitly import the otherwise hidden getSyscallArg
- using ArmLiveProcess::getSyscallArg;
+ using ArmProcess::getSyscallArg;
/// A page to hold "kernel" provided functions. The name might be wrong.
static const Addr commPage;
};
/// A process with emulated Arm/Freebsd syscalls.
-class ArmFreebsdProcess64 : public ArmLiveProcess64, public ArmFreebsdProcessBits
+class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits
{
public:
- ArmFreebsdProcess64(LiveProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmFreebsdProcess64(ProcessParams * params, ObjectFile *objFile,
+ ObjectFile::Arch _arch);
void initState();
SyscallDesc* getDesc(int callnum);
/// Target uname() handler.
static SyscallReturn
-unameFunc32(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc32(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target uname() handler.
static SyscallReturn
-unameFunc64(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc64(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target set_tls() handler.
static SyscallReturn
-setTLSFunc32(SyscallDesc *desc, int callnum, LiveProcess *process,
+setTLSFunc32(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
}
static SyscallReturn
-setTLSFunc64(SyscallDesc *desc, int callnum, LiveProcess *process,
+setTLSFunc64(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 5 */ SyscallDesc("set_tls", setTLSFunc64)
};
-ArmLinuxProcess32::ArmLinuxProcess32(LiveProcessParams * params,
+ArmLinuxProcess32::ArmLinuxProcess32(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess32(params, objFile, _arch)
+ : ArmProcess32(params, objFile, _arch)
{
SyscallTable table;
syscallTables.push_back(table);
}
-ArmLinuxProcess64::ArmLinuxProcess64(LiveProcessParams * params,
+ArmLinuxProcess64::ArmLinuxProcess64(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess64(params, objFile, _arch)
+ : ArmProcess64(params, objFile, _arch)
{
SyscallTable table;
void
ArmLinuxProcess32::initState()
{
- ArmLiveProcess32::initState();
+ ArmProcess32::initState();
allocateMem(commPage, PageBytes);
ThreadContext *tc = system->getThreadContext(contextIds[0]);
void
ArmLinuxProcess64::initState()
{
- ArmLiveProcess64::initState();
+ ArmProcess64::initState();
// The 64 bit equivalent of the comm page would be set up here.
}
};
/// A process with emulated Arm/Linux syscalls.
-class ArmLinuxProcess32 : public ArmLiveProcess32, public ArmLinuxProcessBits
+class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
{
public:
- ArmLinuxProcess32(LiveProcessParams * params, ObjectFile *objFile,
+ ArmLinuxProcess32(ProcessParams * params, ObjectFile *objFile,
ObjectFile::Arch _arch);
void initState();
/// Explicitly import the otherwise hidden getSyscallArg
- using ArmLiveProcess::getSyscallArg;
+ using ArmProcess::getSyscallArg;
/// A page to hold "kernel" provided functions. The name might be wrong.
static const Addr commPage;
};
/// A process with emulated Arm/Linux syscalls.
-class ArmLinuxProcess64 : public ArmLiveProcess64, public ArmLinuxProcessBits
+class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits
{
public:
- ArmLinuxProcess64(LiveProcessParams * params, ObjectFile *objFile,
+ ArmLinuxProcess64(ProcessParams * params, ObjectFile *objFile,
ObjectFile::Arch _arch);
void initState();
using namespace std;
using namespace ArmISA;
-ArmLiveProcess::ArmLiveProcess(LiveProcessParams *params, ObjectFile *objFile,
- ObjectFile::Arch _arch)
- : LiveProcess(params, objFile), arch(_arch)
+ArmProcess::ArmProcess(ProcessParams *params, ObjectFile *objFile,
+ ObjectFile::Arch _arch)
+ : Process(params, objFile), arch(_arch)
{
}
-ArmLiveProcess32::ArmLiveProcess32(LiveProcessParams *params,
- ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess(params, objFile, _arch)
+ArmProcess32::ArmProcess32(ProcessParams *params, ObjectFile *objFile,
+ ObjectFile::Arch _arch)
+ : ArmProcess(params, objFile, _arch)
{
stack_base = 0xbf000000L;
mmap_end = 0x40000000L;
}
-ArmLiveProcess64::ArmLiveProcess64(LiveProcessParams *params,
- ObjectFile *objFile, ObjectFile::Arch _arch)
- : ArmLiveProcess(params, objFile, _arch)
+ArmProcess64::ArmProcess64(ProcessParams *params, ObjectFile *objFile,
+ ObjectFile::Arch _arch)
+ : ArmProcess(params, objFile, _arch)
{
stack_base = 0x7fffff0000L;
}
void
-ArmLiveProcess32::initState()
+ArmProcess32::initState()
{
- LiveProcess::initState();
+ Process::initState();
argsInit<uint32_t>(PageBytes, INTREG_SP);
for (int i = 0; i < contextIds.size(); i++) {
ThreadContext * tc = system->getThreadContext(contextIds[i]);
}
void
-ArmLiveProcess64::initState()
+ArmProcess64::initState()
{
- LiveProcess::initState();
+ Process::initState();
argsInit<uint64_t>(PageBytes, INTREG_SP0);
for (int i = 0; i < contextIds.size(); i++) {
ThreadContext * tc = system->getThreadContext(contextIds[i]);
template <class IntType>
void
-ArmLiveProcess::argsInit(int pageSize, IntRegIndex spIndex)
+ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
{
int intSize = sizeof(IntType);
}
ArmISA::IntReg
-ArmLiveProcess32::getSyscallArg(ThreadContext *tc, int &i)
+ArmProcess32::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(ArgumentReg0 + i++);
}
ArmISA::IntReg
-ArmLiveProcess64::getSyscallArg(ThreadContext *tc, int &i)
+ArmProcess64::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 8);
return tc->readIntReg(ArgumentReg0 + i++);
}
ArmISA::IntReg
-ArmLiveProcess32::getSyscallArg(ThreadContext *tc, int &i, int width)
+ArmProcess32::getSyscallArg(ThreadContext *tc, int &i, int width)
{
assert(width == 32 || width == 64);
if (width == 32)
}
ArmISA::IntReg
-ArmLiveProcess64::getSyscallArg(ThreadContext *tc, int &i, int width)
+ArmProcess64::getSyscallArg(ThreadContext *tc, int &i, int width)
{
return getSyscallArg(tc, i);
}
void
-ArmLiveProcess32::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
+ArmProcess32::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
{
assert(i < 6);
tc->setIntReg(ArgumentReg0 + i, val);
}
void
-ArmLiveProcess64::setSyscallArg(ThreadContext *tc,
- int i, ArmISA::IntReg val)
+ArmProcess64::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
{
assert(i < 8);
tc->setIntReg(ArgumentReg0 + i, val);
}
void
-ArmLiveProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+ArmProcess32::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
if (objFile->getOpSys() == ObjectFile::FreeBSD) {
}
void
-ArmLiveProcess64::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+ArmProcess64::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
if (objFile->getOpSys() == ObjectFile::FreeBSD) {
#include "mem/page_table.hh"
#include "sim/process.hh"
-class LiveProcess;
class ObjectFile;
-class System;
-class ArmLiveProcess : public LiveProcess
+class ArmProcess : public Process
{
protected:
ObjectFile::Arch arch;
- ArmLiveProcess(LiveProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmProcess(ProcessParams * params, ObjectFile *objFile,
+ ObjectFile::Arch _arch);
template<class IntType>
void argsInit(int pageSize, ArmISA::IntRegIndex spIndex);
};
-class ArmLiveProcess32 : public ArmLiveProcess
+class ArmProcess32 : public ArmProcess
{
protected:
- ArmLiveProcess32(LiveProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmProcess32(ProcessParams * params, ObjectFile *objFile,
+ ObjectFile::Arch _arch);
void initState();
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
-class ArmLiveProcess64 : public ArmLiveProcess
+class ArmProcess64 : public ArmProcess
{
protected:
- ArmLiveProcess64(LiveProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmProcess64(ProcessParams * params, ObjectFile *objFile,
+ ObjectFile::Arch _arch);
void initState();
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// borrowed from Tru64, the subcases that get used appear to be
/// different in practice from those used by Tru64 processes.
static SyscallReturn
-sys_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target sys_setsysinfo() handler.
static SyscallReturn
-sys_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
}
static SyscallReturn
-setThreadAreaFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+setThreadAreaFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 319 */ SyscallDesc("eventfd", unimplementedFunc)
};
-MipsLinuxProcess::MipsLinuxProcess(LiveProcessParams * params,
- ObjectFile *objFile)
- : MipsLiveProcess(params, objFile),
- Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
+MipsLinuxProcess::MipsLinuxProcess(ProcessParams * params,
+ ObjectFile *objFile)
+ : MipsProcess(params, objFile),
+ Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{ }
SyscallDesc*
#include "sim/eventq.hh"
/// A process with emulated Mips/Linux syscalls.
-class MipsLinuxProcess : public MipsLiveProcess
+class MipsLinuxProcess : public MipsProcess
{
public:
/// Constructor.
- MipsLinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ MipsLinuxProcess(ProcessParams * params, ObjectFile *objFile);
virtual SyscallDesc* getDesc(int callnum);
using namespace std;
using namespace MipsISA;
-MipsLiveProcess::MipsLiveProcess(LiveProcessParams * params,
- ObjectFile *objFile)
- : LiveProcess(params, objFile)
+MipsProcess::MipsProcess(ProcessParams * params, ObjectFile *objFile)
+ : Process(params, objFile)
{
// Set up stack. On MIPS, stack starts at the top of kuseg
// user address space. MIPS stack grows down from here
}
void
-MipsLiveProcess::initState()
+MipsProcess::initState()
{
- LiveProcess::initState();
+ Process::initState();
argsInit<uint32_t>(PageBytes);
}
template<class IntType>
void
-MipsLiveProcess::argsInit(int pageSize)
+MipsProcess::argsInit(int pageSize)
{
int intSize = sizeof(IntType);
MipsISA::IntReg
-MipsLiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+MipsProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(FirstArgumentReg + i++);
}
void
-MipsLiveProcess::setSyscallArg(ThreadContext *tc,
- int i, MipsISA::IntReg val)
+MipsProcess::setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val)
{
assert(i < 6);
tc->setIntReg(FirstArgumentReg + i, val);
}
void
-MipsLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
if (sysret.successful()) {
// no error
#include "mem/page_table.hh"
#include "sim/process.hh"
-class LiveProcess;
class ObjectFile;
-class System;
-class MipsLiveProcess : public LiveProcess
+class MipsProcess : public Process
{
protected:
- MipsLiveProcess(LiveProcessParams * params, ObjectFile *objFile);
+ MipsProcess(ProcessParams * params, ObjectFile *objFile);
void initState();
public:
MipsISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val);
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
};
-PowerLinuxProcess::PowerLinuxProcess(LiveProcessParams * params,
+PowerLinuxProcess::PowerLinuxProcess(ProcessParams * params,
ObjectFile *objFile)
- : PowerLiveProcess(params, objFile),
- Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
+ : PowerProcess(params, objFile),
+ Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
}
void
PowerLinuxProcess::initState()
{
- PowerLiveProcess::initState();
+ PowerProcess::initState();
}
PowerISA::IntReg
#include "arch/power/process.hh"
/// A process with emulated PPC/Linux syscalls.
-class PowerLinuxProcess : public PowerLiveProcess
+class PowerLinuxProcess : public PowerProcess
{
public:
- PowerLinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ PowerLinuxProcess(ProcessParams * params, ObjectFile *objFile);
virtual SyscallDesc* getDesc(int callnum);
PowerISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val);
/// Array of syscall descriptors, indexed by call number.
using namespace std;
using namespace PowerISA;
-PowerLiveProcess::PowerLiveProcess(LiveProcessParams *params,
- ObjectFile *objFile)
- : LiveProcess(params, objFile)
+PowerProcess::PowerProcess(ProcessParams *params, ObjectFile *objFile)
+ : Process(params, objFile)
{
stack_base = 0xbf000000L;
}
void
-PowerLiveProcess::initState()
+PowerProcess::initState()
{
Process::initState();
}
void
-PowerLiveProcess::argsInit(int intSize, int pageSize)
+PowerProcess::argsInit(int intSize, int pageSize)
{
typedef AuxVector<uint32_t> auxv_t;
std::vector<auxv_t> auxv;
}
PowerISA::IntReg
-PowerLiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+PowerProcess::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 5);
return tc->readIntReg(ArgumentReg0 + i++);
}
void
-PowerLiveProcess::setSyscallArg(ThreadContext *tc,
- int i, PowerISA::IntReg val)
+PowerProcess::setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val)
{
assert(i < 5);
tc->setIntReg(ArgumentReg0 + i, val);
}
void
-PowerLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+PowerProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
Cr cr = tc->readIntReg(INTREG_CR);
if (sysret.successful()) {
#include "mem/page_table.hh"
#include "sim/process.hh"
-class LiveProcess;
class ObjectFile;
-class System;
-class PowerLiveProcess : public LiveProcess
+class PowerProcess : public Process
{
protected:
- PowerLiveProcess(LiveProcessParams * params, ObjectFile *objFile);
+ PowerProcess(ProcessParams * params, ObjectFile *objFile);
void initState();
void argsInit(int intSize, int pageSize);
PowerISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val);
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
{2011, SyscallDesc("getmainvars", unimplementedFunc)},
};
-RiscvLinuxProcess::RiscvLinuxProcess(LiveProcessParams * params,
- ObjectFile *objFile) : RiscvLiveProcess(params, objFile)
+RiscvLinuxProcess::RiscvLinuxProcess(ProcessParams * params,
+ ObjectFile *objFile) : RiscvProcess(params, objFile)
{}
SyscallDesc*
#include "sim/eventq.hh"
/// A process with emulated Riscv/Linux syscalls.
-class RiscvLinuxProcess : public RiscvLiveProcess
+class RiscvLinuxProcess : public RiscvProcess
{
public:
/// Constructor.
- RiscvLinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ RiscvLinuxProcess(ProcessParams * params, ObjectFile *objFile);
virtual SyscallDesc* getDesc(int callnum);
using namespace std;
using namespace RiscvISA;
-RiscvLiveProcess::RiscvLiveProcess(LiveProcessParams * params,
- ObjectFile *objFile) : LiveProcess(params, objFile)
+RiscvProcess::RiscvProcess(ProcessParams * params,
+ ObjectFile *objFile) : Process(params, objFile)
{
// Set up stack. On RISC-V, stack starts at the top of kuseg
// user address space. RISC-V stack grows down from here
}
void
-RiscvLiveProcess::initState()
+RiscvProcess::initState()
{
- LiveProcess::initState();
+ Process::initState();
argsInit<uint64_t>(PageBytes);
}
template<class IntType> void
-RiscvLiveProcess::argsInit(int pageSize)
+RiscvProcess::argsInit(int pageSize)
{
updateBias();
}
RiscvISA::IntReg
-RiscvLiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+RiscvProcess::getSyscallArg(ThreadContext *tc, int &i)
{
// RISC-V only has four system call argument registers by convention, so
// if a larger index is requested return 0
}
void
-RiscvLiveProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val)
+RiscvProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val)
{
tc->setIntReg(SyscallArgumentRegs[i], val);
}
void
-RiscvLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+RiscvProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
if (sysret.successful()) {
// no error
#include "mem/page_table.hh"
#include "sim/process.hh"
-class LiveProcess;
class ObjectFile;
class System;
-class RiscvLiveProcess : public LiveProcess
+class RiscvProcess : public Process
{
protected:
- RiscvLiveProcess(LiveProcessParams * params, ObjectFile *objFile);
+ RiscvProcess(ProcessParams * params, ObjectFile *objFile);
void initState();
public:
RiscvISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val);
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
Process *p = tc->getProcessPtr();
- //XXX This will only work in faults from a SparcLiveProcess
- SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
- assert(lp);
+ SparcProcess *sp = dynamic_cast<SparcProcess *>(p);
+ assert(sp);
// Then adjust the PC and NPC
- tc->pcState(lp->readSpillStart());
+ tc->pcState(sp->readSpillStart());
}
void
Process *p = tc->getProcessPtr();
- //XXX This will only work in faults from a SparcLiveProcess
- SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
- assert(lp);
+ SparcProcess *sp = dynamic_cast<SparcProcess *>(p);
+ assert(sp);
// Then adjust the PC and NPC
- tc->pcState(lp->readFillStart());
+ tc->pcState(sp->readFillStart());
}
void
Process *p = tc->getProcessPtr();
- SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
- assert(lp);
+ SparcProcess *sp = dynamic_cast<SparcProcess *>(p);
+ assert(sp);
- lp->handleTrap(_n, tc);
+ sp->handleTrap(_n, tc);
// We need to explicitly advance the pc, since that's not done for us
// on a faulting instruction
return &syscall32Descs[callnum];
}
-Sparc32LinuxProcess::Sparc32LinuxProcess(LiveProcessParams * params,
+Sparc32LinuxProcess::Sparc32LinuxProcess(ProcessParams * params,
ObjectFile *objFile)
- : Sparc32LiveProcess(params, objFile)
+ : Sparc32Process(params, objFile)
{}
void Sparc32LinuxProcess::handleTrap(int trapNum, ThreadContext *tc)
tc->syscall(tc->readIntReg(1));
break;
default:
- SparcLiveProcess::handleTrap(trapNum, tc);
+ SparcProcess::handleTrap(trapNum, tc);
}
}
-Sparc64LinuxProcess::Sparc64LinuxProcess(LiveProcessParams * params,
+Sparc64LinuxProcess::Sparc64LinuxProcess(ProcessParams * params,
ObjectFile *objFile)
- : Sparc64LiveProcess(params, objFile)
+ : Sparc64Process(params, objFile)
{}
void Sparc64LinuxProcess::handleTrap(int trapNum, ThreadContext *tc)
tc->syscall(tc->readIntReg(1));
break;
default:
- SparcLiveProcess::handleTrap(trapNum, tc);
+ SparcProcess::handleTrap(trapNum, tc);
}
}
};
/// A process with emulated SPARC/Linux syscalls.
-class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32LiveProcess
+class Sparc32LinuxProcess : public SparcLinuxProcess, public Sparc32Process
{
public:
/// Constructor.
- Sparc32LinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ Sparc32LinuxProcess(ProcessParams * params, ObjectFile *objFile);
SyscallDesc*
getDesc(int callnum)
};
/// A process with emulated 32 bit SPARC/Linux syscalls.
-class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64LiveProcess
+class Sparc64LinuxProcess : public SparcLinuxProcess, public Sparc64Process
{
public:
/// Constructor.
- Sparc64LinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ Sparc64LinuxProcess(ProcessParams * params, ObjectFile *objFile);
SyscallDesc*
getDesc(int callnum)
};
SyscallReturn getresuidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
} // namespace SparcISA
#endif // __SPARC_LINUX_PROCESS_HH__
#include "sim/syscall_desc.hh"
#include "sim/syscall_emul.hh"
-class LiveProcess;
+class Process;
class ThreadContext;
namespace SparcISA {
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
SyscallReturn
-getresuidFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+getresuidFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
const IntReg id = htog(100);
int index = 0;
static const int FirstArgumentReg = 8;
-SparcLiveProcess::SparcLiveProcess(LiveProcessParams * params,
- ObjectFile *objFile, Addr _StackBias)
- : LiveProcess(params, objFile), StackBias(_StackBias)
+SparcProcess::SparcProcess(ProcessParams * params, ObjectFile *objFile,
+ Addr _StackBias)
+ : Process(params, objFile), StackBias(_StackBias)
{
// XXX all the below need to be updated for SPARC - Ali
}
void
-SparcLiveProcess::handleTrap(int trapNum, ThreadContext *tc)
+SparcProcess::handleTrap(int trapNum, ThreadContext *tc)
{
PCState pc = tc->pcState();
switch (trapNum) {
}
void
-SparcLiveProcess::initState()
+SparcProcess::initState()
{
- LiveProcess::initState();
+ Process::initState();
ThreadContext *tc = system->getThreadContext(contextIds[0]);
// From the SPARC ABI
}
void
-Sparc32LiveProcess::initState()
+Sparc32Process::initState()
{
- SparcLiveProcess::initState();
+ SparcProcess::initState();
ThreadContext *tc = system->getThreadContext(contextIds[0]);
// The process runs in user mode with 32 bit addresses
}
void
-Sparc64LiveProcess::initState()
+Sparc64Process::initState()
{
- SparcLiveProcess::initState();
+ SparcProcess::initState();
ThreadContext *tc = system->getThreadContext(contextIds[0]);
// The process runs in user mode
template<class IntType>
void
-SparcLiveProcess::argsInit(int pageSize)
+SparcProcess::argsInit(int pageSize)
{
int intSize = sizeof(IntType);
}
void
-Sparc64LiveProcess::argsInit(int intSize, int pageSize)
+Sparc64Process::argsInit(int intSize, int pageSize)
{
- SparcLiveProcess::argsInit<uint64_t>(pageSize);
+ SparcProcess::argsInit<uint64_t>(pageSize);
// Stuff the trap handlers into the process address space
initVirtMem.writeBlob(fillStart,
}
void
-Sparc32LiveProcess::argsInit(int intSize, int pageSize)
+Sparc32Process::argsInit(int intSize, int pageSize)
{
- SparcLiveProcess::argsInit<uint32_t>(pageSize);
+ SparcProcess::argsInit<uint32_t>(pageSize);
// Stuff the trap handlers into the process address space
initVirtMem.writeBlob(fillStart,
(uint8_t*)spillHandler32, sizeof(MachInst) * numSpillInsts);
}
-void Sparc32LiveProcess::flushWindows(ThreadContext *tc)
+void Sparc32Process::flushWindows(ThreadContext *tc)
{
IntReg Cansave = tc->readIntReg(NumIntArchRegs + 3);
IntReg Canrestore = tc->readIntReg(NumIntArchRegs + 4);
}
void
-Sparc64LiveProcess::flushWindows(ThreadContext *tc)
+Sparc64Process::flushWindows(ThreadContext *tc)
{
IntReg Cansave = tc->readIntReg(NumIntArchRegs + 3);
IntReg Canrestore = tc->readIntReg(NumIntArchRegs + 4);
}
IntReg
-Sparc32LiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+Sparc32Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return bits(tc->readIntReg(FirstArgumentReg + i++), 31, 0);
}
void
-Sparc32LiveProcess::setSyscallArg(ThreadContext *tc, int i, IntReg val)
+Sparc32Process::setSyscallArg(ThreadContext *tc, int i, IntReg val)
{
assert(i < 6);
tc->setIntReg(FirstArgumentReg + i, bits(val, 31, 0));
}
IntReg
-Sparc64LiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+Sparc64Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(FirstArgumentReg + i++);
}
void
-Sparc64LiveProcess::setSyscallArg(ThreadContext *tc, int i, IntReg val)
+Sparc64Process::setSyscallArg(ThreadContext *tc, int i, IntReg val)
{
assert(i < 6);
tc->setIntReg(FirstArgumentReg + i, val);
}
void
-SparcLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
+SparcProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
{
// check for error condition. SPARC syscall convention is to
// indicate success/failure in reg the carry bit of the ccr
#include "sim/process.hh"
class ObjectFile;
-class System;
-class SparcLiveProcess : public LiveProcess
+class SparcProcess : public Process
{
protected:
// The locations of the fill and spill handlers
Addr fillStart, spillStart;
- SparcLiveProcess(LiveProcessParams * params,
- ObjectFile *objFile, Addr _StackBias);
+ SparcProcess(ProcessParams * params, ObjectFile *objFile,
+ Addr _StackBias);
void initState();
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
-class Sparc32LiveProcess : public SparcLiveProcess
+class Sparc32Process : public SparcProcess
{
protected:
- Sparc32LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
- SparcLiveProcess(params, objFile, 0)
+ Sparc32Process(ProcessParams * params, ObjectFile *objFile)
+ : SparcProcess(params, objFile, 0)
{
// Set up stack. On SPARC Linux, stack goes from the top of memory
// downward, less the hole for the kernel address space.
SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val);
};
-class Sparc64LiveProcess : public SparcLiveProcess
+class Sparc64Process : public SparcProcess
{
protected:
- Sparc64LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
- SparcLiveProcess(params, objFile, 2047)
+ Sparc64Process(ProcessParams * params, ObjectFile *objFile)
+ : SparcProcess(params, objFile, 2047)
{
// Set up stack. On SPARC Linux, stack goes from the top of memory
// downward, less the hole for the kernel address space.
SparcISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, SparcISA::IntReg val);
};
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/* 255 */ SyscallDesc("umount2", unimplementedFunc)
};
-SparcSolarisProcess::SparcSolarisProcess(LiveProcessParams * params,
- ObjectFile *objFile)
- : Sparc64LiveProcess(params, objFile),
+SparcSolarisProcess::SparcSolarisProcess(ProcessParams * params,
+ ObjectFile *objFile)
+ : Sparc64Process(params, objFile),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
// The sparc syscall table must be <= 284 entries because that is all there
namespace SparcISA {
/// A process with emulated SPARC/Solaris syscalls.
-class SparcSolarisProcess : public Sparc64LiveProcess
+class SparcSolarisProcess : public Sparc64Process
{
public:
/// Constructor.
- SparcSolarisProcess(LiveProcessParams * params, ObjectFile *objFile);
+ SparcSolarisProcess(ProcessParams * params, ObjectFile *objFile);
virtual SyscallDesc* getDesc(int callnum);
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unameFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
}
static SyscallReturn
-archPrctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+archPrctlFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
enum ArchPrctlCodes
static SyscallReturn
setThreadArea32Func(SyscallDesc *desc, int callnum,
- LiveProcess *process, ThreadContext *tc)
+ Process *process, ThreadContext *tc)
{
const int minTLSEntry = 6;
const int numTLSEntries = 3;
const int maxTLSEntry = minTLSEntry + numTLSEntries - 1;
- X86LiveProcess *x86lp = dynamic_cast<X86LiveProcess *>(process);
- assert(x86lp);
+ X86Process *x86p = dynamic_cast<X86Process *>(process);
+ assert(x86p);
- assert((maxTLSEntry + 1) * sizeof(uint64_t) <= x86lp->gdtSize());
+ assert((maxTLSEntry + 1) * sizeof(uint64_t) <= x86p->gdtSize());
int argIndex = 0;
TypedBufferArg<UserDesc32> userDesc(process->getSyscallArg(tc, argIndex));
TypedBufferArg<uint64_t>
- gdt(x86lp->gdtStart() + minTLSEntry * sizeof(uint64_t),
- numTLSEntries * sizeof(uint64_t));
+ gdt(x86p->gdtStart() + minTLSEntry * sizeof(uint64_t),
+ numTLSEntries * sizeof(uint64_t));
if (!userDesc.copyIn(tc->getMemProxy()))
return -EFAULT;
/* 313 */ SyscallDesc("finit_module", unimplementedFunc),
};
-X86_64LinuxProcess::X86_64LinuxProcess(LiveProcessParams * params,
- ObjectFile *objFile)
- : X86_64LiveProcess(params, objFile, syscallDescs64,
- sizeof(syscallDescs64) / sizeof(SyscallDesc))
+X86_64LinuxProcess::X86_64LinuxProcess(ProcessParams * params,
+ ObjectFile *objFile)
+ : X86_64Process(params, objFile, syscallDescs64,
+ sizeof(syscallDescs64) / sizeof(SyscallDesc))
{}
static SyscallDesc syscallDescs32[] = {
/* 323 */ SyscallDesc("eventfd", unimplementedFunc)
};
-I386LinuxProcess::I386LinuxProcess(LiveProcessParams * params,
- ObjectFile *objFile)
- : I386LiveProcess(params, objFile, syscallDescs32,
- sizeof(syscallDescs32) / sizeof(SyscallDesc))
+I386LinuxProcess::I386LinuxProcess(ProcessParams * params, ObjectFile *objFile)
+ : I386Process(params, objFile, syscallDescs32,
+ sizeof(syscallDescs32) / sizeof(SyscallDesc))
{}
namespace X86ISA {
-class X86_64LinuxProcess : public X86_64LiveProcess
+class X86_64LinuxProcess : public X86_64Process
{
public:
/// Constructor.
- X86_64LinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ X86_64LinuxProcess(ProcessParams * params, ObjectFile *objFile);
};
-class I386LinuxProcess : public I386LiveProcess
+class I386LinuxProcess : public I386Process
{
public:
/// Constructor.
- I386LinuxProcess(LiveProcessParams * params, ObjectFile *objFile);
+ I386LinuxProcess(ProcessParams * params, ObjectFile *objFile);
};
} // namespace X86ISA
static const int NumArgumentRegs32 M5_VAR_USED =
sizeof(ArgumentReg) / sizeof(const int);
-X86LiveProcess::X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile,
- SyscallDesc *_syscallDescs, int _numSyscallDescs) :
- LiveProcess(params, objFile), syscallDescs(_syscallDescs),
- numSyscallDescs(_numSyscallDescs)
+X86Process::X86Process(ProcessParams * params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs)
+ : Process(params, objFile), syscallDescs(_syscallDescs),
+ numSyscallDescs(_numSyscallDescs)
{
brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
brk_point = roundUp(brk_point, PageBytes);
}
-X86_64LiveProcess::X86_64LiveProcess(LiveProcessParams *params,
- ObjectFile *objFile, SyscallDesc *_syscallDescs,
- int _numSyscallDescs) :
- X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs)
+X86_64Process::X86_64Process(ProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs)
+ : X86Process(params, objFile, _syscallDescs, _numSyscallDescs)
{
vsyscallPage.base = 0xffffffffff600000ULL;
}
void
-I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
+I386Process::syscall(int64_t callnum, ThreadContext *tc)
{
TheISA::PCState pc = tc->pcState();
Addr eip = pc.pc();
pc.npc(vsyscallPage.base + vsyscallPage.vsysexitOffset);
tc->pcState(pc);
}
- X86LiveProcess::syscall(callnum, tc);
+ X86Process::syscall(callnum, tc);
}
-I386LiveProcess::I386LiveProcess(LiveProcessParams *params,
- ObjectFile *objFile, SyscallDesc *_syscallDescs,
- int _numSyscallDescs) :
- X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs)
+I386Process::I386Process(ProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs)
+ : X86Process(params, objFile, _syscallDescs, _numSyscallDescs)
{
_gdtStart = ULL(0xffffd000);
_gdtSize = PageBytes;
}
SyscallDesc*
-X86LiveProcess::getDesc(int callnum)
+X86Process::getDesc(int callnum)
{
if (callnum < 0 || callnum >= numSyscallDescs)
return NULL;
}
void
-X86_64LiveProcess::initState()
+X86_64Process::initState()
{
- X86LiveProcess::initState();
+ X86Process::initState();
argsInit(sizeof(uint64_t), PageBytes);
}
void
-I386LiveProcess::initState()
+I386Process::initState()
{
- X86LiveProcess::initState();
+ X86Process::initState();
argsInit(sizeof(uint32_t), PageBytes);
template<class IntType>
void
-X86LiveProcess::argsInit(int pageSize,
+X86Process::argsInit(int pageSize,
std::vector<AuxVector<IntType> > extraAuxvs)
{
int intSize = sizeof(IntType);
}
void
-X86_64LiveProcess::argsInit(int intSize, int pageSize)
+X86_64Process::argsInit(int intSize, int pageSize)
{
std::vector<AuxVector<uint64_t> > extraAuxvs;
extraAuxvs.push_back(AuxVector<uint64_t>(M5_AT_SYSINFO_EHDR,
vsyscallPage.base));
- X86LiveProcess::argsInit<uint64_t>(pageSize, extraAuxvs);
+ X86Process::argsInit<uint64_t>(pageSize, extraAuxvs);
}
void
-I386LiveProcess::argsInit(int intSize, int pageSize)
+I386Process::argsInit(int intSize, int pageSize)
{
std::vector<AuxVector<uint32_t> > extraAuxvs;
//Tell the binary where the vsyscall part of the vsyscall page is.
vsyscallPage.base + vsyscallPage.vsyscallOffset));
extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO_EHDR,
vsyscallPage.base));
- X86LiveProcess::argsInit<uint32_t>(pageSize, extraAuxvs);
+ X86Process::argsInit<uint32_t>(pageSize, extraAuxvs);
}
void
-X86LiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn retval)
+X86Process::setSyscallReturn(ThreadContext *tc, SyscallReturn retval)
{
tc->setIntReg(INTREG_RAX, retval.encodedValue());
}
X86ISA::IntReg
-X86_64LiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+X86_64Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < NumArgumentRegs);
return tc->readIntReg(ArgumentReg[i++]);
}
void
-X86_64LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
+X86_64Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
{
assert(i < NumArgumentRegs);
return tc->setIntReg(ArgumentReg[i], val);
}
X86ISA::IntReg
-I386LiveProcess::getSyscallArg(ThreadContext *tc, int &i)
+I386Process::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < NumArgumentRegs32);
return tc->readIntReg(ArgumentReg32[i++]);
}
X86ISA::IntReg
-I386LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width)
+I386Process::getSyscallArg(ThreadContext *tc, int &i, int width)
{
assert(width == 32 || width == 64);
assert(i < NumArgumentRegs);
}
void
-I386LiveProcess::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
+I386Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
{
assert(i < NumArgumentRegs);
return tc->setIntReg(ArgumentReg[i], val);
M5_AT_SYSINFO_EHDR = 33
};
- class X86LiveProcess : public LiveProcess
+ class X86Process : public Process
{
protected:
Addr _gdtStart;
SyscallDesc *syscallDescs;
const int numSyscallDescs;
- X86LiveProcess(LiveProcessParams * params, ObjectFile *objFile,
- SyscallDesc *_syscallDescs, int _numSyscallDescs);
+ X86Process(ProcessParams * params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
template<class IntType>
void argsInit(int pageSize,
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};
- class X86_64LiveProcess : public X86LiveProcess
+ class X86_64Process : public X86Process
{
protected:
- X86_64LiveProcess(LiveProcessParams *params, ObjectFile *objFile,
- SyscallDesc *_syscallDescs, int _numSyscallDescs);
+ X86_64Process(ProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
class VSyscallPage
{
X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
/// Explicitly import the otherwise hidden getSyscallArg
- using LiveProcess::getSyscallArg;
+ using Process::getSyscallArg;
void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
};
- class I386LiveProcess : public X86LiveProcess
+ class I386Process : public X86Process
{
protected:
- I386LiveProcess(LiveProcessParams *params, ObjectFile *objFile,
- SyscallDesc *_syscallDescs, int _numSyscallDescs);
+ I386Process(ProcessParams *params, ObjectFile *objFile,
+ SyscallDesc *_syscallDescs, int _numSyscallDescs);
class VSyscallPage
{
}
int
-ClDriver::open(LiveProcess *p, ThreadContext *tc, int mode, int flags)
+ClDriver::open(Process *p, ThreadContext *tc, int mode, int flags)
{
int fd = p->allocFD(-1, filename, 0, 0, false);
FDEntry *fde = p->getFDEntry(fd);
}
int
-ClDriver::ioctl(LiveProcess *process, ThreadContext *tc, unsigned req)
+ClDriver::ioctl(Process *process, ThreadContext *tc, unsigned req)
{
int index = 2;
Addr buf_addr = process->getSyscallArg(tc, index);
class GpuDispatcher;
class HsaCode;
-class LiveProcess;
+class Process;
class ThreadContext;
struct ClDriverParams;
public:
ClDriver(ClDriverParams *p);
void handshake(GpuDispatcher *_dispatcher);
- int open(LiveProcess *p, ThreadContext *tc, int mode, int flags);
- int ioctl(LiveProcess *p, ThreadContext *tc, unsigned req);
+ int open(Process *p, ThreadContext *tc, int mode, int flags);
+ int ioctl(Process *p, ThreadContext *tc, unsigned req);
const char* codeOffToKernelName(uint64_t code_ptr);
private:
#include "kern/operatingsystem.hh"
class ThreadContext;
-class LiveProcess;
+class Process;
///
/// This class encapsulates the types, structures, constants,
#include "sim/system.hh"
int
-Linux::openSpecialFile(std::string path, LiveProcess *process,
+Linux::openSpecialFile(std::string path, Process *process,
ThreadContext *tc)
{
DPRINTF(SyscallVerbose, "Opening special file: %s\n", path.c_str());
}
std::string
-Linux::procMeminfo(LiveProcess *process, ThreadContext *tc)
+Linux::procMeminfo(Process *process, ThreadContext *tc)
{
return csprintf("MemTotal:%12d kB\nMemFree: %12d kB\n",
process->system->memSize() >> 10,
int64_t ru_nivcsw; //!< involuntary "
};
- static int openSpecialFile(std::string path, LiveProcess *process, ThreadContext *tc);
- static std::string procMeminfo(LiveProcess *process, ThreadContext *tc);
+ static int openSpecialFile(std::string path, Process *process,
+ ThreadContext *tc);
+ static std::string procMeminfo(Process *process, ThreadContext *tc);
// For futex system call
static const unsigned TGT_FUTEX_WAIT = 0;
#include "base/misc.hh"
int
-OperatingSystem::openSpecialFile(std::string path, LiveProcess *process,
+OperatingSystem::openSpecialFile(std::string path, Process *process,
ThreadContext *tc)
{
warn("Attempting to open special file: %s. Ignoring. Simulation may"
#include <string>
-class LiveProcess;
+class Process;
class ThreadContext;
/// This struct is used to build target-OS-dependent tables that
int64_t ru_nivcsw; //!< involuntary "
} rusage;
- static int openSpecialFile(std::string path, LiveProcess *process, ThreadContext *tc);
+ static int openSpecialFile(std::string path, Process *process,
+ ThreadContext *tc);
}; // class OperatingSystem
class Process(SimObject):
type = 'Process'
- abstract = True
cxx_header = "sim/process.hh"
input = Param.String('cin', "filename for stdin")
output = Param.String('cout', 'filename for stdout')
pid = Param.Int(100, 'process id')
ppid = Param.Int(99, 'parent process id')
+ executable = Param.String('', "executable (overrides cmd[0] if set)")
+ cmd = VectorParam.String("command line (executable plus arguments)")
+ env = VectorParam.String([], "environment settings")
+ cwd = Param.String('', "current working directory")
+ simpoint = Param.UInt64(0, 'simulation point at which to start simulation')
+ drivers = VectorParam.EmulatedDriver([], 'Available emulated drivers')
+
@classmethod
def export_methods(cls, code):
- code('bool map(Addr vaddr, Addr paddr, int size, bool cacheable=true);')
+ code('bool map(Addr vaddr, Addr paddr, int sz, bool cacheable=true);')
class EmulatedDriver(SimObject):
type = 'EmulatedDriver'
cxx_header = "sim/emul_driver.hh"
abstract = True
filename = Param.String("device file name (under /dev)")
-
-class LiveProcess(Process):
- type = 'LiveProcess'
- cxx_header = "sim/process.hh"
- executable = Param.String('', "executable (overrides cmd[0] if set)")
- cmd = VectorParam.String("command line (executable plus arguments)")
- env = VectorParam.String([], "environment settings")
- cwd = Param.String('', "current working directory")
- simpoint = Param.UInt64(0, 'simulation point at which to start simulation')
- drivers = VectorParam.EmulatedDriver([], 'Available emulated drivers')
-
#include "params/EmulatedDriver.hh"
#include "sim/sim_object.hh"
-class LiveProcess;
+class Process;
class ThreadContext;
/**
* to openFunc() (q.v.).
* @return A newly allocated target fd, or -1 on error.
*/
- virtual int open(LiveProcess *p, ThreadContext *tc,
+ virtual int open(Process *p, ThreadContext *tc,
int mode, int flags) = 0;
/**
* @return The return code for the ioctl, or the negation of the errno
* (see the SyscallReturn class).
*/
- virtual int ioctl(LiveProcess *p, ThreadContext *tc, unsigned req) = 0;
+ virtual int ioctl(Process *p, ThreadContext *tc, unsigned req) = 0;
/**
* Virtual method, invoked when the user program calls mmap() on
* @return The return ptr for the mmap, or the negation of the errno
* (see the SyscallReturn class).
*/
- virtual Addr mmap(LiveProcess *p, ThreadContext *tc, Addr start,
+ virtual Addr mmap(Process *p, ThreadContext *tc, Addr start,
uint64_t length, int prot, int tgtFlags, int tgtFd,
int offset) { return -EBADF; }
};
#include "cpu/thread_context.hh"
#include "mem/page_table.hh"
#include "mem/se_translating_port_proxy.hh"
-#include "params/LiveProcess.hh"
#include "params/Process.hh"
#include "sim/emul_driver.hh"
#include "sim/syscall_desc.hh"
return openFile(filename, O_WRONLY | O_CREAT | O_TRUNC, 0664);
}
-Process::Process(ProcessParams * params)
+Process::Process(ProcessParams * params, ObjectFile * obj_file)
: SimObject(params), system(params->system),
brk_point(0), stack_base(0), stack_size(0), stack_min(0),
max_stack_size(params->max_stack_size),
{"stdout", STDOUT_FILENO},
{"cerr", STDERR_FILENO},
{"stderr", STDERR_FILENO}},
+ objFile(obj_file),
+ argv(params->cmd), envp(params->env), cwd(params->cwd),
+ executable(params->executable),
_uid(params->uid), _euid(params->euid),
_gid(params->gid), _egid(params->egid),
- _pid(params->pid), _ppid(params->ppid)
+ _pid(params->pid), _ppid(params->ppid),
+ drivers(params->drivers)
{
int sim_fd;
std::map<string,int>::iterator it;
mmap_end = 0;
nxm_start = nxm_end = 0;
// other parameters will be initialized when the program is loaded
+
+ // load up symbols, if any... these may be used for debugging or
+ // profiling.
+ if (!debugSymbolTable) {
+ debugSymbolTable = new SymbolTable();
+ if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
+ !objFile->loadLocalSymbols(debugSymbolTable) ||
+ !objFile->loadWeakSymbols(debugSymbolTable)) {
+ // didn't load any symbols
+ delete debugSymbolTable;
+ debugSymbolTable = NULL;
+ }
+ }
}
}
-////////////////////////////////////////////////////////////////////////
-//
-// LiveProcess member definitions
-//
-////////////////////////////////////////////////////////////////////////
-
-
-LiveProcess::LiveProcess(LiveProcessParams *params, ObjectFile *_objFile)
- : Process(params), objFile(_objFile),
- argv(params->cmd), envp(params->env), cwd(params->cwd),
- executable(params->executable),
- drivers(params->drivers)
-{
-
- // load up symbols, if any... these may be used for debugging or
- // profiling.
- if (!debugSymbolTable) {
- debugSymbolTable = new SymbolTable();
- if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
- !objFile->loadLocalSymbols(debugSymbolTable) ||
- !objFile->loadWeakSymbols(debugSymbolTable)) {
- // didn't load any symbols
- delete debugSymbolTable;
- debugSymbolTable = NULL;
- }
- }
-}
-
void
-LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
+Process::syscall(int64_t callnum, ThreadContext *tc)
{
num_syscalls++;
}
IntReg
-LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width)
+Process::getSyscallArg(ThreadContext *tc, int &i, int width)
{
return getSyscallArg(tc, i);
}
EmulatedDriver *
-LiveProcess::findDriver(std::string filename)
+Process::findDriver(std::string filename)
{
for (EmulatedDriver *d : drivers) {
if (d->match(filename))
}
void
-LiveProcess::updateBias()
+Process::updateBias()
{
ObjectFile *interp = objFile->getInterpreter();
ObjectFile *
-LiveProcess::getInterpreter()
+Process::getInterpreter()
{
return objFile->getInterpreter();
}
Addr
-LiveProcess::getBias()
+Process::getBias()
{
ObjectFile *interp = getInterpreter();
Addr
-LiveProcess::getStartPC()
+Process::getStartPC()
{
ObjectFile *interp = getInterpreter();
}
-LiveProcess *
-LiveProcess::create(LiveProcessParams * params)
+Process *
+ProcessParams::create()
{
- LiveProcess *process = NULL;
+ Process *process = NULL;
// If not specified, set the executable parameter equal to the
// simulated system's zeroth command line parameter
- if (params->executable == "") {
- params->executable = params->cmd[0];
+ if (executable == "") {
+ executable = cmd[0];
}
- ObjectFile *objFile = createObjectFile(params->executable);
- if (objFile == NULL) {
- fatal("Can't load object file %s", params->executable);
+ ObjectFile *obj_file = createObjectFile(executable);
+ if (obj_file == NULL) {
+ fatal("Can't load object file %s", executable);
}
#if THE_ISA == ALPHA_ISA
- if (objFile->getArch() != ObjectFile::Alpha)
+ if (obj_file->getArch() != ObjectFile::Alpha)
fatal("Object file architecture does not match compiled ISA (Alpha).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- process = new AlphaLinuxProcess(params, objFile);
+ process = new AlphaLinuxProcess(this, obj_file);
break;
default:
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == SPARC_ISA
- if (objFile->getArch() != ObjectFile::SPARC64 &&
- objFile->getArch() != ObjectFile::SPARC32)
+ if (obj_file->getArch() != ObjectFile::SPARC64 &&
+ obj_file->getArch() != ObjectFile::SPARC32)
fatal("Object file architecture does not match compiled ISA (SPARC).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- if (objFile->getArch() == ObjectFile::SPARC64) {
- process = new Sparc64LinuxProcess(params, objFile);
+ if (obj_file->getArch() == ObjectFile::SPARC64) {
+ process = new Sparc64LinuxProcess(this, obj_file);
} else {
- process = new Sparc32LinuxProcess(params, objFile);
+ process = new Sparc32LinuxProcess(this, obj_file);
}
break;
case ObjectFile::Solaris:
- process = new SparcSolarisProcess(params, objFile);
+ process = new SparcSolarisProcess(this, obj_file);
break;
default:
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == X86_ISA
- if (objFile->getArch() != ObjectFile::X86_64 &&
- objFile->getArch() != ObjectFile::I386)
+ if (obj_file->getArch() != ObjectFile::X86_64 &&
+ obj_file->getArch() != ObjectFile::I386)
fatal("Object file architecture does not match compiled ISA (x86).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- if (objFile->getArch() == ObjectFile::X86_64) {
- process = new X86_64LinuxProcess(params, objFile);
+ if (obj_file->getArch() == ObjectFile::X86_64) {
+ process = new X86_64LinuxProcess(this, obj_file);
} else {
- process = new I386LinuxProcess(params, objFile);
+ process = new I386LinuxProcess(this, obj_file);
}
break;
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == MIPS_ISA
- if (objFile->getArch() != ObjectFile::Mips)
+ if (obj_file->getArch() != ObjectFile::Mips)
fatal("Object file architecture does not match compiled ISA (MIPS).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- process = new MipsLinuxProcess(params, objFile);
+ process = new MipsLinuxProcess(this, obj_file);
break;
default:
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == ARM_ISA
- ObjectFile::Arch arch = objFile->getArch();
+ ObjectFile::Arch arch = obj_file->getArch();
if (arch != ObjectFile::Arm && arch != ObjectFile::Thumb &&
arch != ObjectFile::Arm64)
fatal("Object file architecture does not match compiled ISA (ARM).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
if (arch == ObjectFile::Arm64) {
- process = new ArmLinuxProcess64(params, objFile,
- objFile->getArch());
+ process = new ArmLinuxProcess64(this, obj_file,
+ obj_file->getArch());
} else {
- process = new ArmLinuxProcess32(params, objFile,
- objFile->getArch());
+ process = new ArmLinuxProcess32(this, obj_file,
+ obj_file->getArch());
}
break;
case ObjectFile::FreeBSD:
if (arch == ObjectFile::Arm64) {
- process = new ArmFreebsdProcess64(params, objFile,
- objFile->getArch());
+ process = new ArmFreebsdProcess64(this, obj_file,
+ obj_file->getArch());
} else {
- process = new ArmFreebsdProcess32(params, objFile,
- objFile->getArch());
+ process = new ArmFreebsdProcess32(this, obj_file,
+ obj_file->getArch());
}
break;
case ObjectFile::LinuxArmOABI:
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == POWER_ISA
- if (objFile->getArch() != ObjectFile::Power)
+ if (obj_file->getArch() != ObjectFile::Power)
fatal("Object file architecture does not match compiled ISA (Power).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- process = new PowerLinuxProcess(params, objFile);
+ process = new PowerLinuxProcess(this, obj_file);
break;
default:
fatal("Unknown/unsupported operating system.");
}
#elif THE_ISA == RISCV_ISA
- if (objFile->getArch() != ObjectFile::Riscv)
+ if (obj_file->getArch() != ObjectFile::Riscv)
fatal("Object file architecture does not match compiled ISA (RISCV).");
- switch (objFile->getOpSys()) {
+ switch (obj_file->getOpSys()) {
case ObjectFile::UnknownOpSys:
warn("Unknown operating system; assuming Linux.");
// fall through
case ObjectFile::Linux:
- process = new RiscvLinuxProcess(params, objFile);
+ process = new RiscvLinuxProcess(this, obj_file);
break;
default:
fatal("Unknown/unsupported operating system.");
fatal("Unknown error creating process object.");
return process;
}
-
-LiveProcess *
-LiveProcessParams::create()
-{
- return LiveProcess::create(this);
-}
#include "sim/fd_entry.hh"
#include "sim/sim_object.hh"
-struct LiveProcessParams;
struct ProcessParams;
class EmulatedDriver;
+class ObjectFile;
class PageTableBase;
class SyscallDesc;
class SyscallReturn;
// Find a free context to use
ThreadContext *findFreeContext();
- // provide program name for debug messages
- virtual const char *progName() const { return "<unknown>"; }
-
// generate new target fd for sim_fd
int allocFD(int sim_fd, const std::string& filename, int flags, int mode,
bool pipe);
// set the source of this read pipe for a checkpoint resume
void setReadPipeSource(int read_pipe_fd, int source_fd);
- virtual void syscall(int64_t callnum, ThreadContext *tc) = 0;
void allocateMem(Addr vaddr, int64_t size, bool clobber = false);
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
+ protected:
+ ObjectFile *objFile;
+ std::vector<std::string> argv;
+ std::vector<std::string> envp;
+ std::string cwd;
+ std::string executable;
+
+ Process(ProcessParams *params, ObjectFile *obj_file);
+
public:
// Id of the owner of the process
uint64_t _uid;
uint64_t _pid;
uint64_t _ppid;
-};
-
-//
-// "Live" process with system calls redirected to host system
-//
-class ObjectFile;
-class LiveProcess : public Process
-{
- protected:
- ObjectFile *objFile;
- std::vector<std::string> argv;
- std::vector<std::string> envp;
- std::string cwd;
- std::string executable;
-
- LiveProcess(LiveProcessParams *params, ObjectFile *objFile);
-
// Emulated drivers available to this process
std::vector<EmulatedDriver *> drivers;
- public:
-
enum AuxiliaryVectorType {
M5_AT_NULL = 0,
M5_AT_IGNORE = 1,
inline uint64_t ppid() { return _ppid; }
// provide program name for debug messages
- virtual const char *progName() const { return executable.c_str(); }
+ const char *progName() const { return executable.c_str(); }
std::string
fullPath(const std::string &filename)
std::string getcwd() const { return cwd; }
- virtual void syscall(int64_t callnum, ThreadContext *tc);
+ void syscall(int64_t callnum, ThreadContext *tc);
virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i) = 0;
virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width);
Addr getBias();
Addr getStartPC();
-
- // this function is used to create the LiveProcess object, since
- // we can't tell which subclass of LiveProcess to use until we
- // open and look at the object file.
- static LiveProcess *create(LiveProcessParams *params);
};
-
#endif // __PROCESS_HH__
#include "sim/syscall_return.hh"
void
-SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc)
+SyscallDesc::doSyscall(int callnum, Process *process, ThreadContext *tc)
{
TheISA::IntReg arg[6] M5_VAR_USED;
#include <string>
-class LiveProcess;
+class Process;
class SyscallReturn;
class ThreadContext;
public:
/** Typedef the function pointer here to clean up code below */
typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num,
- LiveProcess*, ThreadContext*);
+ Process*, ThreadContext*);
SyscallDesc(const char *name, SyscallExecutor sys_exec, int flags = 0)
: _name(name), executor(sys_exec), _flags(flags), _warned(false)
* @param proc Handle for the owning Process to pass information
* @param tc Handle for owning ThreadContext to pass information
*/
- void doSyscall(int callnum, LiveProcess *proc, ThreadContext *tc);
+ void doSyscall(int callnum, Process *proc, ThreadContext *tc);
/**
* Return false if WarnOnce is set and a warning has already been issued.
using namespace TheISA;
SyscallReturn
-unimplementedFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unimplementedFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
fatal("syscall %s (#%d) unimplemented.", desc->name(), callnum);
SyscallReturn
-ignoreFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+ignoreFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
if (desc->needWarning()) {
SyscallReturn
-exitFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+exitFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
if (process->system->numRunningContexts() == 1) {
SyscallReturn
-exitGroupFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+exitGroupFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
// halt all threads belonging to this process
SyscallReturn
-getpagesizeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+getpagesizeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
return (int)PageBytes;
}
SyscallReturn
-brkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+brkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
// change brk addr to first arg
int index = 0;
SyscallReturn
-closeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+closeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
SyscallReturn
-readFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
}
SyscallReturn
-writeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+writeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
SyscallReturn
-lseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+lseekFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
SyscallReturn
-_llseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+_llseekFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
SyscallReturn
-munmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+munmapFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
// With mmap more fully implemented, it might be worthwhile to bite
// the bullet and implement munmap. Should allow us to reuse simulated
const char *hostname = "m5.eecs.umich.edu";
SyscallReturn
-gethostnameFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+gethostnameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
Addr bufPtr = p->getSyscallArg(tc, index);
}
SyscallReturn
-getcwdFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+getcwdFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int result = 0;
int index = 0;
/// Target open() handler.
SyscallReturn
-readlinkFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+readlinkFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
return readlinkFunc(desc, callnum, process, tc, 0);
}
SyscallReturn
-readlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc,
- int index)
+readlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc,
+ int index)
{
string path;
} else {
// Emulate readlink() called on '/proc/self/exe' should return the
// absolute path of the binary running in the simulated system (the
- // LiveProcess' executable). It is possible that using this path in
+ // Process' executable). It is possible that using this path in
// the simulated system will result in unexpected behavior if:
// 1) One binary runs another (e.g., -c time -o "my_binary"), and
// called binary calls readlink().
}
SyscallReturn
-unlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+unlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
return unlinkHelper(desc, num, p, tc, 0);
}
SyscallReturn
-unlinkHelper(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc,
- int index)
+unlinkHelper(SyscallDesc *desc, int num, Process *p, ThreadContext *tc,
+ int index)
{
string path;
SyscallReturn
-mkdirFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
string path;
}
SyscallReturn
-renameFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+renameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
string old_name;
}
SyscallReturn
-truncateFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+truncateFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
string path;
SyscallReturn
ftruncateFunc(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc)
+ Process *process, ThreadContext *tc)
{
int index = 0;
int tgt_fd = process->getSyscallArg(tc, index);
SyscallReturn
truncate64Func(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc)
+ Process *process, ThreadContext *tc)
{
int index = 0;
string path;
SyscallReturn
ftruncate64Func(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc)
+ Process *process, ThreadContext *tc)
{
int index = 0;
int tgt_fd = process->getSyscallArg(tc, index);
}
SyscallReturn
-umaskFunc(SyscallDesc *desc, int num, LiveProcess *process, ThreadContext *tc)
+umaskFunc(SyscallDesc *desc, int num, Process *process, ThreadContext *tc)
{
// Letting the simulated program change the simulator's umask seems like
// a bad idea. Compromise by just returning the current umask but not
}
SyscallReturn
-chownFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+chownFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
string path;
}
SyscallReturn
-fchownFunc(SyscallDesc *desc, int num, LiveProcess *process, ThreadContext *tc)
+fchownFunc(SyscallDesc *desc, int num, Process *process, ThreadContext *tc)
{
int index = 0;
int tgt_fd = process->getSyscallArg(tc, index);
SyscallReturn
-dupFunc(SyscallDesc *desc, int num, LiveProcess *process, ThreadContext *tc)
+dupFunc(SyscallDesc *desc, int num, Process *process, ThreadContext *tc)
{
int index = 0;
int tgt_fd = process->getSyscallArg(tc, index);
SyscallReturn
-fcntlFunc(SyscallDesc *desc, int num, LiveProcess *process,
+fcntlFunc(SyscallDesc *desc, int num, Process *process,
ThreadContext *tc)
{
int index = 0;
}
SyscallReturn
-fcntl64Func(SyscallDesc *desc, int num, LiveProcess *process,
+fcntl64Func(SyscallDesc *desc, int num, Process *process,
ThreadContext *tc)
{
int index = 0;
}
SyscallReturn
-pipePseudoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+pipePseudoFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int fds[2], sim_fds[2];
int pipe_retval = pipe(fds);
SyscallReturn
-getpidPseudoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
// Make up a PID. There's no interprocess communication in
// fake_syscall mode, so there's no way for a process to know it's
SyscallReturn
-getuidPseudoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
// Make up a UID and EUID... it shouldn't matter, and we want the
// simulation to be deterministic.
SyscallReturn
-getgidPseudoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
// Get current group ID. EGID goes in r20.
tc->setIntReg(SyscallPseudoReturnReg, process->egid()); //EGID
SyscallReturn
-setuidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+setuidFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
// can't fathom why a benchmark would call this.
}
SyscallReturn
-getpidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+getpidFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
// Make up a PID. There's no interprocess communication in
}
SyscallReturn
-getppidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getppidFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
return process->ppid();
}
SyscallReturn
-getuidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+getuidFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
return process->uid(); // UID
}
SyscallReturn
-geteuidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+geteuidFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
return process->euid(); // UID
}
SyscallReturn
-getgidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+getgidFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
return process->gid();
}
SyscallReturn
-getegidFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getegidFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
return process->egid();
}
SyscallReturn
-cloneFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+cloneFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
IntReg flags = process->getSyscallArg(tc, index);
}
SyscallReturn
-fallocateFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+fallocateFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
#if NO_FALLOCATE
}
SyscallReturn
-accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
- int index)
+accessFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc,
+ int index)
{
string path;
if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))
}
SyscallReturn
-accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc)
+accessFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
{
return accessFunc(desc, callnum, p, tc, 0);
}
/// Handler for unimplemented syscalls that we haven't thought about.
SyscallReturn unimplementedFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Handler for unimplemented syscalls that we never intend to
/// implement (signal handling, etc.) and should not affect the correct
/// behavior of the program. Print a warning only if the appropriate
/// trace flag is enabled. Return success to the target program.
SyscallReturn ignoreFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
// Target fallocateFunc() handler.
SyscallReturn fallocateFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target exit() handler: terminate current context.
SyscallReturn exitFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target exit_group() handler: terminate simulation. (exit all threads)
SyscallReturn exitGroupFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getpagesize() handler.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target brk() handler: set brk address.
SyscallReturn brkFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target close() handler.
SyscallReturn closeFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target read() handler.
SyscallReturn readFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target write() handler.
SyscallReturn writeFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target lseek() handler.
SyscallReturn lseekFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target _llseek() handler.
SyscallReturn _llseekFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target munmap() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target gethostname() handler.
SyscallReturn gethostnameFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getcwd() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target readlink() handler.
SyscallReturn readlinkFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc,
+ Process *p, ThreadContext *tc,
int index = 0);
SyscallReturn readlinkFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target unlink() handler.
SyscallReturn unlinkHelper(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc,
+ Process *p, ThreadContext *tc,
int index);
SyscallReturn unlinkFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target mkdir() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target rename() handler.
SyscallReturn renameFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target truncate() handler.
SyscallReturn truncateFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target ftruncate() handler.
SyscallReturn ftruncateFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target truncate64() handler.
SyscallReturn truncate64Func(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target ftruncate64() handler.
SyscallReturn ftruncate64Func(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target umask() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target chown() handler.
SyscallReturn chownFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target fchown() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target dup() handler.
SyscallReturn dupFunc(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc);
+ Process *process, ThreadContext *tc);
/// Target fnctl() handler.
SyscallReturn fcntlFunc(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc);
+ Process *process, ThreadContext *tc);
/// Target fcntl64() handler.
SyscallReturn fcntl64Func(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc);
+ Process *process, ThreadContext *tc);
/// Target setuid() handler.
SyscallReturn setuidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getpid() handler.
SyscallReturn getpidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getuid() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getgid() handler.
SyscallReturn getgidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getppid() handler.
SyscallReturn getppidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target geteuid() handler.
SyscallReturn geteuidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getegid() handler.
SyscallReturn getegidFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target clone() handler.
SyscallReturn cloneFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target access() handler
SyscallReturn accessFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
SyscallReturn accessFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc,
- int index);
+ Process *p, ThreadContext *tc,
+ int index);
/// Futex system call
/// Implemented by Daniel Sanchez
/// Used by printf's in multi-threaded apps
template <class OS>
SyscallReturn
-futexFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+futexFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index_uaddr = 0;
/// Pseudo Funcs - These functions use a different return convension,
/// returning a second value in a register other than the normal return register
SyscallReturn pipePseudoFunc(SyscallDesc *desc, int num,
- LiveProcess *process, ThreadContext *tc);
+ Process *process, ThreadContext *tc);
/// Target getpidPseudo() handler.
SyscallReturn getpidPseudoFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getuidPseudo() handler.
SyscallReturn getuidPseudoFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// Target getgidPseudo() handler.
SyscallReturn getgidPseudoFunc(SyscallDesc *desc, int num,
- LiveProcess *p, ThreadContext *tc);
+ Process *p, ThreadContext *tc);
/// A readable name for 1,000,000, for converting microseconds to seconds.
/// not TTYs to provide repeatable results.
template <class OS>
SyscallReturn
-ioctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+ioctlFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
template <class OS>
static SyscallReturn
-openFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+openFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc, int index)
{
std::string path;
/// Target open() handler.
template <class OS>
SyscallReturn
-openFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+openFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
return openFunc<OS>(desc, callnum, process, tc, 0);
/// Target openat() handler.
template <class OS>
SyscallReturn
-openatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+openatFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
int dirfd = process->getSyscallArg(tc, index);
/// Target unlinkat() handler.
template <class OS>
SyscallReturn
-unlinkatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+unlinkatFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target facessat() handler
template <class OS>
SyscallReturn
-faccessatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+faccessatFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
int dirfd = process->getSyscallArg(tc, index);
/// Target readlinkat() handler
template <class OS>
SyscallReturn
-readlinkatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+readlinkatFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
int dirfd = process->getSyscallArg(tc, index);
/// Target renameat() handler.
template <class OS>
SyscallReturn
-renameatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+renameatFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target sysinfo() handler.
template <class OS>
SyscallReturn
-sysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+sysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
/// Target chmod() handler.
template <class OS>
SyscallReturn
-chmodFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+chmodFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target fchmod() handler.
template <class OS>
SyscallReturn
-fchmodFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+fchmodFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target mremap() handler.
template <class OS>
SyscallReturn
-mremapFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc)
+mremapFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
{
int index = 0;
Addr start = process->getSyscallArg(tc, index);
/// Target stat() handler.
template <class OS>
SyscallReturn
-statFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+statFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target stat64() handler.
template <class OS>
SyscallReturn
-stat64Func(SyscallDesc *desc, int callnum, LiveProcess *process,
+stat64Func(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target fstatat64() handler.
template <class OS>
SyscallReturn
-fstatat64Func(SyscallDesc *desc, int callnum, LiveProcess *process,
+fstatat64Func(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target fstat64() handler.
template <class OS>
SyscallReturn
-fstat64Func(SyscallDesc *desc, int callnum, LiveProcess *process,
+fstat64Func(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target lstat() handler.
template <class OS>
SyscallReturn
-lstatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+lstatFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target lstat64() handler.
template <class OS>
SyscallReturn
-lstat64Func(SyscallDesc *desc, int callnum, LiveProcess *process,
+lstat64Func(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target fstat() handler.
template <class OS>
SyscallReturn
-fstatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+fstatFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target statfs() handler.
template <class OS>
SyscallReturn
-statfsFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+statfsFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
#if NO_STATFS
/// Target fstatfs() handler.
template <class OS>
SyscallReturn
-fstatfsFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+fstatfsFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target writev() handler.
template <class OS>
SyscallReturn
-writevFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+writevFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Real mmap handler.
template <class OS>
SyscallReturn
-mmapImpl(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc,
+mmapImpl(SyscallDesc *desc, int num, Process *p, ThreadContext *tc,
bool is_mmap2)
{
int index = 0;
template <class OS>
SyscallReturn
-pwrite64Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+pwrite64Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
/// Target mmap() handler.
template <class OS>
SyscallReturn
-mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+mmapFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
return mmapImpl<OS>(desc, num, p, tc, false);
}
/// Target mmap2() handler.
template <class OS>
SyscallReturn
-mmap2Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+mmap2Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
return mmapImpl<OS>(desc, num, p, tc, true);
}
/// Target getrlimit() handler.
template <class OS>
SyscallReturn
-getrlimitFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+getrlimitFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
unsigned resource = process->getSyscallArg(tc, index);
/// Target clock_gettime() function.
template <class OS>
SyscallReturn
-clock_gettimeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+clock_gettimeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 1;
//int clk_id = p->getSyscallArg(tc, index);
/// Target clock_getres() function.
template <class OS>
SyscallReturn
-clock_getresFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+clock_getresFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 1;
TypedBufferArg<typename OS::timespec> tp(p->getSyscallArg(tc, index));
/// Target gettimeofday() handler.
template <class OS>
SyscallReturn
-gettimeofdayFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+gettimeofdayFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
TypedBufferArg<typename OS::timeval> tp(process->getSyscallArg(tc, index));
/// Target utimes() handler.
template <class OS>
SyscallReturn
-utimesFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+utimesFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
std::string path;
/// Target getrusage() function.
template <class OS>
SyscallReturn
-getrusageFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+getrusageFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
int index = 0;
/// Target times() function.
template <class OS>
SyscallReturn
-timesFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+timesFunc(SyscallDesc *desc, int callnum, Process *process,
+ ThreadContext *tc)
{
int index = 0;
TypedBufferArg<typename OS::tms> bufp(process->getSyscallArg(tc, index));
/// Target time() function.
template <class OS>
SyscallReturn
-timeFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
- ThreadContext *tc)
+timeFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
{
typename OS::time_t sec, usec;
getElapsedTimeMicro(sec, usec);
from cpu2000 import mcf
workload = mcf(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
root.system.physmem.range=AddrRange('256MB')
from cpu2000 import parser
workload = parser(isa, opsys, 'mdred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
from cpu2000 import eon_cook
workload = eon_cook(isa, opsys, 'mdred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
from cpu2000 import perlbmk_makerand
workload = perlbmk_makerand(isa, opsys, 'mdred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
from cpu2000 import vortex
workload = vortex(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
from cpu2000 import bzip2_source
workload = bzip2_source(isa, opsys, 'lgred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
import os
workload = twolf(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
cwd = root.system.cpu[0].workload[0].cwd
#Remove two files who's presence or absence affects execution
]
for i, cpu in zip(range(len(cpus)), root.system.cpu):
- p = LiveProcess()
+ p = Process()
p.executable = benchmarks[i*2]
p.cmd = benchmarks[(i*2)+1]
root.system.cpu[i].workload = p
root.system.cpu[i].max_insts_all_threads = 10000000
-#root.system.cpu.workload = LiveProcess(cmd = 'hello',
- # executable = binpath('hello'))
+#root.system.cpu.workload = Process(cmd = 'hello',
+ # executable = binpath('hello'))
#
# Authors: Steve Reinhardt
-root.system.cpu[0].workload = LiveProcess(cmd = 'hello',
- executable = binpath('hello'))
+root.system.cpu[0].workload = Process(cmd = 'hello',
+ executable = binpath('hello'))
if root.system.cpu[0].checker != NULL:
root.system.cpu[0].checker.workload = root.system.cpu[0].workload
#
# Authors: Korey Sewell
-process1 = LiveProcess(cmd = 'hello', executable = binpath('hello'))
-process2 = LiveProcess(cmd = 'hello', executable = binpath('hello'))
+process1 = Process(cmd = 'hello', executable = binpath('hello'))
+process2 = Process(cmd = 'hello', executable = binpath('hello'))
root.system.cpu[0].workload = [process1, process2]
#
# Authors: Ali Saidi
-root.system.cpu[0].workload = LiveProcess(cmd = 'insttest',
- executable = binpath('insttest'))
+root.system.cpu[0].workload = Process(cmd = 'insttest',
+ executable = binpath('insttest'))
driver = ClDriver(filename="hsa", codefile=kernel_files)
root.system.cpu[2].cl_driver = driver
-root.system.cpu[0].workload = LiveProcess(cmd = 'gpu-hello',
- executable = binpath('gpu-hello'),
- drivers = [driver])
+root.system.cpu[0].workload = Process(cmd = 'gpu-hello',
+ executable = binpath('gpu-hello'),
+ drivers = [driver])
from cpu2000 import mcf
workload = mcf(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
root.system.physmem.range=AddrRange('256MB')
from cpu2000 import eon_cook
workload = eon_cook(isa, opsys, 'mdred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
-process = LiveProcess(executable = binpath('m5threads', 'test_atomic'),
- cmd = ['test_atomic', str(nb_cores)])
+process = Process(executable = binpath('m5threads', 'test_atomic'),
+ cmd = ['test_atomic', str(nb_cores)])
for i in range(nb_cores):
root.system.cpu[i].workload = process
from cpu2000 import vortex
workload = vortex(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
import os
workload = twolf(isa, opsys, 'smred')
-root.system.cpu[0].workload = workload.makeLiveProcess()
+root.system.cpu[0].workload = workload.makeProcess()
cwd = root.system.cpu[0].workload[0].cwd
#Remove two files who's presence or absence affects execution