summaryrefslogtreecommitdiff
path: root/src/arch/x86/linux/process.cc
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2018-04-18 14:57:57 -0400
committerAnthony Gutierrez <anthony.gutierrez@amd.com>2019-01-22 02:05:48 +0000
commitbc74c58eaf55005a6a4b2e67657da4121554943c (patch)
tree92b04de877f151c7d5c562a117d695fdf913dc37 /src/arch/x86/linux/process.cc
parentc4e67f68377d9b3e909c76412b6ed2fde6a50e01 (diff)
downloadgem5-bc74c58eaf55005a6a4b2e67657da4121554943c.tar.xz
sim-se: add syscalls related to polling
Fix poll so that it will use the syscall retry capability instead of causing a blocking call. Add the accept and wait4 system calls. Add polling to read to remove deadlocks that occur in the event queue that are caused by blocking system calls. Modify the write system call to return an error number in case of error. Change-Id: I0b4091a2e41e4187ebf69d63e0088f988f37d5da Reviewed-on: https://gem5-review.googlesource.com/c/12115 Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/arch/x86/linux/process.cc')
-rw-r--r--src/arch/x86/linux/process.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc
index 65d0238f4..03a88fc6e 100644
--- a/src/arch/x86/linux/process.cc
+++ b/src/arch/x86/linux/process.cc
@@ -222,14 +222,14 @@ setThreadArea32Func(SyscallDesc *desc, int callnum,
}
static SyscallDesc syscallDescs64[] = {
- /* 0 */ SyscallDesc("read", readFunc),
- /* 1 */ SyscallDesc("write", writeFunc),
+ /* 0 */ SyscallDesc("read", readFunc<X86Linux64>),
+ /* 1 */ SyscallDesc("write", writeFunc<X86Linux64>),
/* 2 */ SyscallDesc("open", openFunc<X86Linux64>),
/* 3 */ SyscallDesc("close", closeFunc),
/* 4 */ SyscallDesc("stat", stat64Func<X86Linux64>),
/* 5 */ SyscallDesc("fstat", fstat64Func<X86Linux64>),
/* 6 */ SyscallDesc("lstat", lstat64Func<X86Linux64>),
- /* 7 */ SyscallDesc("poll", unimplementedFunc),
+ /* 7 */ SyscallDesc("poll", pollFunc<X86Linux64>),
/* 8 */ SyscallDesc("lseek", lseekFunc),
/* 9 */ SyscallDesc("mmap", mmapFunc<X86Linux64>),
/* 10 */ SyscallDesc("mprotect", ignoreFunc),
@@ -245,7 +245,7 @@ static SyscallDesc syscallDescs64[] = {
/* 20 */ SyscallDesc("writev", writevFunc<X86Linux64>),
/* 21 */ SyscallDesc("access", ignoreFunc),
/* 22 */ SyscallDesc("pipe", pipeFunc),
- /* 23 */ SyscallDesc("select", unimplementedFunc),
+ /* 23 */ SyscallDesc("select", selectFunc<X86Linux64>),
/* 24 */ SyscallDesc("sched_yield", ignoreFunc),
/* 25 */ SyscallDesc("mremap", mremapFunc<X86Linux64>),
/* 26 */ SyscallDesc("msync", unimplementedFunc),
@@ -265,7 +265,7 @@ static SyscallDesc syscallDescs64[] = {
/* 40 */ SyscallDesc("sendfile", unimplementedFunc),
/* 41 */ SyscallDesc("socket", socketFunc<X86Linux64>),
/* 42 */ SyscallDesc("connect", connectFunc),
- /* 43 */ SyscallDesc("accept", unimplementedFunc),
+ /* 43 */ SyscallDesc("accept", acceptFunc<X86Linux64>),
/* 44 */ SyscallDesc("sendto", sendtoFunc),
/* 45 */ SyscallDesc("recvfrom", recvfromFunc),
/* 46 */ SyscallDesc("sendmsg", sendmsgFunc),
@@ -283,7 +283,7 @@ static SyscallDesc syscallDescs64[] = {
/* 58 */ SyscallDesc("vfork", unimplementedFunc),
/* 59 */ SyscallDesc("execve", execveFunc<X86Linux64>),
/* 60 */ SyscallDesc("exit", exitFunc),
- /* 61 */ SyscallDesc("wait4", unimplementedFunc),
+ /* 61 */ SyscallDesc("wait4", wait4Func<X86Linux64>),
/* 62 */ SyscallDesc("kill", unimplementedFunc),
/* 63 */ SyscallDesc("uname", unameFunc),
/* 64 */ SyscallDesc("semget", unimplementedFunc),
@@ -558,8 +558,8 @@ static SyscallDesc syscallDescs32[] = {
/* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
/* 1 */ SyscallDesc("exit", exitFunc),
/* 2 */ SyscallDesc("fork", unimplementedFunc),
- /* 3 */ SyscallDesc("read", readFunc),
- /* 4 */ SyscallDesc("write", writeFunc),
+ /* 3 */ SyscallDesc("read", readFunc<X86Linux32>),
+ /* 4 */ SyscallDesc("write", writeFunc<X86Linux32>),
/* 5 */ SyscallDesc("open", openFunc<X86Linux32>),
/* 6 */ SyscallDesc("close", closeFunc),
/* 7 */ SyscallDesc("waitpid", unimplementedFunc),
@@ -637,7 +637,7 @@ static SyscallDesc syscallDescs32[] = {
/* 79 */ SyscallDesc("settimeofday", unimplementedFunc),
/* 80 */ SyscallDesc("getgroups", unimplementedFunc),
/* 81 */ SyscallDesc("setgroups", unimplementedFunc),
- /* 82 */ SyscallDesc("select", unimplementedFunc),
+ /* 82 */ SyscallDesc("select", selectFunc<X86Linux32>),
/* 83 */ SyscallDesc("symlink", unimplementedFunc),
/* 84 */ SyscallDesc("oldlstat", unimplementedFunc),
/* 85 */ SyscallDesc("readlink", readlinkFunc),
@@ -669,7 +669,7 @@ static SyscallDesc syscallDescs32[] = {
/* 111 */ SyscallDesc("vhangup", unimplementedFunc),
/* 112 */ SyscallDesc("idle", unimplementedFunc),
/* 113 */ SyscallDesc("vm86old", unimplementedFunc),
- /* 114 */ SyscallDesc("wait4", unimplementedFunc),
+ /* 114 */ SyscallDesc("wait4", wait4Func<X86Linux32>),
/* 115 */ SyscallDesc("swapoff", unimplementedFunc),
/* 116 */ SyscallDesc("sysinfo", sysinfoFunc<X86Linux32>),
/* 117 */ SyscallDesc("ipc", unimplementedFunc),
@@ -727,7 +727,7 @@ static SyscallDesc syscallDescs32[] = {
/* 165 */ SyscallDesc("getresuid", unimplementedFunc),
/* 166 */ SyscallDesc("vm86", unimplementedFunc),
/* 167 */ SyscallDesc("query_module", unimplementedFunc),
- /* 168 */ SyscallDesc("poll", unimplementedFunc),
+ /* 168 */ SyscallDesc("poll", pollFunc<X86Linux32>),
/* 169 */ SyscallDesc("nfsservctl", unimplementedFunc),
/* 170 */ SyscallDesc("setresgid", unimplementedFunc),
/* 171 */ SyscallDesc("getresgid", unimplementedFunc),