source: rtems-schedsim/schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c @ 726b27c

Last change on this file since 726b27c was 726b27c, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 13, 2013 at 5:01:48 PM

schedsim: Update to latest RTEMS. Works Uniprocessor

  • Property mode set to 100644
File size: 1006 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#include <newlib/getopt.h>
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14#include <ctype.h>
15
16#include "shell.h"
17#include "rtems_sched.h"
18#include <rtems/score/chainimpl.h>
19#include <rtems/score/thread.h>
20
21#include <rtems/score/schedulerpriority.h>
22
23int main_dump_ready_tasks(int argc, char **argv)
24{
25  Chain_Control  *chain;
26  Chain_Node     *n;
27  Thread_Control *t;
28
29  printf( "=== Ready Set of Threads\n" );
30  chain = (Chain_Control *)_Scheduler.information;
31  for (n = _Chain_First( chain ); !_Chain_Is_tail(chain, n); n = n->next) {
32    t = (Thread_Control *)n;
33    printf(
34      "  0x%08x priority=%ld\n",
35      t->Object.id,
36      (long) t->current_priority
37    );
38  }
39  printf( "=== End of Ready Set of Threads\n" );
40 
41  return 0;
42}
Note: See TracBrowser for help on using the repository browser.