diff options
author | Andreas Sandberg <Andreas.Sandberg@arm.com> | 2012-11-02 11:32:01 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@arm.com> | 2012-11-02 11:32:01 -0500 |
commit | b81a977e6ab7dbfd122cb778cfe3d40ca7451198 (patch) | |
tree | 09804c27367de8cf93623ec4644bf47abf316bf9 /src/dev/copy_engine.hh | |
parent | eb703a4b4e167e4d45f92203a1e0849f19cdba6d (diff) | |
download | gem5-b81a977e6ab7dbfd122cb778cfe3d40ca7451198.tar.xz |
sim: Move the draining interface into a separate base class
This patch moves the draining interface from SimObject to a separate
class that can be used by any object needing draining. However,
objects not visible to the Python code (i.e., objects not deriving
from SimObject) still depend on their parents informing them when to
drain. This patch also gets rid of the CountedDrainEvent (which isn't
really an event) and replaces it with a DrainManager.
Diffstat (limited to 'src/dev/copy_engine.hh')
-rw-r--r-- | src/dev/copy_engine.hh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/dev/copy_engine.hh b/src/dev/copy_engine.hh index 9a0cb0628..c4b07c79d 100644 --- a/src/dev/copy_engine.hh +++ b/src/dev/copy_engine.hh @@ -55,11 +55,12 @@ #include "dev/copy_engine_defs.hh" #include "dev/pcidev.hh" #include "params/CopyEngine.hh" +#include "sim/drain.hh" #include "sim/eventq.hh" class CopyEngine : public PciDev { - class CopyEngineChannel + class CopyEngineChannel : public Drainable { private: DmaPort cePort; @@ -91,7 +92,7 @@ class CopyEngine : public PciDev ChannelState nextState; - Event *drainEvent; + DrainManager *drainManager; public: CopyEngineChannel(CopyEngine *_ce, int cid); virtual ~CopyEngineChannel(); @@ -106,8 +107,9 @@ class CopyEngine : public PciDev void channelRead(PacketPtr pkt, Addr daddr, int size); void channelWrite(PacketPtr pkt, Addr daddr, int size); - unsigned int drain(Event *de); - void resume(); + unsigned int drain(DrainManager *drainManger); + void drainResume(); + void serialize(std::ostream &os); void unserialize(Checkpoint *cp, const std::string §ion); @@ -205,8 +207,9 @@ class CopyEngine : public PciDev virtual void serialize(std::ostream &os); virtual void unserialize(Checkpoint *cp, const std::string §ion); - virtual unsigned int drain(Event *de); - virtual void resume(); + + unsigned int drain(DrainManager *drainManger); + void drainResume(); }; #endif //__DEV_COPY_ENGINE_HH__ |