From d184cd4dbfb1c863ae9f1e7c4c263ac626706351 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Sun, 21 Jul 2019 16:08:37 -0600 Subject: Implement MMIO device plugins. --- riscv/devices.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'riscv/devices.h') diff --git a/riscv/devices.h b/riscv/devices.h index 4e4d27f..aa4c050 100644 --- a/riscv/devices.h +++ b/riscv/devices.h @@ -2,6 +2,7 @@ #define _RISCV_DEVICES_H #include "decode.h" +#include "mmio_plugin.h" #include #include #include @@ -76,4 +77,17 @@ class clint_t : public abstract_device_t { std::vector mtimecmp; }; +class mmio_plugin_device_t : public abstract_device_t { + public: + mmio_plugin_device_t(const std::string& name, const std::string& args); + virtual ~mmio_plugin_device_t() override; + + virtual bool load(reg_t addr, size_t len, uint8_t* bytes) override; + virtual bool store(reg_t addr, size_t len, const uint8_t* bytes) override; + + private: + mmio_plugin_t plugin; + void* user_data; +}; + #endif -- cgit v1.1