Add a tgt_iovec structure to support writev, change the name of X86Linux to X86Linux6...
authorGabe Black <gblack@eecs.umich.edu>
Tue, 24 Jul 2007 22:42:11 +0000 (15:42 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 24 Jul 2007 22:42:11 +0000 (15:42 -0700)
--HG--
extra : convert_revision : 9c13e9c68f331fe6c4a9abd96f7aee0f064101fc

src/arch/x86/linux/linux.cc
src/arch/x86/linux/linux.hh
src/arch/x86/linux/syscalls.cc

index 59754d7b3af19d1f90267b61930b4ff5d532daa6..5e8d2de1640034dfff44470672c476f16f2e5440 100644 (file)
@@ -59,7 +59,7 @@
 #include <fcntl.h>
 
 // open(2) flags translation table
-OpenFlagTransTable X86Linux::openFlagTable[] = {
+OpenFlagTransTable X86Linux64::openFlagTable[] = {
 #ifdef _MSC_VER
   { TGT_O_RDONLY, _O_RDONLY },
   { TGT_O_WRONLY, _O_WRONLY },
@@ -93,6 +93,7 @@ OpenFlagTransTable X86Linux::openFlagTable[] = {
 #endif /* _MSC_VER */
 };
 
-const int X86Linux::NUM_OPEN_FLAGS =
-        (sizeof(X86Linux::openFlagTable)/sizeof(X86Linux::openFlagTable[0]));
+const int X86Linux64::NUM_OPEN_FLAGS =
+        sizeof(X86Linux64::openFlagTable) /
+        sizeof(X86Linux64::openFlagTable[0]);
 
index a276d4c0ce439f058800279bc8987a7ba7665c2a..c1bb67260eb6a39ef5fef9fa649a54db09a5a640 100644 (file)
@@ -60,7 +60,7 @@
 
 #include "kern/linux/linux.hh"
 
-class X86Linux : public Linux
+class X86Linux64 : public Linux
 {
   public:
 
@@ -104,6 +104,11 @@ class X86Linux : public Linux
     static const int NUM_OPEN_FLAGS;
 
     static const unsigned TGT_MAP_ANONYMOUS = 0x20;
+
+    typedef struct {
+        uint64_t iov_base; // void *
+        uint64_t iov_len;  // size_t
+    } tgt_iovec;
 };
 
 #endif
index 30360e602070d79a27472f2f970768325b9a845f..30cfea49d51e3d9fd0b910cef2a5b62d1baddea2 100644 (file)
@@ -83,7 +83,7 @@ unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
 SyscallDesc X86LinuxProcess::syscallDescs[] = {
     /*   0 */ SyscallDesc("read", unimplementedFunc),
     /*   1 */ SyscallDesc("write", unimplementedFunc),
-    /*   2 */ SyscallDesc("open", openFunc<X86Linux>),
+    /*   2 */ SyscallDesc("open", openFunc<X86Linux64>),
     /*   3 */ SyscallDesc("close", unimplementedFunc),
     /*   4 */ SyscallDesc("stat", unimplementedFunc),
     /*   5 */ SyscallDesc("fstat", unimplementedFunc),
@@ -101,7 +101,7 @@ SyscallDesc X86LinuxProcess::syscallDescs[] = {
     /*  17 */ SyscallDesc("pread64", unimplementedFunc),
     /*  18 */ SyscallDesc("pwrite64", unimplementedFunc),
     /*  19 */ SyscallDesc("readv", unimplementedFunc),
-    /*  20 */ SyscallDesc("writev", unimplementedFunc),
+    /*  20 */ SyscallDesc("writev", writevFunc<X86Linux64>),
     /*  21 */ SyscallDesc("access", unimplementedFunc),
     /*  22 */ SyscallDesc("pipe", unimplementedFunc),
     /*  23 */ SyscallDesc("select", unimplementedFunc),
@@ -183,13 +183,13 @@ SyscallDesc X86LinuxProcess::syscallDescs[] = {
     /*  99 */ SyscallDesc("sysinfo", unimplementedFunc),
     /* 100 */ SyscallDesc("times", unimplementedFunc),
     /* 101 */ SyscallDesc("ptrace", unimplementedFunc),
-    /* 102 */ SyscallDesc("getuid", unimplementedFunc),
+    /* 102 */ SyscallDesc("getuid", getuidFunc),
     /* 103 */ SyscallDesc("syslog", unimplementedFunc),
-    /* 104 */ SyscallDesc("getgid", unimplementedFunc),
+    /* 104 */ SyscallDesc("getgid", getgidFunc),
     /* 105 */ SyscallDesc("setuid", unimplementedFunc),
     /* 106 */ SyscallDesc("setgid", unimplementedFunc),
-    /* 107 */ SyscallDesc("geteuid", unimplementedFunc),
-    /* 108 */ SyscallDesc("getegid", unimplementedFunc),
+    /* 107 */ SyscallDesc("geteuid", geteuidFunc),
+    /* 108 */ SyscallDesc("getegid", getegidFunc),
     /* 109 */ SyscallDesc("setpgid", unimplementedFunc),
     /* 110 */ SyscallDesc("getppid", unimplementedFunc),
     /* 111 */ SyscallDesc("getpgrp", unimplementedFunc),