Enable getuid and getgid related syscalls on X86_SE
authorVince Weaver <vince@csl.cornell.edu>
Mon, 19 Oct 2009 21:29:34 +0000 (17:29 -0400)
committerVince Weaver <vince@csl.cornell.edu>
Mon, 19 Oct 2009 21:29:34 +0000 (17:29 -0400)
I've tested these on x86 and they work as expected.

In theory for 32-bit x86 we should have some sort of special
handling for the legacy 16-bit uid/gid syscalls, but in practice
modern toolchains don't use the 16-bit versions, and m5 sets the uid
and gid values to be less than 16-bits anyway.

This fix is needed for the perl spec2k benchmarks to run.

src/arch/x86/linux/syscalls.cc

index 74a6ad0b765f4f2612d2a1d4197d2679dc1c7fc0..2b54843f36a301ae9d8afdf1fce4074423a7b451 100644 (file)
@@ -531,7 +531,7 @@ SyscallDesc I386LinuxProcess::syscallDescs[] = {
     /*  21 */ SyscallDesc("mount", unimplementedFunc),
     /*  22 */ SyscallDesc("umount", unimplementedFunc),
     /*  23 */ SyscallDesc("setuid", unimplementedFunc),
-    /*  24 */ SyscallDesc("getuid", unimplementedFunc),
+    /*  24 */ SyscallDesc("getuid", getuidFunc),
     /*  25 */ SyscallDesc("stime", unimplementedFunc),
     /*  26 */ SyscallDesc("ptrace", unimplementedFunc),
     /*  27 */ SyscallDesc("alarm", unimplementedFunc),
@@ -554,10 +554,10 @@ SyscallDesc I386LinuxProcess::syscallDescs[] = {
     /*  44 */ SyscallDesc("prof", unimplementedFunc),
     /*  45 */ SyscallDesc("brk", brkFunc),
     /*  46 */ SyscallDesc("setgid", unimplementedFunc),
-    /*  47 */ SyscallDesc("getgid", unimplementedFunc),
+    /*  47 */ SyscallDesc("getgid", getgidFunc),
     /*  48 */ SyscallDesc("signal", unimplementedFunc),
-    /*  49 */ SyscallDesc("geteuid", unimplementedFunc),
-    /*  50 */ SyscallDesc("getegid", unimplementedFunc),
+    /*  49 */ SyscallDesc("geteuid", geteuidFunc),
+    /*  50 */ SyscallDesc("getegid", getegidFunc),
     /*  51 */ SyscallDesc("acct", unimplementedFunc),
     /*  52 */ SyscallDesc("umount2", unimplementedFunc),
     /*  53 */ SyscallDesc("lock", unimplementedFunc),
@@ -706,10 +706,10 @@ SyscallDesc I386LinuxProcess::syscallDescs[] = {
     /* 196 */ SyscallDesc("lstat64", unimplementedFunc),
     /* 197 */ SyscallDesc("fstat64", fstat64Func<X86Linux32>),
     /* 198 */ SyscallDesc("lchown32", unimplementedFunc),
-    /* 199 */ SyscallDesc("getuid32", unimplementedFunc),
-    /* 200 */ SyscallDesc("getgid32", unimplementedFunc),
-    /* 201 */ SyscallDesc("geteuid32", unimplementedFunc),
-    /* 202 */ SyscallDesc("getegid32", unimplementedFunc),
+    /* 199 */ SyscallDesc("getuid32", getuidFunc),
+    /* 200 */ SyscallDesc("getgid32", getgidFunc),
+    /* 201 */ SyscallDesc("geteuid32", geteuidFunc),
+    /* 202 */ SyscallDesc("getegid32", getegidFunc),
     /* 203 */ SyscallDesc("setreuid32", unimplementedFunc),
     /* 204 */ SyscallDesc("setregid32", unimplementedFunc),
     /* 205 */ SyscallDesc("getgroups32", unimplementedFunc),