This is an automated email from Gerrit.

Christian Gudrian ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/2352

-- gerrit

commit 43f793b66c189bd02d70b38fdcbba2929b6efce9
Author: Christian Gudrian <[email protected]>
Date:   Tue Oct 21 22:23:40 2014 +0200

    Added support for ChibiOS/RT 3.0
    
    In ChibiOS/RT 3.0 the ready list pointer "rlist" is now part of the system
    data structure. Since the ready list is the first element in that
    structure it can be accessed via the structure's symbol "ch".
    
    Change-Id: Idc7eaa87cb7bbad0afa0ff1dafd54283bf429766
    Signed-off-by: Christian Gudrian <[email protected]>

diff --git a/src/rtos/ChibiOS.c b/src/rtos/ChibiOS.c
index 46fdca3..e656f15 100644
--- a/src/rtos/ChibiOS.c
+++ b/src/rtos/ChibiOS.c
@@ -110,6 +110,7 @@ static int ChibiOS_create(struct target *target);
 static int ChibiOS_update_threads(struct rtos *rtos);
 static int ChibiOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, 
char **hex_reg_list);
 static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t 
*symbol_list[]);
+static int ChibiOS3_get_symbol_list_to_lookup(symbol_table_elem_t 
*symbol_list[]);
 
 struct rtos_type ChibiOS_rtos = {
        .name = "ChibiOS",
@@ -121,6 +122,16 @@ struct rtos_type ChibiOS_rtos = {
        .get_symbol_list_to_lookup = ChibiOS_get_symbol_list_to_lookup,
 };
 
+struct rtos_type ChibiOS3_rtos = {
+       .name = "ChibiOS3",
+
+       .detect_rtos = ChibiOS_detect_rtos,
+       .create = ChibiOS_create,
+       .update_threads = ChibiOS_update_threads,
+       .get_thread_reg_list = ChibiOS_get_thread_reg_list,
+       .get_symbol_list_to_lookup = ChibiOS3_get_symbol_list_to_lookup,
+};
+
 enum ChibiOS_symbol_values {
        ChibiOS_VAL_rlist = 0,
        ChibiOS_VAL_ch_debug = 1,
@@ -134,6 +145,13 @@ static const char * const ChibiOS_symbol_list[] = {
        NULL
 };
 
+static const char * const ChibiOS3_symbol_list[] = {
+       "ch",                   /* System data structure */
+       "ch_debug",             /* Memory Signature containing offsets of 
fields in system data structure */
+       "chSysInit",    /* Necessary part of API, used for ChibiOS detection */
+       NULL
+};
+
 static int ChibiOS_update_memory_signature(struct rtos *rtos)
 {
        int retval;
@@ -494,18 +512,35 @@ static int ChibiOS_get_thread_reg_list(struct rtos *rtos, 
int64_t thread_id, cha
        return rtos_generic_stack_read(rtos->target, param->stacking_info, 
stack_ptr, hex_reg_list);
 }
 
-static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t 
*symbol_list[])
+static int ChibiOS_generic_get_symbol_list_to_lookup(const char * const 
symbols[],
+       size_t size, symbol_table_elem_t *symbol_list[])
 {
        unsigned int i;
        *symbol_list = malloc(
-                       sizeof(symbol_table_elem_t) * 
ARRAY_SIZE(ChibiOS_symbol_list));
+                       sizeof(symbol_table_elem_t) * size);
 
-       for (i = 0; i < ARRAY_SIZE(ChibiOS_symbol_list); i++)
-               (*symbol_list)[i].symbol_name = ChibiOS_symbol_list[i];
+       for (i = 0; i < size; i++)
+               (*symbol_list)[i].symbol_name = symbols[i];
 
        return 0;
 }
 
+static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t 
*symbol_list[])
+{
+       return ChibiOS_generic_get_symbol_list_to_lookup(
+                       ChibiOS_symbol_list,
+                       ARRAY_SIZE(ChibiOS_symbol_list),
+                       symbol_list);
+}
+
+static int ChibiOS3_get_symbol_list_to_lookup(symbol_table_elem_t 
*symbol_list[])
+{
+       return ChibiOS_generic_get_symbol_list_to_lookup(
+                       ChibiOS3_symbol_list,
+                       ARRAY_SIZE(ChibiOS3_symbol_list),
+                       symbol_list);
+}
+
 static int ChibiOS_detect_rtos(struct target *target)
 {
        if ((target->rtos->symbols != NULL) &&
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 735c106..4bcf5c5 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -34,6 +34,7 @@ extern struct rtos_type ThreadX_rtos;
 extern struct rtos_type eCos_rtos;
 extern struct rtos_type Linux_os;
 extern struct rtos_type ChibiOS_rtos;
+extern struct rtos_type ChibiOS3_rtos;
 extern struct rtos_type embKernel_rtos;
 
 static struct rtos_type *rtos_types[] = {
@@ -42,6 +43,7 @@ static struct rtos_type *rtos_types[] = {
        &eCos_rtos,
        &Linux_os,
        &ChibiOS_rtos,
+       &ChibiOS3_rtos,
        &embKernel_rtos,
        NULL
 };

-- 

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to