summaryrefslogtreecommitdiff
path: root/src/arch/alpha
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-09-17 03:00:55 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-09-17 03:00:55 -0400
commit30b87e90f8e3f6ffa16026f7776c6609fe3ada24 (patch)
treeb5e9cd853ea76982e5cb2e83e024592c3dc3886a /src/arch/alpha
parente4fcef58518840c8191c468aff6d314175d68e21 (diff)
downloadgem5-30b87e90f8e3f6ffa16026f7776c6609fe3ada24.tar.xz
Finished changing how stat structures are translated, fixed the handling of various ids as LiveProcess parameters.
src/arch/alpha/linux/process.cc: src/arch/alpha/linux/process.hh: src/arch/alpha/process.cc: src/arch/alpha/process.hh: src/arch/alpha/tru64/process.cc: src/arch/alpha/tru64/process.hh: src/arch/mips/linux/process.cc: src/arch/mips/linux/process.hh: src/arch/mips/process.cc: src/arch/mips/process.hh: src/arch/sparc/linux/process.cc: src/arch/sparc/linux/process.hh: src/arch/sparc/process.cc: src/arch/sparc/process.hh: src/arch/sparc/solaris/process.cc: src/arch/sparc/solaris/process.hh: src/sim/process.cc: src/sim/process.hh: src/sim/syscall_emul.cc: src/sim/syscall_emul.hh: Changed Process to LiveProcess in syscall handlers and fixed the implementation of uid, euid, gid, egid, pid and ppid as LiveProcess parameters. src/kern/tru64/tru64.hh: Changed Process to LiveProcess in syscall handlers and fixed the implementation of uid, euid, gid, egid, pid and ppid as LiveProcess parameters. Also fit tru64 in with the new way to handle stat calls. --HG-- extra : convert_revision : 0198b838e5c09a730065dc6f018738145bc96269
Diffstat (limited to 'src/arch/alpha')
-rw-r--r--src/arch/alpha/linux/process.cc16
-rw-r--r--src/arch/alpha/linux/process.hh5
-rw-r--r--src/arch/alpha/process.cc6
-rw-r--r--src/arch/alpha/process.hh5
-rw-r--r--src/arch/alpha/tru64/process.cc35
-rw-r--r--src/arch/alpha/tru64/process.hh5
6 files changed, 46 insertions, 26 deletions
diff --git a/src/arch/alpha/linux/process.cc b/src/arch/alpha/linux/process.cc
index 357ebdada..56342dbc5 100644
--- a/src/arch/alpha/linux/process.cc
+++ b/src/arch/alpha/linux/process.cc
@@ -47,7 +47,7 @@ using namespace AlphaISA;
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, Process *process,
+unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
TypedBufferArg<Linux::utsname> name(tc->getSyscallArg(0));
@@ -66,7 +66,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
/// 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, Process *process,
+osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
unsigned op = tc->getSyscallArg(0);
@@ -93,7 +93,7 @@ osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
/// Target osf_setsysinfo() handler.
static SyscallReturn
-osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
+osf_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
unsigned op = tc->getSyscallArg(0);
@@ -575,9 +575,15 @@ AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name,
int stdout_fd,
int stderr_fd,
std::vector<std::string> &argv,
- std::vector<std::string> &envp)
+ std::vector<std::string> &envp,
+ uint64_t _uid,
+ uint64_t _euid,
+ uint64_t _gid,
+ uint64_t _egid,
+ uint64_t _pid,
+ uint64_t _ppid)
: AlphaLiveProcess(name, objFile, system, stdin_fd, stdout_fd,
- stderr_fd, argv, envp),
+ stderr_fd, argv, envp, _uid, _euid, _gid, _egid, _pid, _ppid),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
//init_regs->intRegFile[0] = 0;
diff --git a/src/arch/alpha/linux/process.hh b/src/arch/alpha/linux/process.hh
index 9cc7dc7b6..b23904844 100644
--- a/src/arch/alpha/linux/process.hh
+++ b/src/arch/alpha/linux/process.hh
@@ -45,7 +45,10 @@ class AlphaLinuxProcess : public AlphaLiveProcess
System *system,
int stdin_fd, int stdout_fd, int stderr_fd,
std::vector<std::string> &argv,
- std::vector<std::string> &envp);
+ std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid,
+ uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid);
virtual SyscallDesc* getDesc(int callnum);
diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc
index 32fb97229..9e360e80f 100644
--- a/src/arch/alpha/process.cc
+++ b/src/arch/alpha/process.cc
@@ -42,9 +42,11 @@ using namespace std;
AlphaLiveProcess::AlphaLiveProcess(const std::string &nm, ObjectFile *objFile,
System *_system, int stdin_fd, int stdout_fd, int stderr_fd,
- std::vector<std::string> &argv, std::vector<std::string> &envp)
+ std::vector<std::string> &argv, std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid, uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid)
: LiveProcess(nm, objFile, _system, stdin_fd, stdout_fd, stderr_fd,
- argv, envp)
+ argv, envp, _uid, _euid, _gid, _egid, _pid, _ppid)
{
brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
brk_point = roundUp(brk_point, VMPageSize);
diff --git a/src/arch/alpha/process.hh b/src/arch/alpha/process.hh
index 5d5c9a52e..c4aeb1885 100644
--- a/src/arch/alpha/process.hh
+++ b/src/arch/alpha/process.hh
@@ -46,7 +46,10 @@ class AlphaLiveProcess : public LiveProcess
AlphaLiveProcess(const std::string &nm, ObjectFile *objFile,
System *_system, int stdin_fd, int stdout_fd, int stderr_fd,
std::vector<std::string> &argv,
- std::vector<std::string> &envp);
+ std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid,
+ uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid);
void startup();
};
diff --git a/src/arch/alpha/tru64/process.cc b/src/arch/alpha/tru64/process.cc
index 82e44b9e7..55b8ebf8b 100644
--- a/src/arch/alpha/tru64/process.cc
+++ b/src/arch/alpha/tru64/process.cc
@@ -44,7 +44,7 @@ using namespace AlphaISA;
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, Process *process,
+unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
TypedBufferArg<AlphaTru64::utsname> name(tc->getSyscallArg(0));
@@ -61,7 +61,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
/// Target getsysyinfo() handler.
static SyscallReturn
-getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
+getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
unsigned op = tc->getSyscallArg(0);
@@ -140,7 +140,7 @@ getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
/// Target setsysyinfo() handler.
static SyscallReturn
-setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
+setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
unsigned op = tc->getSyscallArg(0);
@@ -162,7 +162,7 @@ setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
/// Target table() handler.
static
-SyscallReturn tableFunc(SyscallDesc *desc, int callnum,Process *process,
+SyscallReturn tableFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
using namespace std;
@@ -269,8 +269,8 @@ SyscallDesc AlphaTru64Process::syscallDescs[] = {
/* 64 */ SyscallDesc("getpagesize", getpagesizeFunc),
/* 65 */ SyscallDesc("mremap", unimplementedFunc),
/* 66 */ SyscallDesc("vfork", unimplementedFunc),
- /* 67 */ SyscallDesc("pre_F64_stat", statFunc<AlphaTru64::PreF64>),
- /* 68 */ SyscallDesc("pre_F64_lstat", lstatFunc<AlphaTru64::PreF64>),
+ /* 67 */ SyscallDesc("pre_F64_stat", statFunc<Tru64_PreF64>),
+ /* 68 */ SyscallDesc("pre_F64_lstat", lstatFunc<Tru64_PreF64>),
/* 69 */ SyscallDesc("sbrk", unimplementedFunc),
/* 70 */ SyscallDesc("sstk", unimplementedFunc),
/* 71 */ SyscallDesc("mmap", mmapFunc<AlphaTru64>),
@@ -293,7 +293,7 @@ SyscallDesc AlphaTru64Process::syscallDescs[] = {
/* 88 */ SyscallDesc("sethostname", unimplementedFunc),
/* 89 */ SyscallDesc("getdtablesize", unimplementedFunc),
/* 90 */ SyscallDesc("dup2", unimplementedFunc),
- /* 91 */ SyscallDesc("pre_F64_fstat", fstatFunc<AlphaTru64::PreF64>),
+ /* 91 */ SyscallDesc("pre_F64_fstat", fstatFunc<Tru64_PreF64>),
/* 92 */ SyscallDesc("fcntl", fcntlFunc),
/* 93 */ SyscallDesc("select", unimplementedFunc),
/* 94 */ SyscallDesc("poll", unimplementedFunc),
@@ -363,8 +363,8 @@ SyscallDesc AlphaTru64Process::syscallDescs[] = {
/* 157 */ SyscallDesc("sigwaitprim", unimplementedFunc),
/* 158 */ SyscallDesc("nfssvc", unimplementedFunc),
/* 159 */ SyscallDesc("getdirentries", AlphaTru64::getdirentriesFunc),
- /* 160 */ SyscallDesc("pre_F64_statfs", statfsFunc<AlphaTru64::PreF64>),
- /* 161 */ SyscallDesc("pre_F64_fstatfs", fstatfsFunc<AlphaTru64::PreF64>),
+ /* 160 */ SyscallDesc("pre_F64_statfs", statfsFunc<Tru64_PreF64>),
+ /* 161 */ SyscallDesc("pre_F64_fstatfs", fstatfsFunc<Tru64_PreF64>),
/* 162 */ SyscallDesc("unknown #162", unimplementedFunc),
/* 163 */ SyscallDesc("async_daemon", unimplementedFunc),
/* 164 */ SyscallDesc("getfh", unimplementedFunc),
@@ -427,11 +427,11 @@ SyscallDesc AlphaTru64Process::syscallDescs[] = {
/* 221 */ SyscallDesc("unknown #221", unimplementedFunc),
/* 222 */ SyscallDesc("security", unimplementedFunc),
/* 223 */ SyscallDesc("kloadcall", unimplementedFunc),
- /* 224 */ SyscallDesc("stat", statFunc<AlphaTru64::F64>),
- /* 225 */ SyscallDesc("lstat", lstatFunc<AlphaTru64::F64>),
- /* 226 */ SyscallDesc("fstat", fstatFunc<AlphaTru64::F64>),
- /* 227 */ SyscallDesc("statfs", statfsFunc<AlphaTru64::F64>),
- /* 228 */ SyscallDesc("fstatfs", fstatfsFunc<AlphaTru64::F64>),
+ /* 224 */ SyscallDesc("stat", statFunc<Tru64_F64>),
+ /* 225 */ SyscallDesc("lstat", lstatFunc<Tru64_F64>),
+ /* 226 */ SyscallDesc("fstat", fstatFunc<Tru64_F64>),
+ /* 227 */ SyscallDesc("statfs", statfsFunc<Tru64_F64>),
+ /* 228 */ SyscallDesc("fstatfs", fstatfsFunc<Tru64_F64>),
/* 229 */ SyscallDesc("getfsstat", unimplementedFunc),
/* 230 */ SyscallDesc("gettimeofday64", unimplementedFunc),
/* 231 */ SyscallDesc("settimeofday64", unimplementedFunc),
@@ -580,9 +580,12 @@ AlphaTru64Process::AlphaTru64Process(const std::string &name,
int stdout_fd,
int stderr_fd,
std::vector<std::string> &argv,
- std::vector<std::string> &envp)
+ std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid,
+ uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid)
: AlphaLiveProcess(name, objFile, system, stdin_fd, stdout_fd,
- stderr_fd, argv, envp),
+ stderr_fd, argv, envp, _uid, _euid, _gid, _egid, _pid, _ppid),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)),
Num_Mach_Syscall_Descs(sizeof(machSyscallDescs) / sizeof(SyscallDesc))
{
diff --git a/src/arch/alpha/tru64/process.hh b/src/arch/alpha/tru64/process.hh
index 5d91f6ac1..23429dad3 100644
--- a/src/arch/alpha/tru64/process.hh
+++ b/src/arch/alpha/tru64/process.hh
@@ -44,7 +44,10 @@ class AlphaTru64Process : public AlphaLiveProcess
System *system,
int stdin_fd, int stdout_fd, int stderr_fd,
std::vector<std::string> &argv,
- std::vector<std::string> &envp);
+ std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid,
+ uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid);
/// Array of syscall descriptors, indexed by call number.
static SyscallDesc syscallDescs[];