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

Last change on this file since b38dbcc was b38dbcc, checked in by Joel Sherrill <joel.sherrill@…>, on May 14, 2014 at 2:55:21 PM

Many files: rm white space at EOL and EOF

  • Property mode set to 100644
File size: 1.2 KB
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#include <rtems/score/assert.h>
21
22/*
23 * Note: This source depends upon the scheduler being
24 *       tested.
25 */
26#include <rtems/score/schedulersimplesmp.h>
27
28int main_dump_ready_tasks(int argc, char **argv)
29{
30  Chain_Control  *chain;
31  Chain_Node     *n;
32  Thread_Control *t;
33
34  Scheduler_simple_SMP_Context * self =
35    (Scheduler_simple_SMP_Context *) _Scheduler_Table[0].context;
36
37  /* We don't support this yet */
38  _Assert( _Scheduler_Count != 1 );
39
40  printf( "=== Ready Set of Threads\n" );
41  chain = &self->Ready;
42  for (n = _Chain_First( chain ); !_Chain_Is_tail(chain, n); n = n->next) {
43    t = (Thread_Control *)n;
44    printf(
45      "  0x%08x priority=%ld\n",
46      t->Object.id,
47      (long) t->current_priority
48    );
49  }
50  printf( "=== End of Ready Set of Threads\n" );
51
52  return 0;
53}
Note: See TracBrowser for help on using the repository browser.