Add target_data_bits().

This is used to compute memory block read alignment, and specifically
allows 64-bit targets to ensure that memory block reads are only
requested on 64-bit boundaries.

Signed-off-by: Tim Newsome <tim@sifive.com>
Change-Id: Idb1a27b9fc02c46245556bb0f3d6d94b368c4817
Reviewed-on: http://openocd.zylin.com/6249
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Tim Newsome
2021-05-13 16:38:51 -07:00
committed by Antonio Borneo
parent 6ae38ef7f7
commit 358ab3483d
4 changed files with 38 additions and 4 deletions

View File

@@ -2813,6 +2813,14 @@ static unsigned riscv_xlen_nonconst(struct target *target)
return riscv_xlen(target);
}
static unsigned int riscv_data_bits(struct target *target)
{
RISCV_INFO(r);
if (r->data_bits)
return r->data_bits(target);
return riscv_xlen(target);
}
struct target_type riscv_target = {
.name = "riscv",
@@ -2857,6 +2865,7 @@ struct target_type riscv_target = {
.commands = riscv_command_handlers,
.address_bits = riscv_xlen_nonconst,
.data_bits = riscv_data_bits
};
/*** RISC-V Interface ***/