source: rtems-schedsim/schedsim/shell/schedsim_smpsimple/smp_stub.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.4 KB
Line 
1/*
2 *  RTEMS SMP Support for Single Core
3 *
4 *  COPYRIGHT (c) 1989-2013.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#include <rtems.h>
13#include <rtems/bspIo.h>
14#include <stdlib.h>
15
16uint32_t Schedsim_Current_cpu;
17extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line;
18
19uint32_t _CPU_SMP_Initialize( void )
20{
21  /* return the number of CPUs */
22  return Schedsim_Maximum_CPUs_From_Command_Line;
23}
24
25bool _CPU_SMP_Start_processor( uint32_t cpu_index )
26{
27  return true;
28}
29
30void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
31{
32}
33
34void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
35{
36}
37
38void _CPU_SMP_Processor_event_broadcast( void )
39{
40  Per_CPU_Control  *cpu = _Per_CPU_Get();
41  uint32_t         cpu_count = _SMP_Get_processor_count();
42  uint32_t         cpu_index;
43  Per_CPU_State    state = cpu->state;
44
45  if (state == PER_CPU_STATE_REQUEST_START_MULTITASKING) {
46    for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
47      cpu = _Per_CPU_Get_by_index( cpu_index );
48      state = cpu->state;
49      if (state == PER_CPU_STATE_INITIAL )
50         cpu->state = PER_CPU_STATE_READY_TO_START_MULTITASKING;
51    }
52  }
53}
54
55
56void _CPU_SMP_Processor_event_receive( void )
57{
58}
59
60uint32_t _CPU_SMP_Get_current_processor( void )
61{
62  return Schedsim_Current_cpu;
63}
Note: See TracBrowser for help on using the repository browser.