summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-05-02 14:16:33 -0400
committerKevin Lim <ktlim@umich.edu>2005-05-02 14:16:33 -0400
commit6191d3e4443b5337232a238a3a0dd5d11249e223 (patch)
tree4adb8d7c510a8b123b285e0cd0cb2d74f093a108 /arch
parente2ad9e68160659712f017a2aa24cc2acc29cd7f0 (diff)
parent950ce813c436cd5a70ed44794f0508799c09ed3a (diff)
downloadgem5-6191d3e4443b5337232a238a3a0dd5d11249e223.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : ac0788599c365b2d7fe0870f0fea4b62c3b3ef22
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/alpha_tru64_process.cc4
-rw-r--r--arch/alpha/pseudo_inst.cc7
2 files changed, 9 insertions, 2 deletions
diff --git a/arch/alpha/alpha_tru64_process.cc b/arch/alpha/alpha_tru64_process.cc
index 441e7c89f..0910ec552 100644
--- a/arch/alpha/alpha_tru64_process.cc
+++ b/arch/alpha/alpha_tru64_process.cc
@@ -622,6 +622,9 @@ class Tru64 {
getdirentriesFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
+#ifdef __CYGWIN__
+ panic("getdirent not implemented on cygwin!");
+#else
int fd = process->sim_fd(xc->getSyscallArg(0));
Addr tgt_buf = xc->getSyscallArg(1);
int tgt_nbytes = xc->getSyscallArg(2);
@@ -670,6 +673,7 @@ class Tru64 {
basep.copyOut(xc->mem);
return tgt_buf_ptr - tgt_buf;
+#endif
}
/// Target sigreturn() handler.
diff --git a/arch/alpha/pseudo_inst.cc b/arch/alpha/pseudo_inst.cc
index 3c3b37928..a4af891af 100644
--- a/arch/alpha/pseudo_inst.cc
+++ b/arch/alpha/pseudo_inst.cc
@@ -26,6 +26,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstdio>
@@ -180,15 +181,17 @@ namespace AlphaPseudo
if (fd < 0)
panic("could not open file %s\n", file);
+ if (::lseek(fd, offset, SEEK_SET) < 0)
+ panic("could not seek: %s", strerror(errno));
+
char *buf = new char[len];
char *p = buf;
while (len > 0) {
- int bytes = ::pread(fd, p, len, offset);
+ int bytes = ::read(fd, p, len);
if (bytes <= 0)
break;
p += bytes;
- offset += bytes;
result += bytes;
len -= bytes;
}