#include "debug_rom/debug_rom.h"
+#if 1
+# define D(x) x
+#else
+# define D(x)
+#endif
+
bool debug_module_t::load(reg_t addr, size_t len, uint8_t* bytes)
{
addr = DEBUG_START + addr;
return true;
}
- fprintf(stderr, "ERROR: invalid load from debug module: %ld bytes at 0x%016"
+ fprintf(stderr, "ERROR: invalid load from debug module: %zd bytes at 0x%016"
PRIx64 "\n", len, addr);
return false;
}
addr = DEBUG_START + addr;
if (addr & (len-1)) {
- fprintf(stderr, "ERROR: unaligned store to debug module: %ld bytes at 0x%016"
+ fprintf(stderr, "ERROR: unaligned store to debug module: %zd bytes at 0x%016"
PRIx64 "\n", len, addr);
return false;
}
return true;
}
- fprintf(stderr, "ERROR: invalid store to debug module: %ld bytes at 0x%016"
+ fprintf(stderr, "ERROR: invalid store to debug module: %zd bytes at 0x%016"
PRIx64 "\n", len, addr);
return false;
}
(((uint32_t) base[3]) << 24);
return value;
}
+
+uint32_t debug_module_t::dmi_read(unsigned address)
+{
+ D(fprintf(stderr, "dmi_read(0x%x)\n", address));
+ return 0xfeed;
+}
+
+void debug_module_t::dmi_write(unsigned address, uint32_t value)
+{
+ D(fprintf(stderr, "dmi_write(0x%x, 0x%x)\n", address, value));
+}