aboutsummaryrefslogtreecommitdiff
path: root/fesvr/htif.cc
diff options
context:
space:
mode:
authorMarcus Comstedt <marcus@mc.pp.se>2020-10-17 13:40:01 +0200
committerMarcus Comstedt <marcus@mc.pp.se>2020-11-07 15:34:19 +0100
commit8e3bcb2eef7f195a9cd61f5b79c1e67a0c3c28ff (patch)
tree191a89f0adab760eddfd0cf4a3e6ee11fbfd1b0f /fesvr/htif.cc
parentec2fd09fdbb7b7b490cacdc3818ca237f9f28593 (diff)
downloadspike-8e3bcb2eef7f195a9cd61f5b79c1e67a0c3c28ff.zip
spike-8e3bcb2eef7f195a9cd61f5b79c1e67a0c3c28ff.tar.gz
spike-8e3bcb2eef7f195a9cd61f5b79c1e67a0c3c28ff.tar.bz2
Tag target endian values to help guide conversion code
Diffstat (limited to 'fesvr/htif.cc')
-rw-r--r--fesvr/htif.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/fesvr/htif.cc b/fesvr/htif.cc
index 996e321..4f34cec 100644
--- a/fesvr/htif.cc
+++ b/fesvr/htif.cc
@@ -217,7 +217,7 @@ int htif_t::run()
while (!signal_exit && exitcode == 0)
{
if (auto tohost = from_target(mem.read_uint64(tohost_addr))) {
- mem.write_uint64(tohost_addr, 0);
+ mem.write_uint64(tohost_addr, target_endian<uint64_t>::zero);
command_t cmd(mem, tohost, fromhost_callback);
device_list.handle_command(cmd);
} else {
@@ -226,7 +226,7 @@ int htif_t::run()
device_list.tick();
- if (!fromhost_queue.empty() && mem.read_uint64(fromhost_addr) == 0) {
+ if (!fromhost_queue.empty() && !mem.read_uint64(fromhost_addr)) {
mem.write_uint64(fromhost_addr, to_target(fromhost_queue.front()));
fromhost_queue.pop();
}