gdb_server, target: Add target_address_bits()

Targets can use this to expose how many address bits there are.
gdb_server uses this to send gdb the appropriate upper limit in the
memory-map. (Before this change the upper limit would only be correct
for 32-bit targets.)

Change-Id: Idb0933255ed53951fcfb05e040674bcdf19441e1
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4947
Tested-by: jenkins
Reviewed-by: Peter Mamonov <pmamonov@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Tim Newsome
2019-02-25 14:02:30 -08:00
committed by Matthias Welwarsky
parent 85ba2dc4c6
commit 57e30102ea
5 changed files with 43 additions and 6 deletions

View File

@@ -1560,6 +1560,11 @@ const struct command_registration riscv_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
unsigned riscv_address_bits(struct target *target)
{
return riscv_xlen(target);
}
struct target_type riscv_target = {
.name = "riscv",
@@ -1594,7 +1599,9 @@ struct target_type riscv_target = {
.run_algorithm = riscv_run_algorithm,
.commands = riscv_command_handlers
.commands = riscv_command_handlers,
.address_bits = riscv_address_bits
};
/*** RISC-V Interface ***/