mem-cache: Add multiple eviction stats
[gem5.git] / src / arch / arm / semihosting.hh
index 14c5f9d2d47311eb3da32ecccb068a00bba1c0ce..2ae31827ef13ae9feb657eaee7e89e8583b725aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 ARM Limited
+ * Copyright (c) 2018, 2019 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -243,7 +243,11 @@ class ArmSemihosting : public SimObject
         FILE *file;
     };
 
+    std::string filesRootDir;
     std::vector<std::unique_ptr<FileBase>> files;
+    FILE *stdin;
+    FILE *stdout;
+    FILE *stderr;
 
   protected: // Helper functions
     unsigned calcTickShift() const {
@@ -261,11 +265,11 @@ class ArmSemihosting : public SimObject
 
   private:
     typedef std::pair<uint64_t, SemiErrno> RetErrno;
-    static constexpr RetErrno retError(SemiErrno e) {
+    static  RetErrno retError(SemiErrno e) {
         return RetErrno((uint64_t)-1, e);
     }
 
-    static constexpr RetErrno retOK(uint64_t r) {
+    static  RetErrno retOK(uint64_t r) {
         return RetErrno(r, 0);
     }
 
@@ -342,11 +346,14 @@ class ArmSemihosting : public SimObject
 #undef SEMI_CALL
 
     static const SemiCall *getCall(uint32_t op, bool aarch64);
+    static FILE *getSTDIO(const char *stream_name,
+                          const std::string &name, const char *mode);
 
     static const std::map<uint32_t, SemiCall> calls;
     static const std::vector<const char *> fmodes;
     static const std::map<uint64_t, const char *> exitCodes;
     static const std::vector<uint8_t> features;
+    static const std::map<const std::string, FILE *> stdioMap;
 };
 
 #endif // __ARCH_ARM_SEMIHOSTING_HH__