For the debug purposes I need to make a list of all threads in the system. In previous versions I used this code:
Code: Select all
thread_t *ctp;
/* Scanning registry.*/
ctp = ch.rlist.newer;
do {
/* Exclude IDLE THREAD from list */
if (ctp->hdr.pqueue.prio != IDLEPRIO) {
/* Fill elements with current task information */
Info.TaskID = (uint32_t) ctp;
Info.sName = ctp->name;
Info.Prio = ctp->hdr.pqueue.prio;
Info.StackBase = (uint32_t) ctp->wabase;
Info.StackSize = (uint32_t) 0;
}
/* search next thread */
sts = chSysGetStatusAndLockX();
ctp = ctp->newer;
if (ctp == (thread_t *)&ch.rlist) {
ctp = NULL;
}
chSysRestoreStatusX(sts);
} while (ctp != NULL);
Now it does not compiling because all structures was changed.
Please help to make this.