Fix up some register stuff.

Now you can attach with gdb, and it'll attempt to read a register. That
will fail because the core won't clear debug interrupt. Adding nops
doesn't help this time.
This commit is contained in:
Tim Newsome
2016-06-03 21:02:08 -07:00
parent f634702aaf
commit 84944ded87
2 changed files with 160 additions and 44 deletions
+4 -4
View File
@@ -113,6 +113,10 @@ static uint32_t addi(unsigned int dest, unsigned int src, uint16_t imm)
MATCH_ADDI;
}
static uint32_t csrr(unsigned int rd, unsigned int csr) {
return (csr << 20) | (rd << 7) | MATCH_CSRRS;
}
/*
static uint32_t li(unsigned int dest, uint16_t imm)
{
@@ -126,10 +130,6 @@ static uint32_t lui(unsigned int dest, uint32_t imm)
MATCH_LUI;
}
static uint32_t csrr(unsigned int rd, unsigned int csr) {
return (csr << 20) | (rd << 7) | MATCH_CSRRS;
}
static uint32_t fence_i(void)
{
return MATCH_FENCE_I;