diff options
author | Aaron Jones <aaron@vexing.codes> | 2019-07-21 16:08:37 -0600 |
---|---|---|
committer | Aaron Jones <aaron@vexing.codes> | 2019-07-22 11:34:33 -0600 |
commit | d184cd4dbfb1c863ae9f1e7c4c263ac626706351 (patch) | |
tree | d919b85827e8e3dfd957ff817286177ad7f59555 /riscv/devices.h | |
parent | 88a852836acb4c7166b1aa4102e11354bfd99234 (diff) | |
download | spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.zip spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.tar.gz spike-d184cd4dbfb1c863ae9f1e7c4c263ac626706351.tar.bz2 |
Implement MMIO device plugins.
Diffstat (limited to 'riscv/devices.h')
-rw-r--r-- | riscv/devices.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <cstdlib> #include <string> #include <map> @@ -76,4 +77,17 @@ class clint_t : public abstract_device_t { std::vector<mtimecmp_t> 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 |