Fix build.

Change-Id: I89de7dc21d7958531ec9619905d3d8c4f54a3acf
This commit is contained in:
Tim Newsome 2023-03-16 18:08:25 -07:00
parent 868ebdd89c
commit 2cd3436002
3 changed files with 10 additions and 11 deletions

View File

@ -185,7 +185,7 @@ static const virt2phys_info_t sv48 = {
.pa_ppn_mask = {0x1ff, 0x1ff, 0x1ff, 0x1ffff}, .pa_ppn_mask = {0x1ff, 0x1ff, 0x1ff, 0x1ffff},
}; };
static enum riscv_halt_reason riscv_halt_reason(struct target *target, int hartid); static enum riscv_halt_reason riscv_halt_reason(struct target *target);
static void riscv_info_init(struct target *target, struct riscv_info *r); static void riscv_info_init(struct target *target, struct riscv_info *r);
static void riscv_invalidate_register_cache(struct target *target); static void riscv_invalidate_register_cache(struct target *target);
static int riscv_step_rtos_hart(struct target *target); static int riscv_step_rtos_hart(struct target *target);
@ -2474,18 +2474,18 @@ static int riscv_poll_hart(struct target *target, enum riscv_next_action *next_a
int retval; int retval;
/* Detect if this EBREAK is a semihosting request. If so, handle it. */ /* Detect if this EBREAK is a semihosting request. If so, handle it. */
switch (riscv_semihosting(target, &retval)) { switch (riscv_semihosting(target, &retval)) {
case SEMI_NONE: case SEMIHOSTING_NONE:
break; break;
case SEMI_WAITING: case SEMIHOSTING_WAITING:
/* This hart should remain halted. */ /* This hart should remain halted. */
*next_action = RPH_REMAIN_HALTED; *next_action = RPH_REMAIN_HALTED;
break; break;
case SEMI_HANDLED: case SEMIHOSTING_HANDLED:
/* This hart should be resumed, along with any other /* This hart should be resumed, along with any other
* harts that halted due to haltgroups. */ * harts that halted due to haltgroups. */
*next_action = RPH_RESUME; *next_action = RPH_RESUME;
return ERROR_OK; return ERROR_OK;
case SEMI_ERROR: case SEMIHOSTING_ERROR:
return retval; return retval;
} }
} }
@ -2603,7 +2603,7 @@ int riscv_openocd_poll(struct target *target)
struct target_list *entry; struct target_list *entry;
foreach_smp_target(entry, targets) { foreach_smp_target(entry, targets) {
struct target *t = entry->target; struct target *t = entry->target;
riscv_info_t *info = riscv_info(t); struct riscv_info *info = riscv_info(t);
/* Clear here just in case there were errors and we never got to /* Clear here just in case there were errors and we never got to
* check this flag further down. */ * check this flag further down. */
@ -2656,7 +2656,7 @@ int riscv_openocd_poll(struct target *target)
foreach_smp_target(entry, targets) foreach_smp_target(entry, targets)
{ {
struct target *t = entry->target; struct target *t = entry->target;
riscv_info_t *info = riscv_info(t); struct riscv_info *info = riscv_info(t);
if (info->halted_needs_event_callback) { if (info->halted_needs_event_callback) {
target_call_event_callbacks(t, info->halted_callback_event); target_call_event_callbacks(t, info->halted_callback_event);
info->halted_needs_event_callback = false; info->halted_needs_event_callback = false;
@ -4472,14 +4472,14 @@ int riscv_save_register(struct target *target, enum gdb_regno regid)
return ERROR_OK; return ERROR_OK;
} }
static int riscv_get_hart_state(struct target *target, enum riscv_hart_state *state) int riscv_get_hart_state(struct target *target, enum riscv_hart_state *state)
{ {
RISCV_INFO(r); RISCV_INFO(r);
assert(r->get_hart_state); assert(r->get_hart_state);
return r->get_hart_state(target, state); return r->get_hart_state(target, state);
} }
enum riscv_halt_reason riscv_halt_reason(struct target *target) static enum riscv_halt_reason riscv_halt_reason(struct target *target)
{ {
RISCV_INFO(r); RISCV_INFO(r);
if (target->state != TARGET_HALTED) { if (target->state != TARGET_HALTED) {

View File

@ -381,7 +381,6 @@ int riscv_flush_registers(struct target *target);
/* Checks the state of the current hart -- "is_halted" checks the actual /* Checks the state of the current hart -- "is_halted" checks the actual
* on-device register. */ * on-device register. */
int riscv_get_hart_state(struct target *target, enum riscv_hart_state *state); int riscv_get_hart_state(struct target *target, enum riscv_hart_state *state);
enum riscv_halt_reason riscv_halt_reason(struct target *target);
/* These helper functions let the generic program interface get target-specific /* These helper functions let the generic program interface get target-specific
* information. */ * information. */

View File

@ -144,7 +144,7 @@ enum semihosting_result riscv_semihosting(struct target *target, int *retval)
/* Resume right after the EBREAK 4 bytes instruction. */ /* Resume right after the EBREAK 4 bytes instruction. */
*retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4); *retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4);
if (*retval != ERROR_OK) if (*retval != ERROR_OK)
return SEMI_ERROR; return SEMIHOSTING_ERROR;
/* /*
* Resume target if we are not waiting on a fileio * Resume target if we are not waiting on a fileio