sim,misc: Rename M5OP_ANNOTATE to M5OP_RESERVED1.
[gem5.git] / src / sim / fd_entry.hh
index 980011984eb5424ccbb80cab34821280dacd28a7..8c181e3acae9a153a1fef05f5292e6203ff19c5e 100644 (file)
@@ -29,8 +29,6 @@
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Brandon Potter
  */
 
 #ifndef __FD_ENTRY_HH__
@@ -80,6 +78,16 @@ class HBFDEntry: public FDEntry
         : FDEntry(close_on_exec), _flags(flags), _simFD(sim_fd)
     { }
 
+    HBFDEntry(HBFDEntry const& reg, bool close_on_exec = false)
+        : FDEntry(close_on_exec), _flags(reg._flags), _simFD(reg._simFD)
+    { }
+
+    std::shared_ptr<FDEntry>
+    clone() const override
+    {
+        return std::make_shared<HBFDEntry>(*this);
+    }
+
     int getFlags() const { return _flags; }
     int getSimFD() const { return _simFD; }
 
@@ -211,4 +219,29 @@ 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);
+    }
+
+    int _domain;
+    int _type;
+    int _protocol;
+};
+
 #endif // __FD_ENTRY_HH__