io_device.hh (8598:c7fec2cb91cb) | io_device.hh (8630:05580a8506c7) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 116 unchanged lines hidden (view full) --- 125 126 /** Maximum time that device should back off for after failed sendTiming */ 127 Tick maxBackoffDelay; 128 129 /** If the port is currently waiting for a retry before it can send whatever 130 * it is that it's sending. */ 131 bool inRetry; 132 | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 116 unchanged lines hidden (view full) --- 125 126 /** Maximum time that device should back off for after failed sendTiming */ 127 Tick maxBackoffDelay; 128 129 /** If the port is currently waiting for a retry before it can send whatever 130 * it is that it's sending. */ 131 bool inRetry; 132 |
133 /** Port accesses a cache which requires snooping */ 134 bool recvSnoops; 135 136 /** Records snoop response so we only reply once to a status change */ 137 bool snoopRangeSent; 138 |
|
133 virtual bool recvTiming(PacketPtr pkt); 134 virtual Tick recvAtomic(PacketPtr pkt) | 139 virtual bool recvTiming(PacketPtr pkt); 140 virtual Tick recvAtomic(PacketPtr pkt) |
135 { panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN } | 141 { 142 if (recvSnoops) return 0; 143 144 panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN 145 } |
136 virtual void recvFunctional(PacketPtr pkt) | 146 virtual void recvFunctional(PacketPtr pkt) |
137 { panic("dma port shouldn't be used for pio access."); } | 147 { 148 if (recvSnoops) return; |
138 | 149 |
150 panic("dma port shouldn't be used for pio access."); 151 } 152 |
|
139 virtual void recvStatusChange(Status status) | 153 virtual void recvStatusChange(Status status) |
140 { ; } | 154 { 155 if (recvSnoops) { 156 if (status == RangeChange) { 157 if (!snoopRangeSent) { 158 snoopRangeSent = true; 159 sendStatusChange(Port::RangeChange); 160 } 161 return; 162 } 163 panic("Unexpected recvStatusChange\n"); 164 } 165 } |
141 142 virtual void recvRetry() ; 143 144 virtual void getDeviceAddressRanges(AddrRangeList &resp, 145 bool &snoop) | 166 167 virtual void recvRetry() ; 168 169 virtual void getDeviceAddressRanges(AddrRangeList &resp, 170 bool &snoop) |
146 { resp.clear(); snoop = false; } | 171 { resp.clear(); snoop = recvSnoops; } |
147 148 void queueDma(PacketPtr pkt, bool front = false); 149 void sendDma(); 150 151 /** event to give us a kick every time we backoff time is reached. */ 152 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent; 153 154 public: | 172 173 void queueDma(PacketPtr pkt, bool front = false); 174 void sendDma(); 175 176 /** event to give us a kick every time we backoff time is reached. */ 177 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent; 178 179 public: |
155 DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff); | 180 DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff, 181 bool recv_snoops = false); |
156 157 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, 158 uint8_t *data, Tick delay, Request::Flags flag = 0); 159 160 bool dmaPending() { return pendingCount > 0; } 161 162 unsigned cacheBlockSize() const { return peerBlockSize(); } 163 unsigned int drain(Event *de); --- 128 unchanged lines hidden --- | 182 183 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, 184 uint8_t *data, Tick delay, Request::Flags flag = 0); 185 186 bool dmaPending() { return pendingCount > 0; } 187 188 unsigned cacheBlockSize() const { return peerBlockSize(); } 189 unsigned int drain(Event *de); --- 128 unchanged lines hidden --- |