Configs: Add support for the InOrder CPU model
[gem5.git] / src / mem / translating_port.hh
index 7611ac3c7d2ff003cc2896577d01e819ab21bea8..76c7947be9be809f34cdf48bc876e2f161488793 100644 (file)
@@ -24,6 +24,9 @@
  * THEORY OF LIABILITY, WHETHER IN 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: Ron Dreslinski
+ *          Ali Saidi
  */
 
 #ifndef __MEM_TRANSLATING_PROT_HH__
 #include "mem/port.hh"
 
 class PageTable;
+class Process;
 
 class TranslatingPort : public FunctionalPort
 {
+  public:
+    enum AllocType {
+        Always,
+        Never,
+        NextPage
+    };
+
   private:
     PageTable *pTable;
-    bool allocating;
-
-    TranslatingPort(const TranslatingPort &specmem);
-    const TranslatingPort &operator=(const TranslatingPort &specmem);
+    Process *process;
+    AllocType allocating;
 
   public:
-    TranslatingPort(PageTable *p_table, bool alloc = false);
+    TranslatingPort(const std::string &_name,
+                    Process *p, AllocType alloc);
     virtual ~TranslatingPort();
 
-  public:
     bool tryReadBlob(Addr addr, uint8_t *p, int size);
     bool tryWriteBlob(Addr addr, uint8_t *p, int size);
     bool tryMemsetBlob(Addr addr, uint8_t val, int size);
@@ -56,9 +65,9 @@ class TranslatingPort : public FunctionalPort
     virtual void readBlob(Addr addr, uint8_t *p, int size);
     virtual void writeBlob(Addr addr, uint8_t *p, int size);
     virtual void memsetBlob(Addr addr, uint8_t val, int size);
+
     void writeString(Addr addr, const char *str);
     void readString(std::string &str, Addr addr);
-
 };
 
 #endif