mem: Fix guest corruption when caches handle uncacheable accesses
[gem5.git] / src / mem / noncoherent_bus.hh
index 8bd6c0e74df1213a3d2e1548a7bfb650f701991e..a42c26b2e989ca1082aca335f9d5fb0d636df39c 100644 (file)
@@ -72,6 +72,13 @@ class NoncoherentBus : public BaseBus
 
   protected:
 
+    /**
+     * Declare the two layers of this bus, one for requests and one
+     * for responses.
+     */
+    Layer<SlavePort> reqLayer;
+    Layer<MasterPort> respLayer;
+
     /**
      * Declaration of the non-coherent bus slave port type, one will
      * be instantiated for each of the master ports connecting to the
@@ -120,14 +127,14 @@ class NoncoherentBus : public BaseBus
         /**
          * Return the union of all adress ranges seen by this bus.
          */
-        virtual AddrRangeList getAddrRanges()
+        virtual AddrRangeList getAddrRanges() const
         { return bus.getAddrRanges(); }
 
         /**
          * Get the maximum block size as seen by the bus.
          */
         virtual unsigned deviceBlockSize() const
-        { return bus.findBlockSize(); }
+        { return bus.deviceBlockSize(); }
 
     };
 
@@ -172,17 +179,21 @@ class NoncoherentBus : public BaseBus
          * Get the maximum block size as seen by the bus.
          */
         virtual unsigned deviceBlockSize() const
-        { return bus.findBlockSize(); }
+        { return bus.deviceBlockSize(); }
 
     };
 
     /** Function called by the port when the bus is recieving a Timing
       request packet.*/
-    bool recvTimingReq(PacketPtr pkt, PortID slave_port_id);
+    virtual bool recvTimingReq(PacketPtr pkt, PortID slave_port_id);
 
     /** Function called by the port when the bus is recieving a Timing
       response packet.*/
-    bool recvTimingResp(PacketPtr pkt, PortID master_port_id);
+    virtual bool recvTimingResp(PacketPtr pkt, PortID master_port_id);
+
+    /** Timing function called by port when it is once again able to process
+     * requests. */
+    void recvRetry();
 
     /** Function called by the port when the bus is recieving a Atomic
       transaction.*/
@@ -196,6 +207,8 @@ class NoncoherentBus : public BaseBus
 
     NoncoherentBus(const NoncoherentBusParams *p);
 
+    unsigned int drain(DrainManager *dm);
+
 };
 
 #endif //__MEM_NONCOHERENT_BUS_HH__