From 30b87e90f8e3f6ffa16026f7776c6609fe3ada24 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 17 Sep 2006 03:00:55 -0400 Subject: 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 --- src/arch/alpha/linux/process.cc | 16 +++++++++++----- src/arch/alpha/linux/process.hh | 5 ++++- src/arch/alpha/process.cc | 6 ++++-- src/arch/alpha/process.hh | 5 ++++- src/arch/alpha/tru64/process.cc | 35 +++++++++++++++++++---------------- src/arch/alpha/tru64/process.hh | 5 ++++- 6 files changed, 46 insertions(+), 26 deletions(-) (limited to 'src/arch/alpha') 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 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 &argv, - std::vector &envp) + std::vector &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 &argv, - std::vector &envp); + std::vector &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 &argv, std::vector &envp) + std::vector &argv, std::vector &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 &argv, - std::vector &envp); + std::vector &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 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), - /* 68 */ SyscallDesc("pre_F64_lstat", lstatFunc), + /* 67 */ SyscallDesc("pre_F64_stat", statFunc), + /* 68 */ SyscallDesc("pre_F64_lstat", lstatFunc), /* 69 */ SyscallDesc("sbrk", unimplementedFunc), /* 70 */ SyscallDesc("sstk", unimplementedFunc), /* 71 */ SyscallDesc("mmap", mmapFunc), @@ -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), + /* 91 */ SyscallDesc("pre_F64_fstat", fstatFunc), /* 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), - /* 161 */ SyscallDesc("pre_F64_fstatfs", fstatfsFunc), + /* 160 */ SyscallDesc("pre_F64_statfs", statfsFunc), + /* 161 */ SyscallDesc("pre_F64_fstatfs", fstatfsFunc), /* 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), - /* 225 */ SyscallDesc("lstat", lstatFunc), - /* 226 */ SyscallDesc("fstat", fstatFunc), - /* 227 */ SyscallDesc("statfs", statfsFunc), - /* 228 */ SyscallDesc("fstatfs", fstatfsFunc), + /* 224 */ SyscallDesc("stat", statFunc), + /* 225 */ SyscallDesc("lstat", lstatFunc), + /* 226 */ SyscallDesc("fstat", fstatFunc), + /* 227 */ SyscallDesc("statfs", statfsFunc), + /* 228 */ SyscallDesc("fstatfs", fstatfsFunc), /* 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 &argv, - std::vector &envp) + std::vector &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 &argv, - std::vector &envp); + std::vector &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[]; -- cgit v1.2.3