cpu: Add support for CMOs in the cpu models
[gem5.git] / src / cpu / simple / atomic.hh
index c643bfe581961678a7e578a2e301621f248714a8..c9dd954bb098c669f955c063376ae7b90ddbf9fa 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "cpu/simple/base.hh"
 #include "cpu/simple/exec_context.hh"
+#include "mem/request.hh"
 #include "params/AtomicSimpleCPU.hh"
 #include "sim/probe/probe.hh"
 
@@ -59,16 +60,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU
 
   private:
 
-    struct TickEvent : public Event
-    {
-        AtomicSimpleCPU *cpu;
-
-        TickEvent(AtomicSimpleCPU *c);
-        void process();
-        const char *description() const;
-    };
-
-    TickEvent tickEvent;
+    EventFunctionWrapper tickEvent;
 
     const int width;
     bool locked;
@@ -127,7 +119,6 @@ class AtomicSimpleCPU : public BaseSimpleCPU
         { }
 
       protected:
-        virtual Tick recvAtomicSnoop(PacketPtr pkt) { return 0; }
 
         bool recvTimingResp(PacketPtr pkt)
         {
@@ -203,12 +194,13 @@ class AtomicSimpleCPU : public BaseSimpleCPU
     void suspendContext(ThreadID thread_num) override;
 
     Fault readMem(Addr addr, uint8_t *data, unsigned size,
-                  unsigned flags) override;
+                  Request::Flags flags) override;
 
-    Fault initiateMemRead(Addr addr, unsigned size, unsigned flags) override;
+    Fault initiateMemRead(Addr addr, unsigned size,
+                          Request::Flags flags) override;
 
     Fault writeMem(uint8_t *data, unsigned size,
-                   Addr addr, unsigned flags, uint64_t *res) override;
+                   Addr addr, Request::Flags flags, uint64_t *res) override;
 
     void regProbePoints() override;