aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
diff options
context:
space:
mode:
authorMichel JAOUEN <michel.jaouen@stericsson.com>2012-01-03 16:12:50 +0100
committerØyvind Harboe <oyvindharboe@gmail.com>2012-01-15 22:11:48 +0000
commitebac7c963a76ba20b4e66b0525d12127295cdccb (patch)
tree4fe778793f145ff8e54469c8470e2dbd45c4b35e /src/rtos
parentff3028ce1baec2522059108331846d3fd320b846 (diff)
downloadriscv-openocd-ebac7c963a76ba20b4e66b0525d12127295cdccb.zip
riscv-openocd-ebac7c963a76ba20b4e66b0525d12127295cdccb.tar.gz
riscv-openocd-ebac7c963a76ba20b4e66b0525d12127295cdccb.tar.bz2
rtos : smp support
Change-Id: I583cddf5e62ed77f108786a085569ab8699ad50d Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/344 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src/rtos')
-rw-r--r--src/rtos/rtos.c16
-rw-r--r--src/rtos/rtos.h3
2 files changed, 15 insertions, 4 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 78a7e9d..8150257 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -49,6 +49,13 @@ static struct rtos_type *rtos_types[] =
int rtos_thread_packet(struct connection *connection, char *packet, int packet_size);
+int rtos_smp_init(struct target *target)
+{
+ if (target->rtos->type->smp_init)
+ return target->rtos->type->smp_init(target);
+ return ERROR_TARGET_INIT_FAILED;
+}
+
int rtos_create(Jim_GetOptInfo *goi, struct target * target)
{
@@ -437,10 +444,11 @@ int rtos_get_gdb_reg_list(struct connection *connection)
{
struct target *target = get_target_from_connection(connection);
int64_t current_threadid = target->rtos->current_threadid;
- if ( ( target->rtos != NULL ) &&
- ( current_threadid != -1 ) &&
- ( current_threadid != 0 ) &&
- ( current_threadid != target->rtos->current_thread ) )
+ if ((target->rtos != NULL) &&
+ (current_threadid != -1) &&
+ (current_threadid != 0) &&
+ ((current_threadid != target->rtos->current_thread) ||
+ (target->smp))) /* in smp several current thread are possible */
{
char * hex_reg_list;
target->rtos->type->get_thread_reg_list( target->rtos, current_threadid, &hex_reg_list );
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index df0812f..890a99e 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -75,9 +75,11 @@ struct rtos_type
char * name;
int (*detect_rtos) ( struct target* target );
int (*create) ( struct target* target );
+ int (*smp_init)(struct target *target);
int (*update_threads) ( struct rtos* rtos );
int (*get_thread_reg_list) ( struct rtos *rtos, int64_t thread_id, char ** hex_reg_list );
int (*get_symbol_list_to_lookup) (symbol_table_elem_t * symbol_list[] );
+ int (*clean)(struct target *target);
};
@@ -105,5 +107,6 @@ int rtos_try_next( struct target * target );
int gdb_thread_packet(struct connection *connection, char *packet, int packet_size);
int rtos_get_gdb_reg_list(struct connection *connection);
int rtos_update_threads( struct target *target );
+int rtos_smp_init(struct target *target);
#endif // RTOS_H