enumeration of threads for testing purposes.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 9 Oct 2008 12:05:57 +0000 (12:05 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 9 Oct 2008 12:05:57 +0000 (12:05 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1035 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/ecosboard.c

index 7a8c6cb22da04423c40a11f8caa3ae897d72541e..e39e8e6cf364deab3c8c6187d51f2e6d70bd5386 100644 (file)
@@ -934,6 +934,72 @@ zylinjtag_Jim_Command_rm(Jim_Interp *interp,
        return del ? JIM_OK : JIM_ERR;
 }
 
+static int zylinjtag_Jim_Command_threads(Jim_Interp *interp, int argc,
+               Jim_Obj * const *argv)
+{
+       cyg_handle_t thread = 0;
+       cyg_uint16 id = 0;
+       Jim_Obj *threads = Jim_NewListObj(interp, NULL, 0);
+
+       /* Loop over the threads, and generate a table row for
+        * each.
+        */
+       while (cyg_thread_get_next(&thread, &id))
+       {
+               Jim_Obj *threadObj = Jim_NewListObj(interp, NULL, 0);
+
+               cyg_thread_info info;
+               char *state_string;
+
+               cyg_thread_get_info(thread, id, &info);
+
+               if (info.name == NULL)
+                       info.name = "<no name>";
+
+               Jim_ListAppendElement(interp, threadObj, Jim_NewStringObj(interp,
+                               info.name, strlen(info.name)));
+
+               /* Translate the state into a string.
+                */
+               if (info.state == 0)
+                       state_string = "RUN";
+               else if (info.state & 0x04)
+                       state_string = "SUSP";
+               else
+                       switch (info.state & 0x1b)
+                       {
+                       case 0x01:
+                               state_string = "SLEEP";
+                               break;
+                       case 0x02:
+                               state_string = "CNTSLEEP";
+                               break;
+                       case 0x08:
+                               state_string = "CREATE";
+                               break;
+                       case 0x10:
+                               state_string = "EXIT";
+                               break;
+                       default:
+                               state_string = "????";
+                               break;
+                       }
+
+               Jim_ListAppendElement(interp, threadObj, Jim_NewStringObj(interp,
+                               state_string, strlen(state_string)));
+
+               Jim_ListAppendElement   (interp, threadObj, Jim_NewIntObj(interp, id));
+               Jim_ListAppendElement(interp, threadObj, Jim_NewIntObj(interp, info.set_pri));
+               Jim_ListAppendElement(interp, threadObj, Jim_NewIntObj(interp, info.cur_pri));
+
+               Jim_ListAppendElement(interp, threads, threadObj);
+       }
+       Jim_SetResult( interp, threads);
+
+       return JIM_OK;
+}
+
+
 static int
 zylinjtag_Jim_Command_ls(Jim_Interp *interp,
                                    int argc,
@@ -1245,6 +1311,7 @@ static void zylinjtag_startNetwork()
     Jim_CreateCommand(httpstate.jim_interp, "zy1000_flash", zylinjtag_Jim_Command_flash, NULL, NULL);
     Jim_CreateCommand(httpstate.jim_interp, "poke", zylinjtag_Jim_Command_poke, NULL, NULL);
     Jim_CreateCommand(httpstate.jim_interp, "ls", zylinjtag_Jim_Command_ls, NULL, NULL);
+    Jim_CreateCommand(httpstate.jim_interp, "threads", zylinjtag_Jim_Command_threads, NULL, NULL);
     Jim_CreateCommand(httpstate.jim_interp, "getmem", zylinjtag_Jim_Command_getmem, NULL, NULL);
     Jim_CreateCommand(httpstate.jim_interp, "mac", zylinjtag_Jim_Command_mac, NULL, NULL);
     Jim_CreateCommand(httpstate.jim_interp, "ip", zylinjtag_Jim_Command_ip, NULL, NULL);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)