summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-09 15:06:50 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-09 15:06:50 -0500
commit30aa7922046a5a3474af640f7de613be5d806f96 (patch)
treee03df19f0a16c192f95f429a8f5dfe216d79ad6c
parentsched_cpu: add is_executing to context. (diff)
downloadrtems-schedsim-30aa7922046a5a3474af640f7de613be5d806f96.tar.bz2
Now appears to run again
-rw-r--r--schedsim/rtems/rtems_init.c7
-rw-r--r--schedsim/shell/schedsim_priority/wrap_thread_dispatch.c16
-rw-r--r--schedsim/shell/schedsim_smpsimple/wrap_thread_dispatch.c26
3 files changed, 34 insertions, 15 deletions
diff --git a/schedsim/rtems/rtems_init.c b/schedsim/rtems/rtems_init.c
index 8df4681..dee1654 100644
--- a/schedsim/rtems/rtems_init.c
+++ b/schedsim/rtems/rtems_init.c
@@ -64,6 +64,8 @@ void rtems_initialize_data_structures(void)
{
_System_state_Handler_initialization( FALSE );
+ _CPU_Initialize();
+
/*
* Do this as early as possible to ensure no debugging output
* is even attempted to be printed.
@@ -164,7 +166,10 @@ void rtems_initialize_data_structures(void)
cpu_self->thread_dispatch_disable_level = 0;
_Profiling_Thread_dispatch_enable( cpu_self, 0 );
- _Per_CPU_Release( cpu_self );
+ /* For whatever reason, we haven't locked our per cpu yet in the
+ * Scheduler Simulator. Until this is done, this release is not needed.
+ */
+ /* _Per_CPU_Release( cpu_self ); */
level = _Thread_Executing->Start.isr_level;
_ISR_Set_level( level);
diff --git a/schedsim/shell/schedsim_priority/wrap_thread_dispatch.c b/schedsim/shell/schedsim_priority/wrap_thread_dispatch.c
index 5a72bcb..60ce916 100644
--- a/schedsim/shell/schedsim_priority/wrap_thread_dispatch.c
+++ b/schedsim/shell/schedsim_priority/wrap_thread_dispatch.c
@@ -30,14 +30,18 @@ void Init__wrap__Thread_Dispatch()
void check_heir_and_executing(void)
{
- if ( last_heir != _Thread_Heir )
- PRINT_HEIR();
+ uint32_t level;
- if ( last_executing != _Thread_Executing )
- PRINT_EXECUTING();
+ _ISR_Disable_without_giant( level );
+ if ( last_heir != _Thread_Heir )
+ PRINT_HEIR();
- last_heir = _Thread_Heir;
- last_executing = _Thread_Executing;
+ if ( last_executing != _Thread_Executing )
+ PRINT_EXECUTING();
+
+ last_heir = _Thread_Heir;
+ last_executing = _Thread_Executing;
+ _ISR_Enable_without_giant( level );
}
void __wrap__Thread_Dispatch(void)
diff --git a/schedsim/shell/schedsim_smpsimple/wrap_thread_dispatch.c b/schedsim/shell/schedsim_smpsimple/wrap_thread_dispatch.c
index 0edefd1..98506c8 100644
--- a/schedsim/shell/schedsim_smpsimple/wrap_thread_dispatch.c
+++ b/schedsim/shell/schedsim_smpsimple/wrap_thread_dispatch.c
@@ -26,20 +26,30 @@ extern void __real__Thread_Dispatch(void);
void Init__wrap__Thread_Dispatch()
{
- last_heir = (Thread_Control_ptr *) calloc( sizeof( Thread_Control_ptr ), _SMP_Processor_count );
- last_executing = (Thread_Control_ptr *) calloc( sizeof( Thread_Control_ptr ), _SMP_Processor_count );
+ last_heir = (Thread_Control_ptr *) calloc(
+ sizeof( Thread_Control_ptr ),
+ _SMP_Processor_count
+ );
+ last_executing = (Thread_Control_ptr *) calloc(
+ sizeof( Thread_Control_ptr ),
+ _SMP_Processor_count
+ );
}
void check_heir_and_executing(void)
{
- if ( last_heir[Schedsim_Current_cpu] != _Thread_Heir )
- PRINT_HEIR();
+ uint32_t level;
- if ( last_executing[Schedsim_Current_cpu] != _Thread_Executing )
- PRINT_EXECUTING();
+ _ISR_Disable_without_giant( level );
+ if ( last_heir[Schedsim_Current_cpu] != _Thread_Heir )
+ PRINT_HEIR();
- last_heir[Schedsim_Current_cpu] = _Thread_Heir;
- last_executing[Schedsim_Current_cpu] = _Thread_Executing;
+ if ( last_executing[Schedsim_Current_cpu] != _Thread_Executing )
+ PRINT_EXECUTING();
+
+ last_heir[Schedsim_Current_cpu] = _Thread_Heir;
+ last_executing[Schedsim_Current_cpu] = _Thread_Executing;
+ _ISR_Enable_without_giant( level );
}
void __wrap__Thread_Dispatch(void)