summaryrefslogtreecommitdiff
path: root/sim/syscall_emul.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-02-15 22:05:23 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-02-15 22:05:23 -0500
commitd142788172ee79e6e67fc8510940c884807305ad (patch)
treed1c665421357acae6f17cedc4168789f1913f6b1 /sim/syscall_emul.cc
parentb8a2d1e5c78eac41125a0be0bc2b5d5fe4714684 (diff)
downloadgem5-d142788172ee79e6e67fc8510940c884807305ad.tar.xz
More compilation fixes.
Should we add a proxy_port that does the v->p address translation? Should the proxy port return a fault on translation errors, if we add one? arch/alpha/alpha_linux_process.cc: Syscalls use a memPort through the CPU now instead of a xc functional memory. cpu/base.hh: Add a pointer to the memPort syscalls will use. Should this be a proxy_port that does address translation? cpu/exec_context.cc: cpu/exec_context.hh: Remove functional memory from the exec context cpu/simple/cpu.cc: Set the memPort to be used as the syscall port as the dcache port sim/syscall_emul.cc: sim/syscall_emul.hh: Syscalls use a memPort through the CPU now instead of a xc functional memory. Also, fix the fact that readStringFunctional doesn't return a fault... should proxy_port handle this because it is doing the translation? --HG-- extra : convert_revision : 1f65318c6594301a75dc4dc0c99fdd436b094a7f
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 4b6388a41..78b4201d4 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->mem);
+ bufArg.copyOut(xc->cpu->memPort);
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->mem);
+ bufArg.copyIn(xc->cpu->memPort);
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->mem);
+ name.copyOut(xc->cpu->memPort);
return 0;
}
@@ -191,7 +191,7 @@ unlinkFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc)
{
string path;
- if (xc->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->cpu->memPort->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->mem->readString(old_name, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->cpu->memPort->readStringFunctional(old_name, xc->getSyscallArg(0)) != No_Fault)
return -EFAULT;
string new_name;
- if (xc->mem->readString(new_name, xc->getSyscallArg(1)) != No_Fault)
+ if (xc->cpu->memPort->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->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->cpu->memPort->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->mem->readString(path, xc->getSyscallArg(0)) != No_Fault)
+ if (xc->cpu->memPort->readStringFunctional(path, xc->getSyscallArg(0)) != No_Fault)
return -EFAULT;
/* XXX endianess */