std::string generateDisassembly(
Addr pc, const SymbolTable *symtab) const override;
};
+
+/**
+ * A generic atomic op class
+ */
+
+template<typename T>
+class AtomicGeneric2Op : public TypedAtomicOpFunctor<T>
+{
+ public:
+ AtomicGeneric2Op(T _a, std::function<void(T*,T)> _op)
+ : a(_a), op(_op)
+ {}
+ AtomicOpFunctor* clone() override
+ {
+ return new AtomicGeneric2Op<T>(*this);
+ }
+ void execute(T *b) override
+ {
+ op(b, a);
+ }
+ private:
+ T a;
+ std::function<void(T*,T)> op;
+ };
+
+template<typename T>
+class AtomicGeneric3Op : public TypedAtomicOpFunctor<T>
+{
+ public:
+ AtomicGeneric3Op(T _a, T _c, std::function<void(T*, T, T)> _op)
+ : a(_a), c(_c), op(_op)
+ {}
+ AtomicOpFunctor* clone() override
+ {
+ return new AtomicGeneric3Op<T>(*this);
+ }
+ void execute(T *b) override
+ {
+ op(b, a, c);
+ }
+ private:
+ T a;
+ T c;
+ std::function<void(T*, T, T)> op;
+};
+
}
#endif //__ARCH_ARM_INSTS_MEM_HH__