diff options
author | Tim Newsome <tim@sifive.com> | 2017-12-14 13:06:31 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-12-19 10:41:48 -0800 |
commit | f55d1a20305d6acf801db3aff024a8b4eed2acad (patch) | |
tree | 2ac9c90d51a676fb82918f1e7e40f508ddd66833 /src | |
parent | c7cddd2b5c4d78e72c617919f40dd2cc26ed1e91 (diff) | |
download | riscv-openocd-f55d1a20305d6acf801db3aff024a8b4eed2acad.zip riscv-openocd-f55d1a20305d6acf801db3aff024a8b4eed2acad.tar.gz riscv-openocd-f55d1a20305d6acf801db3aff024a8b4eed2acad.tar.bz2 |
Give FPRs ABI names.
Change-Id: If198d10e16671b9868836e23386aaf8d4b05f317
Diffstat (limited to 'src')
-rw-r--r-- | src/target/riscv/gdb_regs.h | 34 | ||||
-rw-r--r-- | src/target/riscv/riscv.c | 35 |
2 files changed, 67 insertions, 2 deletions
diff --git a/src/target/riscv/gdb_regs.h b/src/target/riscv/gdb_regs.h index 3f60d01..731f3e3 100644 --- a/src/target/riscv/gdb_regs.h +++ b/src/target/riscv/gdb_regs.h @@ -41,7 +41,39 @@ enum gdb_regno { GDB_REGNO_PC = 32, GDB_REGNO_FPR0 = 33, - GDB_REGNO_FPR31 = GDB_REGNO_FPR0 + 31, + GDB_REGNO_FT0 = GDB_REGNO_FPR0, + GDB_REGNO_FT1, + GDB_REGNO_FT2, + GDB_REGNO_FT3, + GDB_REGNO_FT4, + GDB_REGNO_FT5, + GDB_REGNO_FT6, + GDB_REGNO_FT7, + GDB_REGNO_FS0, + GDB_REGNO_FS1, + GDB_REGNO_FA0, + GDB_REGNO_FA1, + GDB_REGNO_FA2, + GDB_REGNO_FA3, + GDB_REGNO_FA4, + GDB_REGNO_FA5, + GDB_REGNO_FA6, + GDB_REGNO_FA7, + GDB_REGNO_FS2, + GDB_REGNO_FS3, + GDB_REGNO_FS4, + GDB_REGNO_FS5, + GDB_REGNO_FS6, + GDB_REGNO_FS7, + GDB_REGNO_FS8, + GDB_REGNO_FS9, + GDB_REGNO_FS10, + GDB_REGNO_FS11, + GDB_REGNO_FT8, + GDB_REGNO_FT9, + GDB_REGNO_FT10, + GDB_REGNO_FT11, + GDB_REGNO_FPR31 = GDB_REGNO_FT11, GDB_REGNO_CSR0 = 65, GDB_REGNO_TSELECT = CSR_TSELECT + GDB_REGNO_CSR0, GDB_REGNO_TDATA1 = CSR_TDATA1 + GDB_REGNO_CSR0, diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 8587621..6d41620 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1835,7 +1835,40 @@ int riscv_init_registers(struct target *target) } else { r->exist = false; } - sprintf(reg_name, "f%d", number - GDB_REGNO_FPR0); + switch (number) { + case GDB_REGNO_FT0: r->name = "ft0"; break; + case GDB_REGNO_FT1: r->name = "ft1"; break; + case GDB_REGNO_FT2: r->name = "ft2"; break; + case GDB_REGNO_FT3: r->name = "ft3"; break; + case GDB_REGNO_FT4: r->name = "ft4"; break; + case GDB_REGNO_FT5: r->name = "ft5"; break; + case GDB_REGNO_FT6: r->name = "ft6"; break; + case GDB_REGNO_FT7: r->name = "ft7"; break; + case GDB_REGNO_FS0: r->name = "fs0"; break; + case GDB_REGNO_FS1: r->name = "fs1"; break; + case GDB_REGNO_FA0: r->name = "fa0"; break; + case GDB_REGNO_FA1: r->name = "fa1"; break; + case GDB_REGNO_FA2: r->name = "fa2"; break; + case GDB_REGNO_FA3: r->name = "fa3"; break; + case GDB_REGNO_FA4: r->name = "fa4"; break; + case GDB_REGNO_FA5: r->name = "fa5"; break; + case GDB_REGNO_FA6: r->name = "fa6"; break; + case GDB_REGNO_FA7: r->name = "fa7"; break; + case GDB_REGNO_FS2: r->name = "fs2"; break; + case GDB_REGNO_FS3: r->name = "fs3"; break; + case GDB_REGNO_FS4: r->name = "fs4"; break; + case GDB_REGNO_FS5: r->name = "fs5"; break; + case GDB_REGNO_FS6: r->name = "fs6"; break; + case GDB_REGNO_FS7: r->name = "fs7"; break; + case GDB_REGNO_FS8: r->name = "fs8"; break; + case GDB_REGNO_FS9: r->name = "fs9"; break; + case GDB_REGNO_FS10: r->name = "fs10"; break; + case GDB_REGNO_FS11: r->name = "fs11"; break; + case GDB_REGNO_FT8: r->name = "ft8"; break; + case GDB_REGNO_FT9: r->name = "ft9"; break; + case GDB_REGNO_FT10: r->name = "ft10"; break; + case GDB_REGNO_FT11: r->name = "ft11"; break; + } r->group = "float"; r->feature = &feature_fpu; } else if (number >= GDB_REGNO_CSR0 && number <= GDB_REGNO_CSR4095) { |