summaryrefslogtreecommitdiff
path: root/sim/syscall_emul.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-02-20 23:26:39 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-02-20 23:26:39 -0500
commitd96de69abc02b40e1dec4843a7a7b7e30749f4fa (patch)
tree0c3fd42012ec416fcabdc8691f2ccd202ee98865 /sim/syscall_emul.cc
parentb74f1b829d14e43256fb4a9efd3b951e81ad12d2 (diff)
downloadgem5-d96de69abc02b40e1dec4843a7a7b7e30749f4fa.tar.xz
Add in a new translating port that allows syscalls to translate addresses via the page table before accessing the memory port.
Other compile issues cleaned up. SConscript: Changes to compile the new Translating Port. Split out memtester and eio support, will rework them back in after first getting a simpleCPU to work arch/alpha/alpha_linux_process.cc: arch/alpha/alpha_tru64_process.cc: sim/syscall_emul.cc: sim/syscall_emul.hh: Changes to use the new translating Port. cpu/exec_context.cc: cpu/exec_context.hh: Create a translating port in each execution context. sim/process.cc: Fix the way we do proxy memory --HG-- extra : convert_revision : 3d33218fe8b425a5d9ce24757f1112b4aa6001fd
Diffstat (limited to 'sim/syscall_emul.cc')
-rw-r--r--sim/syscall_emul.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sim/syscall_emul.cc b/sim/syscall_emul.cc
index 78b4201d4..0cebee0e1 100644
--- a/sim/syscall_emul.cc
+++ b/sim/syscall_emul.cc
@@ -128,7 +128,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->cpu->memPort);
+ bufArg.copyOut(xc->port);
return bytes_read;
}
@@ -140,7 +140,7 @@ writeFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
int nbytes = xc->getSyscallArg(2);
BufferArg bufArg(xc->getSyscallArg(1), nbytes);
- bufArg.copyIn(xc->cpu->memPort);
+ bufArg.copyIn(xc->port);
int bytes_written = write(fd, bufArg.bufferPtr(), nbytes);
@@ -181,7 +181,7 @@ gethostnameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
strncpy((char *)name.bufferPtr(), hostname, name_len);
- name.copyOut(xc->cpu->memPort);
+ name.copyOut(xc->port);
return 0;
}
@@ -191,7 +191,7 @@ unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->cpu->memPort->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
return (TheISA::IntReg)-EFAULT;
int result = unlink(path.c_str());
@@ -203,12 +203,12 @@ renameFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string old_name;
- if (xc->cpu->memPort->readStringFunctional(old_name, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->port->readStringFunctional(old_name, xc->getSyscallArg(0)) != No_Fault)
return -EFAULT;
string new_name;
- if (xc->cpu->memPort->readStringFunctional(new_name, xc->getSyscallArg(1)) != No_Fault)
+ if (xc->port->readStringFunctional(new_name, xc->getSyscallArg(1)) != No_Fault)
return -EFAULT;
int64_t result = rename(old_name.c_str(), new_name.c_str());
@@ -220,7 +220,7 @@ truncateFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->cpu->memPort->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
return -EFAULT;
off_t length = xc->getSyscallArg(1);
@@ -248,7 +248,7 @@ chownFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->cpu->memPort->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->port->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
return -EFAULT;
/* XXX endianess */