target/riscv: use struct riscv_info instead of typedef riscv_info_t

Make the main RISC-V structure more compliant with OpenOCD coding style.
Other typedefs remains as is.

Change-Id: I5657ad28fea8108fd66ab27b2dfe1c868dc5805b
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/6998
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
Tomas Vanek
2022-05-26 13:08:48 +02:00
parent 2c6571b9b1
commit 82e76262a1
4 changed files with 35 additions and 27 deletions

View File

@@ -227,10 +227,10 @@ static int get_register(struct target *target, riscv_reg_t *value, int regid);
static riscv011_info_t *get_info(const struct target *target)
{
riscv_info_t *info = (riscv_info_t *) target->arch_info;
struct riscv_info *info = target->arch_info;
assert(info);
assert(info->version_specific);
return (riscv011_info_t *) info->version_specific;
return info->version_specific;
}
static unsigned int slot_offset(const struct target *target, slot_t slot)
@@ -1408,7 +1408,10 @@ static int halt(struct target *target)
static void deinit_target(struct target *target)
{
LOG_DEBUG("riscv_deinit_target()");
riscv_info_t *info = (riscv_info_t *) target->arch_info;
struct riscv_info *info = target->arch_info;
if (!info)
return;
free(info->version_specific);
info->version_specific = NULL;
}
@@ -1549,7 +1552,7 @@ static int examine(struct target *target)
uint32_t word0 = cache_get32(target, 0);
uint32_t word1 = cache_get32(target, 1);
riscv_info_t *generic_info = (riscv_info_t *) target->arch_info;
struct riscv_info *generic_info = riscv_info(target);
if (word0 == 1 && word1 == 0) {
generic_info->xlen = 32;
} else if (word0 == 0xffffffff && word1 == 3) {