diff options
Diffstat (limited to 'src/rtos/rtos.c')
-rw-r--r-- | src/rtos/rtos.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 9032f81..eb48ab8 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -535,6 +535,21 @@ int rtos_get_gdb_reg_list(struct connection *connection) return ERROR_FAIL; } +int rtos_set_reg(struct connection *connection, int reg_num, + uint8_t *reg_value) +{ + struct target *target = get_target_from_connection(connection); + int64_t current_threadid = target->rtos->current_threadid; + LOG_DEBUG(">>> reg_num=%d", reg_num); + if ((target->rtos != NULL) && + (target->rtos->type->set_reg != NULL) && + (current_threadid != -1) && + (current_threadid != 0)) { + return target->rtos->type->set_reg(target->rtos, reg_num, reg_value); + } + return ERROR_FAIL; +} + int rtos_generic_stack_read(struct target *target, const struct rtos_register_stacking *stacking, int64_t stack_ptr, |