summaryrefslogtreecommitdiff
path: root/src/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/sparc')
-rw-r--r--src/arch/sparc/linux/process.cc12
-rw-r--r--src/arch/sparc/linux/process.hh7
-rw-r--r--src/arch/sparc/process.cc14
-rw-r--r--src/arch/sparc/process.hh5
-rw-r--r--src/arch/sparc/solaris/process.cc13
-rw-r--r--src/arch/sparc/solaris/process.hh5
6 files changed, 39 insertions, 17 deletions
diff --git a/src/arch/sparc/linux/process.cc b/src/arch/sparc/linux/process.cc
index 8c2de8ca3..44c893f2b 100644
--- a/src/arch/sparc/linux/process.cc
+++ b/src/arch/sparc/linux/process.cc
@@ -47,7 +47,7 @@ using namespace SparcISA;
/// 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));
@@ -65,7 +65,7 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
SyscallReturn SparcISA::getresuidFunc(SyscallDesc *desc, int num,
- Process *p, ThreadContext *tc)
+ LiveProcess *p, ThreadContext *tc)
{
const IntReg id = htog(100);
Addr ruid = tc->getSyscallArg(0);
@@ -390,9 +390,13 @@ SparcLinuxProcess::SparcLinuxProcess(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)
: SparcLiveProcess(name, objFile, system,
- stdin_fd, stdout_fd, stderr_fd, argv, envp),
+ stdin_fd, stdout_fd, stderr_fd, argv, envp,
+ _uid, _euid, _gid, _egid, _pid, _ppid),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
// The sparc syscall table must be <= 284 entries because that is all there
diff --git a/src/arch/sparc/linux/process.hh b/src/arch/sparc/linux/process.hh
index 4af8f0f75..c758d5433 100644
--- a/src/arch/sparc/linux/process.hh
+++ b/src/arch/sparc/linux/process.hh
@@ -48,7 +48,10 @@ class SparcLinuxProcess : public SparcLiveProcess
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);
@@ -62,7 +65,7 @@ class SparcLinuxProcess : public SparcLiveProcess
};
SyscallReturn getresuidFunc(SyscallDesc *desc, int num,
- Process *p, ThreadContext *tc);
+ LiveProcess *p, ThreadContext *tc);
} // namespace SparcISA
#endif // __ALPHA_LINUX_PROCESS_HH__
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc
index a3bb0eb1a..3323ba7a0 100644
--- a/src/arch/sparc/process.cc
+++ b/src/arch/sparc/process.cc
@@ -45,9 +45,11 @@ using namespace SparcISA;
SparcLiveProcess::SparcLiveProcess(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)
{
// XXX all the below need to be updated for SPARC - Ali
@@ -190,10 +192,10 @@ SparcLiveProcess::argsInit(int intSize, int pageSize)
//The entry point to the program
auxv.push_back(buildAuxVect(SPARC_AT_ENTRY, objFile->entryPoint()));
//Different user and group IDs
- auxv.push_back(buildAuxVect(SPARC_AT_UID, uid));
- auxv.push_back(buildAuxVect(SPARC_AT_EUID, euid));
- auxv.push_back(buildAuxVect(SPARC_AT_GID, gid));
- auxv.push_back(buildAuxVect(SPARC_AT_EGID, egid));
+ auxv.push_back(buildAuxVect(SPARC_AT_UID, uid()));
+ auxv.push_back(buildAuxVect(SPARC_AT_EUID, euid()));
+ auxv.push_back(buildAuxVect(SPARC_AT_GID, gid()));
+ auxv.push_back(buildAuxVect(SPARC_AT_EGID, egid()));
//Whether to enable "secure mode" in the executable
auxv.push_back(buildAuxVect(SPARC_AT_SECURE, 0));
}
diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh
index 7ba8d7109..7cc52e241 100644
--- a/src/arch/sparc/process.hh
+++ b/src/arch/sparc/process.hh
@@ -60,7 +60,10 @@ class SparcLiveProcess : public LiveProcess
SparcLiveProcess(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/sparc/solaris/process.cc b/src/arch/sparc/solaris/process.cc
index af0550910..ff466c8e6 100644
--- a/src/arch/sparc/solaris/process.cc
+++ b/src/arch/sparc/solaris/process.cc
@@ -45,7 +45,7 @@ using namespace SparcISA;
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, Process *process,
+unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
TypedBufferArg<Solaris::utsname> name(tc->getSyscallArg(0));
@@ -328,9 +328,16 @@ SparcSolarisProcess::SparcSolarisProcess(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)
: SparcLiveProcess(name, objFile, system,
- stdin_fd, stdout_fd, stderr_fd, argv, envp),
+ stdin_fd, stdout_fd, stderr_fd, argv, envp,
+ _uid, _euid, _gid, _egid, _pid, _ppid),
Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
{
// The sparc syscall table must be <= 284 entries because that is all there
diff --git a/src/arch/sparc/solaris/process.hh b/src/arch/sparc/solaris/process.hh
index 3c0d7eba7..2cf329211 100644
--- a/src/arch/sparc/solaris/process.hh
+++ b/src/arch/sparc/solaris/process.hh
@@ -47,7 +47,10 @@ class SparcSolarisProcess : public SparcLiveProcess
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);