From bc74c58eaf55005a6a4b2e67657da4121554943c Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Wed, 18 Apr 2018 14:57:57 -0400 Subject: 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 Maintainer: Anthony Gutierrez --- src/kern/linux/linux.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/kern/linux/linux.hh') 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__ -- cgit v1.2.3