summaryrefslogtreecommitdiff
path: root/src/kern/linux/linux.hh
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/kern/linux/linux.hh
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/kern/linux/linux.hh')
-rw-r--r--src/kern/linux/linux.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh
index a1df99467..e559e0505 100644
--- a/src/kern/linux/linux.hh
+++ b/src/kern/linux/linux.hh
@@ -153,6 +153,15 @@ class Linux : public OperatingSystem
uint64_t iov_len;
};
+ // For select().
+ // linux-3.14-src/include/uapi/linux/posix_types.h
+ struct fd_set{
+#ifndef LINUX__FD_SETSIZE
+#define LINUX__FD_SETSIZE 1024
+ unsigned long fds_bits[LINUX__FD_SETSIZE / (8 * sizeof(long))];
+#endif
+ };
+
//@{
/// ioctl() command codes.
static const unsigned TGT_TCGETS = 0x5401;
@@ -265,6 +274,14 @@ class Linux : public OperatingSystem
static const unsigned TGT_CLONE_NEWPID = 0x20000000;
static const unsigned TGT_CLONE_NEWNET = 0x40000000;
static const unsigned TGT_CLONE_IO = 0x80000000;
+
+ // linux-3.13-src/include/uapi/linux/wait.h
+ static const unsigned TGT_WNOHANG = 0x00000001;
+ static const unsigned TGT_WUNTRACED = 0x00000002;
+ static const unsigned TGT_WSTOPPED = TGT_WUNTRACED;
+ static const unsigned TGT_WEXITED = 0x00000004;
+ static const unsigned TGT_WCONTINUED = 0x00000008;
+ static const unsigned TGT_WNOWAIT = 0x01000000;
}; // class Linux
#endif // __LINUX_HH__