semihosting: move semihosting_result_t from riscv.h to the semihosting_common.h
These enum values are useful for the arch level semihosting call handlers. Currently riscv uses them, we also need similar return codes for the xtensa. Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I8f63749cc203c59b07862f33edf3c393cd7e33a9 Reviewed-on: https://review.openocd.org/c/openocd/+/7039 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Antonio Borneo
parent
6eda28ef67
commit
06c3240155
@@ -2209,17 +2209,17 @@ int riscv_openocd_poll(struct target *target)
|
||||
if (halt_reason == RISCV_HALT_BREAKPOINT) {
|
||||
int retval;
|
||||
switch (riscv_semihosting(t, &retval)) {
|
||||
case SEMI_NONE:
|
||||
case SEMI_WAITING:
|
||||
case SEMIHOSTING_NONE:
|
||||
case SEMIHOSTING_WAITING:
|
||||
/* This hart should remain halted. */
|
||||
should_remain_halted++;
|
||||
break;
|
||||
case SEMI_HANDLED:
|
||||
case SEMIHOSTING_HANDLED:
|
||||
/* This hart should be resumed, along with any other
|
||||
* harts that halted due to haltgroups. */
|
||||
should_resume++;
|
||||
break;
|
||||
case SEMI_ERROR:
|
||||
case SEMIHOSTING_ERROR:
|
||||
return retval;
|
||||
}
|
||||
} else if (halt_reason != RISCV_HALT_GROUP) {
|
||||
@@ -2280,15 +2280,15 @@ int riscv_openocd_poll(struct target *target)
|
||||
if (target->debug_reason == DBG_REASON_BREAKPOINT) {
|
||||
int retval;
|
||||
switch (riscv_semihosting(target, &retval)) {
|
||||
case SEMI_NONE:
|
||||
case SEMI_WAITING:
|
||||
case SEMIHOSTING_NONE:
|
||||
case SEMIHOSTING_WAITING:
|
||||
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
|
||||
break;
|
||||
case SEMI_HANDLED:
|
||||
case SEMIHOSTING_HANDLED:
|
||||
if (riscv_resume(target, true, 0, 0, 0, false) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
break;
|
||||
case SEMI_ERROR:
|
||||
case SEMIHOSTING_ERROR:
|
||||
return retval;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user