summaryrefslogtreecommitdiff
path: root/src/sim/fd_entry.hh
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2018-04-18 14:48:19 -0400
committerAnthony Gutierrez <anthony.gutierrez@amd.com>2019-01-22 01:56:17 +0000
commita2ed7d5575fb7e847314bb87b92c73459149f2d0 (patch)
treeb632738c83cf8fb429d54706bb5c16e5c45c9643 /src/sim/fd_entry.hh
parent2c9f7ebca51eaf8fafd1f854ec0475cb18e9e20c (diff)
downloadgem5-a2ed7d5575fb7e847314bb87b92c73459149f2d0.tar.xz
sim-se: add socket-based functionality
Add socket, socketpair, bind, list, connect and shutdown system calls. Change-Id: I635af3fca410f96fe28f8fe497e3d457a9dbc470 Reviewed-on: https://gem5-review.googlesource.com/c/12113 Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/sim/fd_entry.hh')
-rw-r--r--src/sim/fd_entry.hh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sim/fd_entry.hh b/src/sim/fd_entry.hh
index 980011984..6b2b2daa8 100644
--- a/src/sim/fd_entry.hh
+++ b/src/sim/fd_entry.hh
@@ -211,4 +211,30 @@ class DeviceFDEntry : public FDEntry
std::string _fileName;
};
+class SocketFDEntry: public HBFDEntry
+{
+ public:
+ SocketFDEntry(int sim_fd, int domain, int type, int protocol,
+ bool close_on_exec = false)
+ : HBFDEntry(0, sim_fd, close_on_exec),
+ _domain(domain), _type(type), _protocol(protocol)
+ { }
+
+ SocketFDEntry(SocketFDEntry const& reg, bool close_on_exec = false)
+ : HBFDEntry(reg._flags, reg._simFD, close_on_exec),
+ _domain(reg._domain), _type(reg._type), _protocol(reg._protocol)
+ { }
+
+ std::shared_ptr<FDEntry>
+ clone() const override
+ {
+ return std::make_shared<SocketFDEntry>(*this);
+ }
+
+ private:
+ int _domain;
+ int _type;
+ int _protocol;
+};
+
#endif // __FD_ENTRY_HH__