Skip to content

Commit

Permalink
target/riscv_semihosting: Make the unknown operation number an error
Browse files Browse the repository at this point in the history
Previously, an unknown semihosting operation number
was logged as debug. This patch changes it and few
other places to be logged as error instead.

Change-Id: I83cae5ca1e3daed440f92b08bd372bfffbbad63c
Signed-off-by: Marek Vrbka <[email protected]>
  • Loading branch information
MarekVCodasip committed Sep 7, 2023
1 parent 699eeca commit 1936dbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/target/riscv/riscv_semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ enum semihosting_result riscv_semihosting(struct target *target, int *retval)

result = riscv_get_register(target, &r0, GDB_REGNO_A0);
if (result != ERROR_OK) {
LOG_TARGET_DEBUG(target, " -> ERROR (couldn't read a0)");
LOG_TARGET_ERROR(target, "Could not read semihosting operation code (register a0)");
return SEMIHOSTING_ERROR;
}

result = riscv_get_register(target, &r1, GDB_REGNO_A1);
if (result != ERROR_OK) {
LOG_TARGET_DEBUG(target, " -> ERROR (couldn't read a1)");
LOG_TARGET_ERROR(target, "Could not read semihosting operation code (register a1)");
return SEMIHOSTING_ERROR;
}

Expand All @@ -134,7 +134,7 @@ enum semihosting_result riscv_semihosting(struct target *target, int *retval)
}
} else {
/* Unknown operation number, not a semihosting call. */
LOG_TARGET_DEBUG(target, " -> NONE (unknown operation number)");
LOG_TARGET_ERROR(target, "Unknown semihosting operation requested (op = 0x%x)", semihosting->op);
return SEMIHOSTING_NONE;
}
}
Expand Down

0 comments on commit 1936dbd

Please sign in to comment.