summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-03-10 16:59:02 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-03-10 16:59:02 -0500
commit5ba4c8e96ef694431ff1715fbea7cd0e70e6b072 (patch)
tree4847c6c99043470e678ccafcdb5a0039f3ede3c6 /sim
parentd07115f97266185fea006854f6e5eea8bf992c4b (diff)
downloadgem5-5ba4c8e96ef694431ff1715fbea7cd0e70e6b072.tar.xz
It now runs hello world binary.
Fixed the exec context proxy class to have a getMemPort function. arch/alpha/linux/process.cc: arch/alpha/tru64/process.cc: kern/tru64/tru64.hh: sim/syscall_emul.cc: sim/syscall_emul.hh: Fix to use new exec context proxy --HG-- extra : convert_revision : eaa05dfab3fdb77627f6cf404a2569a44232f604
Diffstat (limited to 'sim')
-rw-r--r--sim/syscall_emul.cc16
-rw-r--r--sim/syscall_emul.hh40
2 files changed, 28 insertions, 28 deletions
diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc
index 1d0b3a375..faad733a8 100644
--- a/sim/syscall_emul.cc
+++ b/sim/syscall_emul.cc
@@ -130,7 +130,7 @@ readFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
int bytes_read = read(fd, bufArg.bufferPtr(), nbytes);
if (bytes_read != -1)
- bufArg.copyOut(xc->port);
+ bufArg.copyOut(xc->getMemPort());
return bytes_read;
}
@@ -142,7 +142,7 @@ writeFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
int nbytes = xc->getSyscallArg(2);
BufferArg bufArg(xc->getSyscallArg(1), nbytes);
- bufArg.copyIn(xc->port);
+ bufArg.copyIn(xc->getMemPort());
int bytes_written = write(fd, bufArg.bufferPtr(), nbytes);
@@ -183,7 +183,7 @@ gethostnameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
strncpy((char *)name.bufferPtr(), hostname, name_len);
- name.copyOut(xc->port);
+ name.copyOut(xc->getMemPort());
return 0;
}
@@ -193,7 +193,7 @@ unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return (TheISA::IntReg)-EFAULT;
int result = unlink(path.c_str());
@@ -205,12 +205,12 @@ renameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string old_name;
- if (xc->port->readStringFunctional(old_name, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(old_name, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
string new_name;
- if (xc->port->readStringFunctional(new_name, xc->getSyscallArg(1)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(new_name, xc->getSyscallArg(1)) != NoFault)
return -EFAULT;
int64_t result = rename(old_name.c_str(), new_name.c_str());
@@ -222,7 +222,7 @@ truncateFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
off_t length = xc->getSyscallArg(1);
@@ -250,7 +250,7 @@ chownFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
/* XXX endianess */
diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh
index 25f8c6cb8..8eacf9200 100644
--- a/sim/syscall_emul.hh
+++ b/sim/syscall_emul.hh
@@ -370,7 +370,7 @@ openFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
if (path == "/dev/sysdev0") {
@@ -417,7 +417,7 @@ chmodFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
uint32_t mode = xc->getSyscallArg(1);
@@ -470,7 +470,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
struct stat hostBuf;
@@ -479,7 +479,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -508,7 +508,7 @@ fstat64Func(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStat64Buf(xc->port, fd, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStat64Buf(xc->getMemPort(), fd, xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -522,7 +522,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
struct stat hostBuf;
@@ -531,7 +531,7 @@ lstatFunc(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -544,7 +544,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
#if BSD_HOST
@@ -558,7 +558,7 @@ lstat64Func(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStat64Buf(xc->port, -1, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStat64Buf(xc->getMemPort(), -1, xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -582,7 +582,7 @@ fstatFunc(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStatBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -596,7 +596,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
struct statfs hostBuf;
@@ -605,7 +605,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -628,7 +628,7 @@ fstatfsFunc(SyscallDesc *desc, int callnum, Process *process,
if (result < 0)
return -errno;
- OS::copyOutStatfsBuf(xc->port, xc->getSyscallArg(1), &hostBuf);
+ OS::copyOutStatfsBuf(xc->getMemPort(), xc->getSyscallArg(1), &hostBuf);
return 0;
}
@@ -652,11 +652,11 @@ writevFunc(SyscallDesc *desc, int callnum, Process *process,
for (int i = 0; i < count; ++i)
{
typename OS::tgt_iovec tiov;
- xc->port->readBlobFunctional(tiov_base + i*sizeof(typename OS::tgt_iovec),(uint8_t*)
+ xc->getMemPort()->readBlobFunctional(tiov_base + i*sizeof(typename OS::tgt_iovec),(uint8_t*)
&tiov, sizeof(typename OS::tgt_iovec));
hiov[i].iov_len = gtoh(tiov.iov_len);
hiov[i].iov_base = new char [hiov[i].iov_len];
- xc->port->readBlobFunctional(gtoh(tiov.iov_base),
+ xc->getMemPort()->readBlobFunctional(gtoh(tiov.iov_base),
(uint8_t *)hiov[i].iov_base, hiov[i].iov_len);
}
@@ -739,7 +739,7 @@ getrlimitFunc(SyscallDesc *desc, int callnum, Process *process,
break;
}
- rlp.copyOut(xc->port);
+ rlp.copyOut(xc->getMemPort());
return 0;
}
@@ -756,7 +756,7 @@ gettimeofdayFunc(SyscallDesc *desc, int callnum, Process *process,
tp->tv_sec = htog(tp->tv_sec);
tp->tv_usec = htog(tp->tv_usec);
- tp.copyOut(xc->port);
+ tp.copyOut(xc->getMemPort());
return 0;
}
@@ -770,11 +770,11 @@ utimesFunc(SyscallDesc *desc, int callnum, Process *process,
{
std::string path;
- if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
+ if (xc->getMemPort()->readStringFunctional(path, xc->getSyscallArg(0)) != NoFault)
return -EFAULT;
TypedBufferArg<typename OS::timeval [2]> tp(xc->getSyscallArg(1));
- tp.copyIn(xc->port);
+ tp.copyIn(xc->getMemPort());
struct timeval hostTimeval[2];
for (int i = 0; i < 2; ++i)
@@ -826,7 +826,7 @@ getrusageFunc(SyscallDesc *desc, int callnum, Process *process,
rup->ru_nvcsw = 0;
rup->ru_nivcsw = 0;
- rup.copyOut(xc->port);
+ rup.copyOut(xc->getMemPort());
return 0;
}