aboutsummaryrefslogtreecommitdiff
path: root/riscv/htif.cc
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2012-03-24 12:54:03 -0700
committerAndrew Waterman <waterman@eecs.berkeley.edu>2012-03-24 12:54:03 -0700
commit01db50f070d576e433d2b93ad061a0d8239e7b0c (patch)
treecf9d70747c76b92512ed2d2213ab2091ba9462db /riscv/htif.cc
parentd8a587dedc38d6c1ec7e1f1348da5a4daf0b7f1e (diff)
downloadriscv-isa-sim-01db50f070d576e433d2b93ad061a0d8239e7b0c.zip
riscv-isa-sim-01db50f070d576e433d2b93ad061a0d8239e7b0c.tar.gz
riscv-isa-sim-01db50f070d576e433d2b93ad061a0d8239e7b0c.tar.bz2
new supervisor mode
Diffstat (limited to 'riscv/htif.cc')
-rw-r--r--riscv/htif.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/riscv/htif.cc b/riscv/htif.cc
index 9aa9a7c..8a9cd30 100644
--- a/riscv/htif.cc
+++ b/riscv/htif.cc
@@ -135,18 +135,18 @@ int htif_t::wait_for_packet()
sim->mmu->store_uint64((p.addr+i)*HTIF_DATA_ALIGN, p.data[i]);
break;
case APP_CMD_READ_CONTROL_REG:
- assert(p.addr == 16);
+ assert(p.addr == PCR_TOHOST);
assert(p.data_size == 1);
ackpacket.data_size = 1;
memcpy(ackpacket.data, &sim->tohost, sizeof(reg_t));
break;
case APP_CMD_WRITE_CONTROL_REG:
- assert(p.addr == 17 || p.addr == 15);
+ assert(p.addr == PCR_FROMHOST || p.addr == PCR_RESET);
assert(p.data_size == 1);
sim->tohost = 0;
- if (p.addr == 17)
+ if (p.addr == PCR_FROMHOST)
memcpy(&sim->fromhost, p.data, sizeof(reg_t));
- else if (p.addr == 15)
+ else if (p.addr == PCR_RESET)
{
bool next_reset = p.data[0] & 1;
if (!reset && next_reset)