Changeset 2d51251 in rtems-schedsim for schedsim/shell/schedsim_smpsimple/smp_stub.c


Ignore:
Timestamp:
May 9, 2014, 1:35:58 PM (6 years ago)
Author:
Jennifer Averett <jennifer.averett@…>
Branches:
master
Children:
b1b31c0
Parents:
0745eed
git-author:
Jennifer Averett <jennifer.averett@…> (05/09/14 13:35:58)
git-committer:
Jennifer Averett <jennifer.averett@…> (05/09/14 13:37:18)
Message:

schedsim: Add smp support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedsim/shell/schedsim_smpsimple/smp_stub.c

    r0745eed r2d51251  
    1212#include <rtems.h>
    1313#include <rtems/bspIo.h>
    14 #include <rtems/bspsmp.h>
    1514#include <stdlib.h>
    1615
     
    1817extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line;
    1918
    20 void bsp_smp_secondary_cpu_initialize(int cpu)
    21 {
    22   Schedsim_Current_cpu = 0;
    23 }
    24 
    25 int bsp_smp_processor_id(void)
    26 {
    27   return Schedsim_Current_cpu;
    28 }
    29 
    30 uint32_t bsp_smp_initialize(
    31   uint32_t configured_cpu_count
    32 )
     19uint32_t _CPU_SMP_Initialize( void )
    3320{
    3421  if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) {
     
    4431}
    4532
    46 void bsp_smp_broadcast_interrupt(void)
     33bool _CPU_SMP_Start_processor( uint32_t cpu_index )
     34{
     35  return true;
     36}
     37
     38void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
    4739{
    4840}
    4941
    50 void bsp_smp_broadcast_message(
    51   uint32_t  message
    52 )
     42void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
     43{
     44}
     45
     46void _CPU_SMP_Processor_event_broadcast( void )
     47{
     48  Per_CPU_Control  *cpu = _Per_CPU_Get();
     49  uint32_t         cpu_count = _SMP_Get_processor_count();
     50  uint32_t         cpu_index;
     51  Per_CPU_State    state = cpu->state;
     52
     53  if (state == PER_CPU_STATE_REQUEST_START_MULTITASKING) {
     54    for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     55      cpu = _Per_CPU_Get_by_index( cpu_index );
     56      state = cpu->state;
     57      if (state == PER_CPU_STATE_INITIAL )
     58         cpu->state = PER_CPU_STATE_READY_TO_START_MULTITASKING;
     59    }
     60  }
     61}
     62
     63
     64void _CPU_SMP_Processor_event_receive( void )
    5365{
    5466}
    5567
    56 void bsp_smp_interrupt_cpu(
    57   int cpu
    58 )
     68uint32_t _CPU_SMP_Get_current_processor( void )
    5969{
     70  return Schedsim_Current_cpu;
    6071}
    61 
    62 void bsp_smp_delay( int max )
    63 {
    64 }
    65 
    66 void bsp_smp_wait_for(
    67   volatile unsigned int *address,
    68   unsigned int           desired,
    69   int                    maximum_usecs
    70 )
    71 {
    72   int iterations;
    73   volatile int i;
    74   volatile unsigned int *p = address;
    75 
    76   for (iterations=0 ;  iterations < maximum_usecs ; iterations++ ) {
    77     *p = desired;
    78     /* XXX hack to make simulator happy */
    79   }
    80 }
    81 
Note: See TracChangeset for help on using the changeset viewer.