* * *
mem: support for gpu-style RMWs in ruby
This patch adds support for GPU-style read-modify-write (RMW) operations in
ruby. Such atomic operations are traditionally executed at the memory controller
(instead of through an L1 cache using cache-line locking).
Currently, this patch works by propogating operation functors through the memory
system.
diff --git a/src/base/types.hh b/src/base/types.hh
index bc5c715..7b11590 100644
--- a/src/base/types.hh
+++ b/src/base/types.hh
@@ -200,6 +200,19 @@
constexpr decltype(nullptr) NoFault = nullptr;
#endif
+struct AtomicOpFunctor
+{
+ virtual void operator()(uint8_t *p) = 0;
+ virtual ~AtomicOpFunctor() {}
+};
+
+template <class T>
+struct TypedAtomicOpFunctor : public AtomicOpFunctor
+{
+ void operator()(uint8_t *p) { execute((T *)p); }
+ virtual void execute(T * p) = 0;
+};
+
enum ByteOrder {
BigEndianByteOrder,
LittleEndianByteOrder