From fad123a16b260abbcdd4856ab08757a2881a8c1c Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 27 Oct 2022 15:21:31 -0700 Subject: [PATCH] target: Add TARGET_UNAVAILABLE state. (#752) This is added for future RISC-V changes. The RISC-V debug interface can explicitly tell a debugger when a hart is unavailable. This is used for instance when that hart is powered down (or yet to be powered up out of reset). Change-Id: I8a062d59eea1e5b3c788281a75159592db024683 Signed-off-by: Tim Newsome --- src/target/target.c | 1 + src/target/target.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/target/target.c b/src/target/target.c index 927329a64..30f2cf068 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -256,6 +256,7 @@ static const struct jim_nvp nvp_target_state[] = { { .name = "halted", .value = TARGET_HALTED }, { .name = "reset", .value = TARGET_RESET }, { .name = "debug-running", .value = TARGET_DEBUG_RUNNING }, + { .name = "unavailable", .value = TARGET_UNAVAILABLE }, { .name = NULL, .value = -1 }, }; diff --git a/src/target/target.h b/src/target/target.h index 726a14d3f..2166f7efc 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -56,6 +56,8 @@ struct gdb_fileio_info; * not sure how this is used with all the recent changes) * TARGET_DEBUG_RUNNING = 4: the target is running, but it is executing code on * behalf of the debugger (e.g. algorithm for flashing) + * TARGET_UNAVAILABLE = 5: The target is unavailable for some reason. It might + * be powered down, for instance. * * also see: target_state_name(); */ @@ -66,6 +68,7 @@ enum target_state { TARGET_HALTED = 2, TARGET_RESET = 3, TARGET_DEBUG_RUNNING = 4, + TARGET_UNAVAILABLE = 5 }; enum nvp_assert {