diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-12-13 11:01:48 -0600 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-04-28 11:33:52 -0500 |
commit | 726b27c5bf4b2f4200953950b985b6e0fb7ce20f (patch) | |
tree | 6ae666752f68e3171dd8966bcca4431629369ba0 /schedsim/shell/schedsim_smpsimple | |
parent | .configure.swp: Junk file removed from git (diff) | |
download | rtems-schedsim-726b27c5bf4b2f4200953950b985b6e0fb7ce20f.tar.bz2 |
schedsim: Update to latest RTEMS. Works Uniprocessor
Diffstat (limited to 'schedsim/shell/schedsim_smpsimple')
4 files changed, 20 insertions, 10 deletions
diff --git a/schedsim/shell/schedsim_smpsimple/main_dispatch.c b/schedsim/shell/schedsim_smpsimple/main_dispatch.c index 5f13da6..4c1461f 100644 --- a/schedsim/shell/schedsim_smpsimple/main_dispatch.c +++ b/schedsim/shell/schedsim_smpsimple/main_dispatch.c @@ -31,7 +31,7 @@ int main_dispatch(int argc, char **argv) current_cpu = Schedsim_Current_cpu; for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) { - if ( _Per_CPU_Information[cpu].dispatch_necessary ) { + if ( _Per_CPU_Information[cpu].per_cpu.dispatch_necessary ) { printf( "=== Invoke Thread Dispatch on CPU %d\n", cpu ); Schedsim_Current_cpu = cpu; _Thread_Dispatch(); diff --git a/schedsim/shell/schedsim_smpsimple/main_dump_all_cpus.c b/schedsim/shell/schedsim_smpsimple/main_dump_all_cpus.c index 7e19065..faa4de7 100644 --- a/schedsim/shell/schedsim_smpsimple/main_dump_all_cpus.c +++ b/schedsim/shell/schedsim_smpsimple/main_dump_all_cpus.c @@ -36,16 +36,15 @@ int main_dump_all_cpus(int argc, char **argv) " SWITCH NEEDED\n" ); for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) { - e = _Per_CPU_Information[cpu].executing; - h = _Per_CPU_Information[cpu].heir; - i = _Per_CPU_Information[cpu].idle; + e = _Per_CPU_Information[cpu].per_cpu.executing; + h = _Per_CPU_Information[cpu].per_cpu.heir; printf( - " CPU %d: 0x%08x @%3ld / 0x%08x @%3ld / 0x%08x @%3ld %s\n", + " CPU %d: 0x%08x @%3ld / 0x%08x @%3ld %s\n", cpu, e->Object.id, (long) e->current_priority, h->Object.id, (long) h->current_priority, - i->Object.id, (long) i->current_priority, - ((_Per_CPU_Information[cpu].dispatch_necessary) ? "true" : "false") + ((_Per_CPU_Information[cpu].per_cpu.dispatch_necessary) ? + "true" : "false") ); } printf( "=== End of Ready Set of Threads\n" ); diff --git a/schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c b/schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c index 2ee875b..ba9a9cd 100644 --- a/schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c +++ b/schedsim/shell/schedsim_smpsimple/main_dump_ready_tasks.c @@ -15,6 +15,8 @@ #include "shell.h" #include "rtems_sched.h" +#include <rtems/score/chainimpl.h> +#include <rtems/score/thread.h> #include <rtems/score/schedulerpriority.h> diff --git a/schedsim/shell/schedsim_smpsimple/smp_stub.c b/schedsim/shell/schedsim_smpsimple/smp_stub.c index 581f4ac..fc9c1dd 100644 --- a/schedsim/shell/schedsim_smpsimple/smp_stub.c +++ b/schedsim/shell/schedsim_smpsimple/smp_stub.c @@ -15,6 +15,7 @@ #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) { @@ -26,12 +27,20 @@ int bsp_smp_processor_id(void) return Schedsim_Current_cpu; } -int bsp_smp_initialize( - int maximum +uint32_t bsp_smp_initialize( + uint32_t configured_cpu_count ) { + if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) { + printf( + "ERROR - Maximum cores per confdefs.h is %d\n", + configured_cpu_count + ); + exit( 1 ); + } + /* return the number of CPUs */ - return maximum; + return Schedsim_Maximum_CPUs_From_Command_Line; } void bsp_smp_broadcast_interrupt(void) |