source: rtems-schedsim/schedsim/shell/schedsim_smpsimple/main_dispatch.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: 1001 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
19#include <rtems.h>
20#include <rtems/score/percpu.h>
21#include <rtems/score/smp.h>
22#include <rtems/score/schedulersimplesmp.h>
23
24extern uint32_t Schedsim_Current_cpu;
25
26int main_dispatch(int argc, char **argv)
27{
28  uint32_t   cpu;
29  uint32_t   current_cpu;
30
31  current_cpu = Schedsim_Current_cpu;
32  for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) {
33    if ( _Per_CPU_Information[cpu].per_cpu.dispatch_necessary ) {
34      printf( "=== Invoke Thread Dispatch on CPU %d\n", cpu );
35       Schedsim_Current_cpu = cpu;
36      _Thread_Dispatch();
37    }
38  }
39
40  Schedsim_Current_cpu = current_cpu;
41  return 0;
42}
Note: See TracBrowser for help on using the repository browser.