source: rtems-schedsim/schedsim/shell/schedsim_smpsimple/main_dispatch.c @ a2aad55

Last change on this file since a2aad55 was a2aad55, checked in by Joel Sherrill <joel.sherrill@…>, on 05/01/13 at 00:41:56

Remove CVS $

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