[rtems-schedsim commit] Now appears to run again

Joel Sherrill joel at rtems.org
Fri May 9 19:58:48 UTC 2014


Module:    rtems-schedsim
Branch:    master
Commit:    30aa7922046a5a3474af640f7de613be5d806f96
Changeset: http://git.rtems.org/rtems-schedsim/commit/?id=30aa7922046a5a3474af640f7de613be5d806f96

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Fri May  9 15:06:50 2014 -0500

Now appears to run again

---

 schedsim/rtems/rtems_init.c                        |    7 ++++-
 .../shell/schedsim_priority/wrap_thread_dispatch.c |   16 +++++++----
 .../schedsim_smpsimple/wrap_thread_dispatch.c      |   26 +++++++++++++------
 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)




More information about the vc mailing list