diff --git a/devices/common/nvram.cpp b/devices/common/nvram.cpp
index 751e733..648adbb 100644
--- a/devices/common/nvram.cpp
+++ b/devices/common/nvram.cpp
@@ -21,6 +21,7 @@ along with this program. If not, see .
#include
#include
+#include
#include
#include
@@ -93,3 +94,9 @@ void NVram::save() {
f.close();
}
+
+static const DeviceDescription Nvram_Descriptor = {
+ NVram::create, {}, {}
+};
+
+REGISTER_DEVICE(NVRAM, Nvram_Descriptor);
diff --git a/devices/common/nvram.h b/devices/common/nvram.h
index 8f9f60f..d3e19bd 100644
--- a/devices/common/nvram.h
+++ b/devices/common/nvram.h
@@ -25,6 +25,7 @@ along with this program. If not, see .
#include
#include
+#include
#include
/** @file Non-volatile RAM emulation.
@@ -38,6 +39,10 @@ public:
NVram(std::string file_name = "nvram.bin", uint32_t ram_size = 8192);
~NVram();
+ static std::unique_ptr create() {
+ return std::unique_ptr(new NVram());
+ }
+
uint8_t read_byte(uint32_t offset);
void write_byte(uint32_t offset, uint8_t value);