diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2014-05-09 08:35:58 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2014-05-09 08:37:18 -0500 |
commit | 2d51251192aac8527e773c98047d8597a7f02b8a (patch) | |
tree | f0098e58a37b434d4e8fcecc550e3b810da41379 /schedsim/shell/schedsim_smpsimple/smp_stub.c | |
parent | schedsim_priority: Remove scenario output files. (diff) | |
download | rtems-schedsim-2d51251192aac8527e773c98047d8597a7f02b8a.tar.bz2 |
schedsim: Add smp support.
Diffstat (limited to 'schedsim/shell/schedsim_smpsimple/smp_stub.c')
-rw-r--r-- | schedsim/shell/schedsim_smpsimple/smp_stub.c | 62 |
1 files changed, 26 insertions, 36 deletions
diff --git a/schedsim/shell/schedsim_smpsimple/smp_stub.c b/schedsim/shell/schedsim_smpsimple/smp_stub.c index fc9c1dd..7f8f2d4 100644 --- a/schedsim/shell/schedsim_smpsimple/smp_stub.c +++ b/schedsim/shell/schedsim_smpsimple/smp_stub.c @@ -11,25 +11,12 @@ #include <rtems.h> #include <rtems/bspIo.h> -#include <rtems/bspsmp.h> #include <stdlib.h> uint32_t Schedsim_Current_cpu; extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line; -void bsp_smp_secondary_cpu_initialize(int cpu) -{ - Schedsim_Current_cpu = 0; -} - -int bsp_smp_processor_id(void) -{ - return Schedsim_Current_cpu; -} - -uint32_t bsp_smp_initialize( - uint32_t configured_cpu_count -) +uint32_t _CPU_SMP_Initialize( void ) { if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) { printf( @@ -43,39 +30,42 @@ uint32_t bsp_smp_initialize( return Schedsim_Maximum_CPUs_From_Command_Line; } -void bsp_smp_broadcast_interrupt(void) +bool _CPU_SMP_Start_processor( uint32_t cpu_index ) { + return true; } -void bsp_smp_broadcast_message( - uint32_t message -) +void _CPU_SMP_Finalize_initialization( uint32_t cpu_count ) { } -void bsp_smp_interrupt_cpu( - int cpu -) +void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ) { -} +} -void bsp_smp_delay( int max ) +void _CPU_SMP_Processor_event_broadcast( void ) { + Per_CPU_Control *cpu = _Per_CPU_Get(); + uint32_t cpu_count = _SMP_Get_processor_count(); + uint32_t cpu_index; + Per_CPU_State state = cpu->state; + + if (state == PER_CPU_STATE_REQUEST_START_MULTITASKING) { + for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { + cpu = _Per_CPU_Get_by_index( cpu_index ); + state = cpu->state; + if (state == PER_CPU_STATE_INITIAL ) + cpu->state = PER_CPU_STATE_READY_TO_START_MULTITASKING; + } + } } -void bsp_smp_wait_for( - volatile unsigned int *address, - unsigned int desired, - int maximum_usecs -) -{ - int iterations; - volatile int i; - volatile unsigned int *p = address; - for (iterations=0 ; iterations < maximum_usecs ; iterations++ ) { - *p = desired; - /* XXX hack to make simulator happy */ - } +void _CPU_SMP_Processor_event_receive( void ) +{ } +uint32_t _CPU_SMP_Get_current_processor( void ) +{ + return Schedsim_Current_cpu; +} |