mem: Fix guest corruption when caches handle uncacheable accesses
[gem5.git] / src / mem / noncoherent_bus.hh
index 7227d3bc6ca626f8e46620ee27723a9edad2f8a2..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,7 +179,7 @@ class NoncoherentBus : public BaseBus
          * Get the maximum block size as seen by the bus.
          */
         virtual unsigned deviceBlockSize() const
-        { return bus.findBlockSize(); }
+        { return bus.deviceBlockSize(); }
 
     };
 
@@ -184,6 +191,10 @@ class NoncoherentBus : public BaseBus
       response packet.*/
     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.*/
     Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
@@ -196,6 +207,8 @@ class NoncoherentBus : public BaseBus
 
     NoncoherentBus(const NoncoherentBusParams *p);
 
+    unsigned int drain(DrainManager *dm);
+
 };
 
 #endif //__MEM_NONCOHERENT_BUS_HH__