summaryrefslogtreecommitdiff
path: root/src/dev/io_device.hh
diff options
context:
space:
mode:
authorMitchell Hayenga <Mitchell.Hayenga@ARM.com>2011-12-01 00:15:22 -0800
committerMitchell Hayenga <Mitchell.Hayenga@ARM.com>2011-12-01 00:15:22 -0800
commitfa753c14549a768f0b8475e4e183acbdc394c248 (patch)
treeb1a47e7423b7d5c7a085ea64c7ba9fe74038e83b /src/dev/io_device.hh
parent946f7f0f55215d0eefe29fed2e4c123e23b9848f (diff)
downloadgem5-fa753c14549a768f0b8475e4e183acbdc394c248.tar.xz
Device: Make changes necessary to support a coherent page walker cache.
Adds the flag 'recvSnoops' which enables pagewalkers using DmaPorts, to properly configure snoops. --HG-- extra : rebase_source : 64207bef62c3268ddff2236ee4adae873812325f
Diffstat (limited to 'src/dev/io_device.hh')
-rw-r--r--src/dev/io_device.hh36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh
index 812c276d6..36787c13e 100644
--- a/src/dev/io_device.hh
+++ b/src/dev/io_device.hh
@@ -130,20 +130,45 @@ class DmaPort : public Port
* it is that it's sending. */
bool inRetry;
+ /** Port accesses a cache which requires snooping */
+ bool recvSnoops;
+
+ /** Records snoop response so we only reply once to a status change */
+ bool snoopRangeSent;
+
virtual bool recvTiming(PacketPtr pkt);
virtual Tick recvAtomic(PacketPtr pkt)
- { panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN }
+ {
+ if (recvSnoops) return 0;
+
+ panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN
+ }
virtual void recvFunctional(PacketPtr pkt)
- { panic("dma port shouldn't be used for pio access."); }
+ {
+ if (recvSnoops) return;
+
+ panic("dma port shouldn't be used for pio access.");
+ }
virtual void recvStatusChange(Status status)
- { ; }
+ {
+ if (recvSnoops) {
+ if (status == RangeChange) {
+ if (!snoopRangeSent) {
+ snoopRangeSent = true;
+ sendStatusChange(Port::RangeChange);
+ }
+ return;
+ }
+ panic("Unexpected recvStatusChange\n");
+ }
+ }
virtual void recvRetry() ;
virtual void getDeviceAddressRanges(AddrRangeList &resp,
bool &snoop)
- { resp.clear(); snoop = false; }
+ { resp.clear(); snoop = recvSnoops; }
void queueDma(PacketPtr pkt, bool front = false);
void sendDma();
@@ -152,7 +177,8 @@ class DmaPort : public Port
EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
public:
- DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff);
+ DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff,
+ bool recv_snoops = false);
void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
uint8_t *data, Tick delay, Request::Flags flag = 0);