riscv/semihosting: Fix ebreak skip on fileio mode
This patch fixes skipping the semihosting sequence if the fileio mode is enabled on riscv. This change was tested by me and is in the riscv-openocd fork for a year now. Original merge request: https://github.com/riscv/riscv-openocd/pull/699 Original author: Wu Zhigang zhigang.wu@starfivetech.com https://github.com/wzgpeter Change-Id: Iadaa0a48d1f82d3a7ca168f8a6b656ff6ab78e03 Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7729 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
parent
63f4e7c72a
commit
eebcf3cff1
|
@ -141,16 +141,16 @@ enum semihosting_result riscv_semihosting(struct target *target, int *retval)
|
|||
}
|
||||
}
|
||||
|
||||
/* Resume right after the EBREAK 4 bytes instruction. */
|
||||
*retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4);
|
||||
if (*retval != ERROR_OK)
|
||||
return SEMIHOSTING_ERROR;
|
||||
|
||||
/*
|
||||
* Resume target if we are not waiting on a fileio
|
||||
* operation to complete.
|
||||
*/
|
||||
if (semihosting->is_resumable && !semihosting->hit_fileio) {
|
||||
/* Resume right after the EBREAK 4 bytes instruction. */
|
||||
*retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4);
|
||||
if (*retval != ERROR_OK)
|
||||
return SEMIHOSTING_ERROR;
|
||||
|
||||
LOG_DEBUG(" -> HANDLED");
|
||||
return SEMIHOSTING_HANDLED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue