changeset c9c465241d3b in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c9c465241d3b
description:
X86: Install some 32 bit system calls.
diffstat:
3 files changed, 68 insertions(+), 4 deletions(-)
src/arch/x86/linux/linux.cc | 39 +++++++++++++++++++++++++++++++++++++++
src/arch/x86/linux/linux.hh | 25 +++++++++++++++++++++++++
src/arch/x86/linux/syscalls.cc | 8 ++++----
diffs (118 lines):
diff -r 1f14f6f5e613 -r c9c465241d3b src/arch/x86/linux/linux.cc
--- a/src/arch/x86/linux/linux.cc Fri Feb 27 09:22:30 2009 -0800
+++ b/src/arch/x86/linux/linux.cc Fri Feb 27 09:22:50 2009 -0800
@@ -97,3 +97,42 @@
sizeof(X86Linux64::openFlagTable) /
sizeof(X86Linux64::openFlagTable[0]);
+// open(2) flags translation table
+OpenFlagTransTable X86Linux32::openFlagTable[] = {
+#ifdef _MSC_VER
+ { TGT_O_RDONLY, _O_RDONLY },
+ { TGT_O_WRONLY, _O_WRONLY },
+ { TGT_O_RDWR, _O_RDWR },
+ { TGT_O_APPEND, _O_APPEND },
+ { TGT_O_CREAT, _O_CREAT },
+ { TGT_O_TRUNC, _O_TRUNC },
+ { TGT_O_EXCL, _O_EXCL },
+#ifdef _O_NONBLOCK
+ { TGT_O_NONBLOCK, _O_NONBLOCK },
+#endif
+#ifdef _O_NOCTTY
+ { TGT_O_NOCTTY, _O_NOCTTY },
+#endif
+#ifdef _O_SYNC
+ { TGT_O_SYNC, _O_SYNC },
+#endif
+#else /* !_MSC_VER */
+ { TGT_O_RDONLY, O_RDONLY },
+ { TGT_O_WRONLY, O_WRONLY },
+ { TGT_O_RDWR, O_RDWR },
+ { TGT_O_APPEND, O_APPEND },
+ { TGT_O_CREAT, O_CREAT },
+ { TGT_O_TRUNC, O_TRUNC },
+ { TGT_O_EXCL, O_EXCL },
+ { TGT_O_NONBLOCK, O_NONBLOCK },
+ { TGT_O_NOCTTY, O_NOCTTY },
+#ifdef O_SYNC
+ { TGT_O_SYNC, O_SYNC },
+#endif
+#endif /* _MSC_VER */
+};
+
+const int X86Linux32::NUM_OPEN_FLAGS =
+ sizeof(X86Linux32::openFlagTable) /
+ sizeof(X86Linux32::openFlagTable[0]);
+
diff -r 1f14f6f5e613 -r c9c465241d3b src/arch/x86/linux/linux.hh
--- a/src/arch/x86/linux/linux.hh Fri Feb 27 09:22:30 2009 -0800
+++ b/src/arch/x86/linux/linux.hh Fri Feb 27 09:22:50 2009 -0800
@@ -113,4 +113,29 @@
} tgt_iovec;
};
+class X86Linux32 : public Linux
+{
+ public:
+
+ static OpenFlagTransTable openFlagTable[];
+
+ static const int TGT_O_RDONLY = 00000000; //!< O_RDONLY
+ static const int TGT_O_WRONLY = 00000001; //!< O_WRONLY
+ static const int TGT_O_RDWR = 00000002; //!< O_RDWR
+ static const int TGT_O_NONBLOCK = 00004000; //!< O_NONBLOCK
+ static const int TGT_O_APPEND = 00002000; //!< O_APPEND
+ static const int TGT_O_CREAT = 00000100; //!< O_CREAT
+ static const int TGT_O_TRUNC = 00001000; //!< O_TRUNC
+ static const int TGT_O_EXCL = 00000200; //!< O_EXCL
+ static const int TGT_O_NOCTTY = 00000400; //!< O_NOCTTY
+ static const int TGT_O_SYNC = 00010000; //!< O_SYNC
+// static const int TGT_O_DRD = 0x00010000; //!< O_DRD
+// static const int TGT_O_DIRECTIO = 0x00020000; //!< O_DIRECTIO
+// static const int TGT_O_CACHE = 0x00002000; //!< O_CACHE
+// static const int TGT_O_DSYNC = 0x00008000; //!< O_DSYNC
+// static const int TGT_O_RSYNC = 0x00040000; //!< O_RSYNC
+
+ static const int NUM_OPEN_FLAGS;
+};
+
#endif
diff -r 1f14f6f5e613 -r c9c465241d3b src/arch/x86/linux/syscalls.cc
--- a/src/arch/x86/linux/syscalls.cc Fri Feb 27 09:22:30 2009 -0800
+++ b/src/arch/x86/linux/syscalls.cc Fri Feb 27 09:22:50 2009 -0800
@@ -404,7 +404,7 @@
/* 2 */ SyscallDesc("fork", unimplementedFunc),
/* 3 */ SyscallDesc("read", unimplementedFunc),
/* 4 */ SyscallDesc("write", unimplementedFunc),
- /* 5 */ SyscallDesc("open", unimplementedFunc),
+ /* 5 */ SyscallDesc("open", openFunc<X86Linux64>),
/* 6 */ SyscallDesc("close", unimplementedFunc),
/* 7 */ SyscallDesc("waitpid", unimplementedFunc),
/* 8 */ SyscallDesc("creat", unimplementedFunc),
@@ -444,7 +444,7 @@
/* 42 */ SyscallDesc("pipe", unimplementedFunc),
/* 43 */ SyscallDesc("times", unimplementedFunc),
/* 44 */ SyscallDesc("prof", unimplementedFunc),
- /* 45 */ SyscallDesc("brk", unimplementedFunc),
+ /* 45 */ SyscallDesc("brk", brkFunc),
/* 46 */ SyscallDesc("setgid", unimplementedFunc),
/* 47 */ SyscallDesc("getgid", unimplementedFunc),
/* 48 */ SyscallDesc("signal", unimplementedFunc),
@@ -521,7 +521,7 @@
/* 119 */ SyscallDesc("sigreturn", unimplementedFunc),
/* 120 */ SyscallDesc("clone", unimplementedFunc),
/* 121 */ SyscallDesc("setdomainname", unimplementedFunc),
- /* 122 */ SyscallDesc("uname", unimplementedFunc),
+ /* 122 */ SyscallDesc("uname", unameFunc),
/* 123 */ SyscallDesc("modify_ldt", unimplementedFunc),
/* 124 */ SyscallDesc("adjtimex", unimplementedFunc),
/* 125 */ SyscallDesc("mprotect", unimplementedFunc),
@@ -545,7 +545,7 @@
/* 143 */ SyscallDesc("flock", unimplementedFunc),
/* 144 */ SyscallDesc("msync", unimplementedFunc),
/* 145 */ SyscallDesc("readv", unimplementedFunc),
- /* 146 */ SyscallDesc("writev", unimplementedFunc),
+ /* 146 */ SyscallDesc("writev", writevFunc<X86Linux32>),
/* 147 */ SyscallDesc("getsid", unimplementedFunc),
/* 148 */ SyscallDesc("fdatasync", unimplementedFunc),
/* 149 */ SyscallDesc("_sysctl", unimplementedFunc),
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev