Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -20,8 +20,8 @@
 ==> 9: 
 ==> 10: # GOAL: 0x0a010001 is now heir and executing on CPU 0
-==> 11: cpus
+==> 11: cpus TA1
 === CPU Status
           EXECUTING      /   HEIR             / SWITCH NEEDED
   CPU 0: 0x0a010001 @  3 / 0x0a010001 @  3          false
 === End of Ready Set of Threads
-==> 12: 
+*** ERROR in scenario -- unknown task TA1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus1_exercise_affinity_api.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -9,4 +9,3 @@
 
 # GOAL: 0x0a010001 is now heir and executing on CPU 0
-cpus
-
+cpus TA1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -2,27 +2,20 @@
 verbose                   : 1
 ==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 2
+==> 2: # Force Cores such that the first created task
+==> 3: # is on CPU 0 and the second is on CPU 1. 
+==> 4: #
+==> 5: rtems_init 2
   CPU 0: Thread Heir 0x09010001 priority=255
   CPU 0: Thread Executing 0x09010001 priority=255
   CPU 1: Thread Heir 0x09010002 priority=255
   CPU 1: Thread Executing 0x09010002 priority=255
-==> 5: task_create smp1 3 
+==> 6: task_create smp1 3 -a 1 
 Creating task with:  Preemption: yes Timeslicing: no
 Task (smp1) created: id=0x0a010001, priority=3
+Task (0x0a010001) Set affinity=0x00000001
 Task (smp1) starting: id=0x0a010001, priority=3
-  CPU 1: Thread Heir 0x0a010001 priority=3
-  CPU 1: Thread Executing 0x0a010001 priority=3
-==> 6: # GOAL: 0x09010001, 0x0a010001
-==> 7: # GOAL:   on CPUs 0-1 respectively
-==> 8: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
-  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
-=== End of Ready Set of Threads
-==> 9: 
-==> 10: task_create smp2 2 -a 2
+  CPU 0: Thread Heir 0x0a010001 priority=3
+  CPU 0: Thread Executing 0x0a010001 priority=3
+==> 7: task_create smp2 2 -a 2
 Creating task with:  Preemption: yes Timeslicing: no
 Task (smp2) created: id=0x0a010002, priority=2
@@ -31,17 +24,8 @@
   CPU 1: Thread Heir 0x0a010002 priority=2
   CPU 1: Thread Executing 0x0a010002 priority=2
-==> 11: # GOAL: want 0x09010001, 0x0a010002 as heir and executings
-==> 12: # GOAL:   on CPUs 0 -1 respectively
-==> 13: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
-  CPU 1: 0x0a010002 @  2 / 0x0a010002 @  2          false
-=== End of Ready Set of Threads
-==> 14: 
-==> 15: dispatch
-==> 16: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
-==> 17: # GOAL:   on CPUs 0 -1 respectively
-==> 18: cpus
+==> 8: 
+==> 9: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+==> 10: # GOAL:   on CPUs 0 -1 respectively
+==> 11: cpus smp1 smp2
 === CPU Status
           EXECUTING      /   HEIR             / SWITCH NEEDED
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -1,18 +1,11 @@
 #
-#  
+# Force Cores such that the first created task
+# is on CPU 0 and the second is on CPU 1. 
 #
 rtems_init 2
-task_create smp1 3 
-# GOAL: 0x09010001, 0x0a010001
-# GOAL:   on CPUs 0-1 respectively
-cpus
+task_create smp1 3 -a 1 
+task_create smp2 2 -a 2
 
-task_create smp2 2 -a 2
-# GOAL: want 0x09010001, 0x0a010002 as heir and executings
-# GOAL:   on CPUs 0 -1 respectively
-cpus
-
-dispatch
 # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
 # GOAL:   on CPUs 0 -1 respectively
-cpus
+cpus smp1 smp2
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -2,47 +2,33 @@
 verbose                   : 1
 ==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 2
+==> 2: # Force Cores such that the first created task
+==> 3: # is on CPU 1 and the second is on CPU 0. 
+==> 4: #
+==> 5: rtems_init 2
   CPU 0: Thread Heir 0x09010001 priority=255
   CPU 0: Thread Executing 0x09010001 priority=255
   CPU 1: Thread Heir 0x09010002 priority=255
   CPU 1: Thread Executing 0x09010002 priority=255
-==> 5: task_create smp1 3 
+==> 6: task_create smp1 3 -a 2 
 Creating task with:  Preemption: yes Timeslicing: no
 Task (smp1) created: id=0x0a010001, priority=3
+Task (0x0a010001) Set affinity=0x00000002
 Task (smp1) starting: id=0x0a010001, priority=3
   CPU 1: Thread Heir 0x0a010001 priority=3
   CPU 1: Thread Executing 0x0a010001 priority=3
-==> 6: # GOAL: 0x09010001, 0x0a010001
-==> 7: # GOAL:   on CPUs 0-1 respectively
-==> 8: cpus
+==> 7: task_create smp2 2 -a 1
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=2
+Task (0x0a010002) Set affinity=0x00000001
+Task (smp2) starting: id=0x0a010002, priority=2
+  CPU 0: Thread Heir 0x0a010002 priority=2
+  CPU 0: Thread Executing 0x0a010002 priority=2
+==> 8: 
+==> 9: # GOAL: want 0x0a010002 - 0x0a010001 as heir and executings
+==> 10: # GOAL:   on CPUs 0 -1 respectively
+==> 11: cpus smp2 smp1
 === CPU Status
           EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 0: 0x0a010002 @  2 / 0x0a010002 @  2          false
   CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
 === End of Ready Set of Threads
-==> 9: 
-==> 10: task_create smp2 4 -a 2
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=4
-Task (0x0a010002) Set affinity=0x00000002
-Task (smp2) starting: id=0x0a010002, priority=4
-==> 11: # GOAL: 0x09010001, 0x0a010001
-==> 12: # GOAL:   on CPUs 0 -1 respectively
-==> 13: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
-  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
-=== End of Ready Set of Threads
-==> 14: 
-==> 15: dispatch
-==> 16: # GOAL: 0x09010001, 0x0a010001
-==> 17: # GOAL:   on CPUs 0 -1 respectively
-==> 18: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
-  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -1,18 +1,11 @@
 #
-#  
+# Force Cores such that the first created task
+# is on CPU 1 and the second is on CPU 0. 
 #
 rtems_init 2
-task_create smp1 3 
-# GOAL: 0x09010001, 0x0a010001
-# GOAL:   on CPUs 0-1 respectively
-cpus
+task_create smp1 3 -a 2 
+task_create smp2 2 -a 1
 
-task_create smp2 4 -a 2
-# GOAL: 0x09010001, 0x0a010001
+# GOAL: want 0x0a010002 - 0x0a010001 as heir and executings
 # GOAL:   on CPUs 0 -1 respectively
-cpus
-
-dispatch
-# GOAL: 0x09010001, 0x0a010001
-# GOAL:   on CPUs 0 -1 respectively
-cpus
+cpus smp2 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,33 +1,0 @@
-Script File               : scenarios/cpus2_affinity_case3.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 2
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-==> 5: task_create smp1 3 -a 1 
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=3
-Task (0x0a010001) Set affinity=0x00000001
-Task (smp1) starting: id=0x0a010001, priority=3
-  CPU 0: Thread Heir 0x0a010001 priority=3
-  CPU 0: Thread Executing 0x0a010001 priority=3
-==> 6: task_create smp2 2 -a 2
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=2
-Task (0x0a010002) Set affinity=0x00000002
-Task (smp2) starting: id=0x0a010002, priority=2
-  CPU 1: Thread Heir 0x0a010002 priority=2
-  CPU 1: Thread Executing 0x0a010002 priority=2
-==> 7: 
-==> 8: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
-==> 9: # GOAL:   on CPUs 0 -1 respectively
-==> 10: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010001 @  3 / 0x0a010001 @  3          false
-  CPU 1: 0x0a010002 @  2 / 0x0a010002 @  2          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#
-#  
-#
-rtems_init 2
-task_create smp1 3 -a 1 
-task_create smp2 2 -a 2
-
-# GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
-# GOAL:   on CPUs 0 -1 respectively
-cpus
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case4.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case4.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,33 +1,0 @@
-Script File               : scenarios/cpus2_affinity_case4.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 2
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-==> 5: task_create smp1 3 -a 2 
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=3
-Task (0x0a010001) Set affinity=0x00000002
-Task (smp1) starting: id=0x0a010001, priority=3
-  CPU 1: Thread Heir 0x0a010001 priority=3
-  CPU 1: Thread Executing 0x0a010001 priority=3
-==> 6: task_create smp2 2 -a 1
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=2
-Task (0x0a010002) Set affinity=0x00000001
-Task (smp2) starting: id=0x0a010002, priority=2
-  CPU 0: Thread Heir 0x0a010002 priority=2
-  CPU 0: Thread Executing 0x0a010002 priority=2
-==> 7: 
-==> 8: # GOAL: want 0x0a010002 - 0x0a010001 as heir and executings
-==> 9: # GOAL:   on CPUs 0 -1 respectively
-==> 10: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010002 @  2 / 0x0a010002 @  2          false
-  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case4.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case4.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#
-#  
-#
-rtems_init 2
-task_create smp1 3 -a 2 
-task_create smp2 2 -a 1
-
-# GOAL: want 0x0a010002 - 0x0a010001 as heir and executings
-# GOAL:   on CPUs 0 -1 respectively
-cpus
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,53 @@
+Script File               : scenarios/cpus2_affinity_migrate_case1.scen
+verbose                   : 1
+==> 1: #
+==> 2: # Create a second task that forces and existing
+==> 3: # task to migrate CPUs at start. 
+==> 4: #
+==> 5: rtems_init 2
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+==> 6: task_create smp1 3 
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=3
+Task (smp1) starting: id=0x0a010001, priority=3
+  CPU 1: Thread Heir 0x0a010001 priority=3
+  CPU 1: Thread Executing 0x0a010001 priority=3
+==> 7: # GOAL: 0x09010001, 0x0a010001
+==> 8: # GOAL:   on CPUs 0-1 respectively
+==> 9: cpus IDLE smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
+=== End of Ready Set of Threads
+==> 10: 
+==> 11: task_create smp2 2 -a 2
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=2
+Task (0x0a010002) Set affinity=0x00000002
+Task (smp2) starting: id=0x0a010002, priority=2
+  CPU 0: Thread Heir 0x0a010001 priority=3
+  CPU 0: Thread Executing 0x0a010001 priority=3
+  CPU 1: Thread Heir 0x0a010002 priority=2
+  CPU 1: Thread Executing 0x0a010002 priority=2
+==> 12: # GOAL: want 0x09010001, 0x0a010002 as heir and executings
+==> 13: # GOAL:   on CPUs 0 -1 respectively
+==> 14: cpus smp1 smp2
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010001 @  3 / 0x0a010001 @  3          false
+  CPU 1: 0x0a010002 @  2 / 0x0a010002 @  2          false
+=== End of Ready Set of Threads
+==> 15: 
+==> 16: dispatch
+==> 17: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+==> 18: # GOAL:   on CPUs 0 -1 respectively
+==> 19: cpus smp1 smp2
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010001 @  3 / 0x0a010001 @  3          false
+  CPU 1: 0x0a010002 @  2 / 0x0a010002 @  2          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,19 @@
+#
+# Create a second task that forces and existing
+# task to migrate CPUs at start. 
+#
+rtems_init 2
+task_create smp1 3 
+# GOAL: 0x09010001, 0x0a010001
+# GOAL:   on CPUs 0-1 respectively
+cpus IDLE smp1
+
+task_create smp2 2 -a 2
+# GOAL: want 0x09010001, 0x0a010002 as heir and executings
+# GOAL:   on CPUs 0 -1 respectively
+cpus smp1 smp2
+
+dispatch
+# GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+# GOAL:   on CPUs 0 -1 respectively
+cpus smp1 smp2
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,50 @@
+Script File               : scenarios/cpus2_affinity_migrate_case2.scen
+verbose                   : 1
+==> 1: #
+==> 2: # Create a second task that is lower priority than
+==> 3: # the first but wants to run on the cpu the first
+==> 4: # task was assigned to.
+==> 5: #
+==> 6: rtems_init 2
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+==> 7: task_create smp1 3 
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=3
+Task (smp1) starting: id=0x0a010001, priority=3
+  CPU 1: Thread Heir 0x0a010001 priority=3
+  CPU 1: Thread Executing 0x0a010001 priority=3
+==> 8: # GOAL: 0x09010001, 0x0a010001
+==> 9: # GOAL:   on CPUs 0-1 respectively
+==> 10: cpus IDLE smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
+=== End of Ready Set of Threads
+==> 11: 
+==> 12: task_create smp2 4 -a 2
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (0x0a010002) Set affinity=0x00000002
+Task (smp2) starting: id=0x0a010002, priority=4
+==> 13: # GOAL: 0x09010001, 0x0a010001
+==> 14: # GOAL:   on CPUs 0 -1 respectively
+==> 15: cpus IDLE smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
+=== End of Ready Set of Threads
+==> 16: 
+==> 17: dispatch
+==> 18: # GOAL: 0x09010001, 0x0a010001
+==> 19: # GOAL:   on CPUs 0 -1 respectively
+==> 20: cpus IDLE smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 1: 0x0a010001 @  3 / 0x0a010001 @  3          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_migrate_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,20 @@
+#
+# Create a second task that is lower priority than
+# the first but wants to run on the cpu the first
+# task was assigned to.
+#
+rtems_init 2
+task_create smp1 3 
+# GOAL: 0x09010001, 0x0a010001
+# GOAL:   on CPUs 0-1 respectively
+cpus IDLE smp1
+
+task_create smp2 4 -a 2
+# GOAL: 0x09010001, 0x0a010001
+# GOAL:   on CPUs 0 -1 respectively
+cpus IDLE smp1
+
+dispatch
+# GOAL: 0x09010001, 0x0a010001
+# GOAL:   on CPUs 0 -1 respectively
+cpus IDLE smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,82 @@
+Script File               : scenarios/cpus4_affinity_api_case1.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Verify that affinity APIs work with the right values
+==> 3: #
+==> 4: #  This scenario does **NOT** change the affinity of any thread
+==> 5: #  which ever executes.
+==> 6: #
+==> 7: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 8: task_create smp1 3
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=3
+Task (smp1) starting: id=0x0a010001, priority=3
+  CPU 3: Thread Heir 0x0a010001 priority=3
+  CPU 3: Thread Executing 0x0a010001 priority=3
+==> 9: task_create smp2 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=6
+Task (smp2) starting: id=0x0a010002, priority=6
+  CPU 2: Thread Heir 0x0a010002 priority=6
+  CPU 2: Thread Executing 0x0a010002 priority=6
+==> 10: task_create smp3 7
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=7
+Task (smp3) starting: id=0x0a010003, priority=7
+  CPU 1: Thread Heir 0x0a010003 priority=7
+  CPU 1: Thread Executing 0x0a010003 priority=7
+==> 11: task_create smp4 8
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=8
+Task (smp4) starting: id=0x0a010004, priority=8
+  CPU 0: Thread Heir 0x0a010004 priority=8
+  CPU 0: Thread Executing 0x0a010004 priority=8
+==> 12: task_create smp5 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=10
+Task (smp5) starting: id=0x0a010005, priority=10
+==> 13: dispatch
+==> 14: # GOAL: Tasks 0x0a010001 - 0x0a010004 as heir and executing
+==> 15: # GOAL:    on CPUs 1 - 4 respectively
+==> 16: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  8 / 0x0a010004 @  8          false
+  CPU 1: 0x0a010003 @  7 / 0x0a010003 @  7          false
+  CPU 2: 0x0a010002 @  6 / 0x0a010002 @  6          false
+  CPU 3: 0x0a010001 @  3 / 0x0a010001 @  3          false
+=== End of Ready Set of Threads
+==> 17: 
+==> 18: # GOAL: These should work OK and change the affinity
+==> 19: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x0000000f
+==> 20: task_set_affinity smp5 0x01
+Task (0x0a010005) Set affinity=0x00000001
+==> 21: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x00000001
+==> 22: task_set_affinity smp5 0x02
+Task (0x0a010005) Set affinity=0x00000002
+==> 23: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x00000002
+==> 24: task_set_affinity smp5 0x04
+Task (0x0a010005) Set affinity=0x00000004
+==> 25: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x00000004
+==> 26: task_set_affinity smp5 0x08
+Task (0x0a010005) Set affinity=0x00000008
+==> 27: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x00000008
+==> 28: 
+==> 29: # GOAL This should fail.
+==> 30: task_set_affinity smp5 0x10
+==> 31: task_get_affinity smp5
+Task (0x0a010005) Get affinity=0x00000008
+==> 32: 
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,32 @@
+#
+#  Verify that affinity APIs work with the right values
+#
+#  This scenario does **NOT** change the affinity of any thread
+#  which ever executes.
+#
+rtems_init 4
+task_create smp1 3
+task_create smp2 6
+task_create smp3 7
+task_create smp4 8
+task_create smp5 10
+dispatch
+# GOAL: Tasks 0x0a010001 - 0x0a010004 as heir and executing
+# GOAL:    on CPUs 1 - 4 respectively
+cpus smp4 smp3 smp2 smp1
+
+# GOAL: These should work OK and change the affinity
+task_get_affinity smp5
+task_set_affinity smp5 0x01
+task_get_affinity smp5
+task_set_affinity smp5 0x02
+task_get_affinity smp5
+task_set_affinity smp5 0x04
+task_get_affinity smp5
+task_set_affinity smp5 0x08
+task_get_affinity smp5
+
+# GOAL This should fail.
+task_set_affinity smp5 0x10
+task_get_affinity smp5
+
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,82 @@
+Script File               : scenarios/cpus4_affinity_api_case2.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Verify that affinity APIs work with the right values
+==> 3: #
+==> 4: #  This scenario does **NOT** change the affinity of any thread
+==> 5: #  which ever executes.
+==> 6: #
+==> 7: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 8: task_create smp1 5
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=5
+Task (smp1) starting: id=0x0a010001, priority=5
+  CPU 3: Thread Heir 0x0a010001 priority=5
+  CPU 3: Thread Executing 0x0a010001 priority=5
+==> 9: task_create smp2 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=6
+Task (smp2) starting: id=0x0a010002, priority=6
+  CPU 2: Thread Heir 0x0a010002 priority=6
+  CPU 2: Thread Executing 0x0a010002 priority=6
+==> 10: task_create smp3 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=6
+Task (smp3) starting: id=0x0a010003, priority=6
+  CPU 1: Thread Heir 0x0a010003 priority=6
+  CPU 1: Thread Executing 0x0a010003 priority=6
+==> 11: task_create smp4 5
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=5
+Task (smp4) starting: id=0x0a010004, priority=5
+  CPU 0: Thread Heir 0x0a010004 priority=5
+  CPU 0: Thread Executing 0x0a010004 priority=5
+==> 12: task_create smp5 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=6
+Task (smp5) starting: id=0x0a010005, priority=6
+==> 13: dispatch
+==> 14: # GOAL: Tasks 0x0a01000[4321] as heir and executing on CPUs 0 - 3 respectively
+==> 15: # GOAL: smp5 has too low priority to run
+==> 16: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  5 / 0x0a010004 @  5          false
+  CPU 1: 0x0a010003 @  6 / 0x0a010003 @  6          false
+  CPU 2: 0x0a010002 @  6 / 0x0a010002 @  6          false
+  CPU 3: 0x0a010001 @  5 / 0x0a010001 @  5          false
+=== End of Ready Set of Threads
+==> 17: 
+==> 18: # GOAL: This should work OK and change the affinity
+==> 19: # GOAL: Internally, smp5 should be selected as heir for CPU 3 while
+==> 20: # GOAL: smp1 is in migrate state. When the migrate state is cleared
+==> 21: # GOAL: at the end of set affinity, smp1 will end up on CPU 1.
+==> 22: #
+==> 23: # NOTE: On a scheduler without SMP, smp1 will be on CPU 3
+==> 24: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x0000000f
+==> 25: task_set_affinity smp1 0x02
+  CPU 1: Thread Heir 0x0a010001 priority=5
+  CPU 1: Thread Executing 0x0a010001 priority=5
+  CPU 3: Thread Heir 0x0a010005 priority=6
+  CPU 3: Thread Executing 0x0a010005 priority=6
+Task (0x0a010001) Set affinity=0x00000002
+==> 26: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x00000002
+==> 27: 
+==> 28: cpus smp4 smp1 smp2 smp5
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  5 / 0x0a010004 @  5          false
+  CPU 1: 0x0a010001 @  5 / 0x0a010001 @  5          false
+  CPU 2: 0x0a010002 @  6 / 0x0a010002 @  6          false
+  CPU 3: 0x0a010005 @  6 / 0x0a010005 @  6          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,28 @@
+#
+#  Verify that affinity APIs work with the right values
+#
+#  This scenario does **NOT** change the affinity of any thread
+#  which ever executes.
+#
+rtems_init 4
+task_create smp1 5
+task_create smp2 6
+task_create smp3 6
+task_create smp4 5
+task_create smp5 6
+dispatch
+# GOAL: Tasks 0x0a01000[4321] as heir and executing on CPUs 0 - 3 respectively
+# GOAL: smp5 has too low priority to run
+cpus smp4 smp3 smp2 smp1
+
+# GOAL: This should work OK and change the affinity
+# GOAL: Internally, smp5 should be selected as heir for CPU 3 while
+# GOAL: smp1 is in migrate state. When the migrate state is cleared
+# GOAL: at the end of set affinity, smp1 will end up on CPU 1.
+#
+# NOTE: On a scheduler without SMP, smp1 will be on CPU 3
+task_get_affinity smp1
+task_set_affinity smp1 0x02
+task_get_affinity smp1
+
+cpus smp4 smp1 smp2 smp5
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,102 @@
+Script File               : scenarios/cpus4_affinity_2.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Block a thread in an application with thread affinity and 
+==> 3: #  priorities such that finding an heir requires scanning the
+==> 4: #  ready set of threads.
+==> 5: #
+==> 6: #  Basic premise:
+==> 7: #    - Two threads at low priority, affinity for core 0
+==> 8: #    - More threads than core at high priority, affinity for all but core 0
+==> 9: #
+==> 10: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 11: task_create smp1 -a 0xe 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=10
+Task (0x0a010001) Set affinity=0x0000000e
+Task (smp1) starting: id=0x0a010001, priority=10
+  CPU 3: Thread Heir 0x0a010001 priority=10
+  CPU 3: Thread Executing 0x0a010001 priority=10
+==> 12: task_create smp2 -a 0xe 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=10
+Task (0x0a010002) Set affinity=0x0000000e
+Task (smp2) starting: id=0x0a010002, priority=10
+  CPU 2: Thread Heir 0x0a010002 priority=10
+  CPU 2: Thread Executing 0x0a010002 priority=10
+==> 13: task_create smp3 -a 0xe 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=10
+Task (0x0a010003) Set affinity=0x0000000e
+Task (smp3) starting: id=0x0a010003, priority=10
+  CPU 1: Thread Heir 0x0a010003 priority=10
+  CPU 1: Thread Executing 0x0a010003 priority=10
+==> 14: task_create smp4 -a 0xe 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=10
+Task (0x0a010004) Set affinity=0x0000000e
+Task (smp4) starting: id=0x0a010004, priority=10
+==> 15: # GOAL: Core 0 should be idle
+==> 16: # GOAL: Cores 1-3 should be 0x0a01000[321] respectively
+==> 17: cpus IDLE smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x09010001 @255 / 0x09010001 @255          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
+==> 18: 
+==> 19: # check_tasks IDLE smp3 smp2 smp1
+==> 20: # GOAL: Core 0 should have aff1 0x0a010005
+==> 21: # GOAL: Cores 1-3 should be 0x0a01000[321] respectively
+==> 22: task_create aff1 -a 0x1 11
+Creating task with:  Preemption: yes Timeslicing: no
+Task (aff1) created: id=0x0a010005, priority=11
+Task (0x0a010005) Set affinity=0x00000001
+Task (aff1) starting: id=0x0a010005, priority=11
+  CPU 0: Thread Heir 0x0a010005 priority=11
+  CPU 0: Thread Executing 0x0a010005 priority=11
+==> 23: cpus aff1 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @ 11 / 0x0a010005 @ 11          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
+==> 24: 
+==> 25: # Create a low priority task with affinity to core 0
+==> 26: task_create aff2 -a 0x1 11
+Creating task with:  Preemption: yes Timeslicing: no
+Task (aff2) created: id=0x0a010006, priority=11
+Task (0x0a010006) Set affinity=0x00000001
+Task (aff2) starting: id=0x0a010006, priority=11
+==> 27: cpus aff1 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @ 11 / 0x0a010005 @ 11          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
+==> 28: task_suspend aff1
+Suspending task (0x0a010005)
+  CPU 0: Thread Heir 0x0a010006 priority=11
+  CPU 0: Thread Executing 0x0a010006 priority=11
+==> 29: cpus aff2 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010006 @ 11 / 0x0a010006 @ 11          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.scn
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.scn	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.scn	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,29 @@
+#
+#  Block a thread in an application with thread affinity and 
+#  priorities such that finding an heir requires scanning the
+#  ready set of threads.
+#
+#  Basic premise:
+#    - Two threads at low priority, affinity for core 0
+#    - More threads than core at high priority, affinity for all but core 0
+#
+rtems_init 4
+task_create smp1 -a 0xe 10
+task_create smp2 -a 0xe 10
+task_create smp3 -a 0xe 10
+task_create smp4 -a 0xe 10
+# GOAL: Core 0 should be idle
+# GOAL: Cores 1-3 should be 0x0a01000[321] respectively
+cpus IDLE smp3 smp2 smp1
+
+# check_tasks IDLE smp3 smp2 smp1
+# GOAL: Core 0 should have aff1 0x0a010005
+# GOAL: Cores 1-3 should be 0x0a01000[321] respectively
+task_create aff1 -a 0x1 11
+cpus aff1 smp3 smp2 smp1
+
+# Create a low priority task with affinity to core 0
+task_create aff2 -a 0x1 11
+cpus aff1 smp3 smp2 smp1
+task_suspend aff1
+cpus aff2 smp3 smp2 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case1.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,113 +1,0 @@
-Script File               : scenarios/cpus4_affinity_case1.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 4
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-  CPU 2: Thread Heir 0x09010003 priority=255
-  CPU 2: Thread Executing 0x09010003 priority=255
-  CPU 3: Thread Heir 0x09010004 priority=255
-  CPU 3: Thread Executing 0x09010004 priority=255
-==> 5: task_create smp1 4 -a 14
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=4
-Task (0x0a010001) Set affinity=0x0000000e
-Task (smp1) starting: id=0x0a010001, priority=4
-  CPU 3: Thread Heir 0x0a010001 priority=4
-  CPU 3: Thread Executing 0x0a010001 priority=4
-==> 6: task_create smp2 4 -a 14
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=4
-Task (0x0a010002) Set affinity=0x0000000e
-Task (smp2) starting: id=0x0a010002, priority=4
-  CPU 2: Thread Heir 0x0a010002 priority=4
-  CPU 2: Thread Executing 0x0a010002 priority=4
-==> 7: task_create smp3 4 -a  3
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp3) created: id=0x0a010003, priority=4
-Task (0x0a010003) Set affinity=0x00000003
-Task (smp3) starting: id=0x0a010003, priority=4
-  CPU 1: Thread Heir 0x0a010003 priority=4
-  CPU 1: Thread Executing 0x0a010003 priority=4
-==> 8: task_create smp4 4 -a  3
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp4) created: id=0x0a010004, priority=4
-Task (0x0a010004) Set affinity=0x00000003
-Task (smp4) starting: id=0x0a010004, priority=4
-  CPU 0: Thread Heir 0x0a010004 priority=4
-  CPU 0: Thread Executing 0x0a010004 priority=4
-==> 9: 
-==> 10: # GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
-==> 11: # GOAL:   on CPUs 0 -3 respectively
-==> 12: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
-  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
-=== End of Ready Set of Threads
-==> 13: 
-==> 14: task_set_affinity smp1 0x03
-Task (0x0a010001) Set affinity=0x00000003
-  CPU 1: Thread Heir 0x0a010001 priority=4
-  CPU 1: Thread Executing 0x0a010001 priority=4
-==> 15: # GOAL: want 0x0a010004, 0x0a010001, 0x0a010002,0x09010001
-==> 16: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 17: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010001 @  4 / 0x0a010001 @  4          false
-  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 3: 0x09010001 @  4 / 0x09010001 @  4          false
-=== End of Ready Set of Threads
-==> 18: 
-==> 19: task_set_affinity smp2 0x03
-Task (0x0a010002) Set affinity=0x00000003
-  CPU 1: Thread Heir 0x0a010002 priority=4
-  CPU 1: Thread Executing 0x0a010002 priority=4
-==> 20: # GOAL: want 0x0a010004, 0x0a010002, 0x00910002,0x09010001
-==> 21: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 22: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 2: 0x09010002 @  4 / 0x09010002 @  4          false
-  CPU 3: 0x09010001 @  4 / 0x09010001 @  4          false
-=== End of Ready Set of Threads
-==> 23: 
-==> 24: task_set_affinity smp3 0x0e
-Task (0x0a010003) Set affinity=0x0000000e
-  CPU 3: Thread Heir 0x0a010003 priority=4
-  CPU 3: Thread Executing 0x0a010003 priority=4
-==> 25: # GOAL: want 0x0a010004, 0x0a010002, 0x09010002,0x0a010003
-==> 26: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 27: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 2: 0x09010002 @  4 / 0x09010002 @  4          false
-  CPU 3: 0x0a010003 @  4 / 0x0a010003 @  4          false
-=== End of Ready Set of Threads
-==> 28: 
-==> 29: task_set_affinity smp4 0x0e
-Task (0x0a010004) Set affinity=0x0000000e
-  CPU 2: Thread Heir 0x0a010004 priority=4
-  CPU 2: Thread Executing 0x0a010004 priority=4
-==> 30: # GOAL: want 0x0a010004, 0x0a010002, 0x0a010004,0x0a010003
-==> 31: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 32: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 2: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 3: 0x0a010003 @  4 / 0x0a010003 @  4          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case1.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#
-#  
-#
-rtems_init 4
-task_create smp1 4 -a 0x0e
-task_create smp2 4 -a 0x0e
-task_create smp3 4 -a 0x03
-task_create smp4 4 -a 0x03
-
-# EXECUTING: {smp1 smp2 smp3 smp4}
-# READY:     {IDLE IDLE IDLE IDLE}
-# GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
-# GOAL:   on CPUs 0 -3 respectively
-cpus smp4 smp3 smp2 smp1
-
-task_set_affinity smp1 0x03
-# EXECUTING: {smp2 smp3 smp4 IDLE}
-# READY:     {smp1 IDLE IDLE IDLE}
-# GOAL: want 0x0a010004, 0x0a010003, 0x0a010002,0x09010001
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus smp4 smp3 smp2 IDLE
-
-task_set_affinity smp2 0x03
-# EXECUTING: {smp3 smp4 IDLE IDLE}
-# READY:     {smp1 smp2 IDLE IDLE}
-# GOAL: want 0x0a010004, 0x0a010003, 0x00910002,0x09010001
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus smp4 smp3 IDLE IDLE
-
-task_set_affinity smp3 0x0e
-# EXECUTING: {smp4 smp2 smp3 IDLE}
-# READY:     {smp1 smp2 IDLE IDLE}
-# GOAL: want 0x0a010004, 0x0a010002, 0x0a010003,0x09010001
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus smp4 smp2 smp3 IDLE
-
-task_set_affinity smp4 0x0e
-# EXECUTING: {smp4 smp2 smp3 smp1}
-# READY:     {IDLE IDLE IDLE IDLE}
-# GOAL: want 0x0a010001, 0x0a010002, 0x0a010003,0x0a010004
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus smp1 smp2 smp3 smp4
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case2.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,85 +1,0 @@
-Script File               : scenarios/cpus4_affinity_case2.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  
-==> 3: #
-==> 4: rtems_init 4
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-  CPU 2: Thread Heir 0x09010003 priority=255
-  CPU 2: Thread Executing 0x09010003 priority=255
-  CPU 3: Thread Heir 0x09010004 priority=255
-  CPU 3: Thread Executing 0x09010004 priority=255
-==> 5: task_create smp1 4 
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=4
-Task (smp1) starting: id=0x0a010001, priority=4
-  CPU 3: Thread Heir 0x0a010001 priority=4
-  CPU 3: Thread Executing 0x0a010001 priority=4
-==> 6: task_create smp2 4
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=4
-Task (smp2) starting: id=0x0a010002, priority=4
-  CPU 2: Thread Heir 0x0a010002 priority=4
-  CPU 2: Thread Executing 0x0a010002 priority=4
-==> 7: task_create smp3 4
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp3) created: id=0x0a010003, priority=4
-Task (smp3) starting: id=0x0a010003, priority=4
-  CPU 1: Thread Heir 0x0a010003 priority=4
-  CPU 1: Thread Executing 0x0a010003 priority=4
-==> 8: task_create smp4 4
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp4) created: id=0x0a010004, priority=4
-Task (smp4) starting: id=0x0a010004, priority=4
-  CPU 0: Thread Heir 0x0a010004 priority=4
-  CPU 0: Thread Executing 0x0a010004 priority=4
-==> 9: task_create smp5 4
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp5) created: id=0x0a010005, priority=4
-Task (smp5) starting: id=0x0a010005, priority=4
-==> 10: 
-==> 11: # GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
-==> 12: # GOAL:   on CPUs 0 -3 respectively
-==> 13: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
-  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
-=== End of Ready Set of Threads
-==> 14: 
-==> 15: task_set_affinity smp5 0x03
-Task (0x0a010005) Set affinity=0x00000003
-  CPU 1: Thread Heir 0x0a010005 priority=4
-  CPU 1: Thread Executing 0x0a010005 priority=4
-==> 16: # GOAL: want 0x0a010004, 0x0a010005, 0x0a010002,0x0a010001
-==> 17: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 18: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
-  CPU 1: 0x0a010005 @  4 / 0x0a010005 @  4          false
-  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
-=== End of Ready Set of Threads
-==> 19: 
-==> 20: task_set_affinity smp2 0x01
-Task (0x0a010002) Set affinity=0x00000001
-  CPU 0: Thread Heir 0x0a010002 priority=4
-  CPU 0: Thread Executing 0x0a010002 priority=4
-  CPU 2: Thread Heir 0x0a010003 priority=4
-  CPU 2: Thread Executing 0x0a010003 priority=4
-===> 21: # GOAL: want 0x0a010002, 0x0a010005, 0x0a010003,0x0a010001
-==> 22: # GOAL:   as heir and executings on CPUs 0-3 respectively
-==> 23: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010002 @  4 / 0x0a010002 @  4          false
-  CPU 1: 0x0a010005 @  4 / 0x0a010005 @  4          false
-  CPU 2: 0x0a010003 @  4 / 0x0a010003 @  4          false
-  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_case2.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#
-#  
-#
-rtems_init 4
-task_create smp1 4 
-task_create smp2 4
-task_create smp3 4
-task_create smp4 4
-task_create smp5 4
-
-# GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
-# GOAL:   on CPUs 0 -3 respectively
-cpus
-
-task_set_affinity smp5 0x03
-# GOAL: want 0x0a010004, 0x0a010005, 0x0a010002,0x0a010001
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus
-
-task_set_affinity smp2 0x01
-# GOAL: want 0x0a010002, 0x0a010005, 0x0a010003,0x0a010001
-# GOAL:   as heir and executings on CPUs 0-3 respectively
-cpus
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,86 @@
+Script File               : scenarios/cpus4_affinity_migrate_case1.scen
+verbose                   : 1
+==> 1: #
+==> 2: # Create 5 tasks of the same priority.  Then
+==> 3: # change the affinity and the priority of the
+==> 4: # task that is on the ready queue. 
+==> 5: #
+==> 6: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 7: task_create smp1 4 
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=4
+Task (smp1) starting: id=0x0a010001, priority=4
+  CPU 3: Thread Heir 0x0a010001 priority=4
+  CPU 3: Thread Executing 0x0a010001 priority=4
+==> 8: task_create smp2 4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (smp2) starting: id=0x0a010002, priority=4
+  CPU 2: Thread Heir 0x0a010002 priority=4
+  CPU 2: Thread Executing 0x0a010002 priority=4
+==> 9: task_create smp3 4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=4
+Task (smp3) starting: id=0x0a010003, priority=4
+  CPU 1: Thread Heir 0x0a010003 priority=4
+  CPU 1: Thread Executing 0x0a010003 priority=4
+==> 10: task_create smp4 4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=4
+Task (smp4) starting: id=0x0a010004, priority=4
+  CPU 0: Thread Heir 0x0a010004 priority=4
+  CPU 0: Thread Executing 0x0a010004 priority=4
+==> 11: task_create smp5 4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=4
+Task (smp5) starting: id=0x0a010005, priority=4
+==> 12: 
+==> 13: # GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
+==> 14: # GOAL:   on CPUs 0 -3 respectively
+==> 15: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
+=== End of Ready Set of Threads
+==> 16: 
+==> 17: task_set_affinity smp5 0x03
+Task (0x0a010005) Set affinity=0x00000003
+==> 18: task_priority smp5 3
+  CPU 0: Thread Heir 0x0a010005 priority=3
+  CPU 0: Thread Executing 0x0a010005 priority=3
+Task (0x0a010005) Change Priority from 4 to 3
+==> 19:  
+==> 20: # GOAL: want 0x0a010005, 0x0a010003, 0x0a010002,0x0a010001
+==> 21: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 22: cpus smp5 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @  3 / 0x0a010005 @  3          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
+=== End of Ready Set of Threads
+==> 23: 
+==> 24: task_set_affinity smp4 0x01
+Task (0x0a010004) Set affinity=0x00000001
+==> 25: # GOAL: want 0x0a010002, 0x0a010005, 0x0a010003,0x0a010001
+==> 26: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 27: cpus smp5 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @  3 / 0x0a010005 @  3          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,27 @@
+#
+# Create 5 tasks of the same priority.  Then
+# change the affinity and the priority of the
+# task that is on the ready queue. 
+#
+rtems_init 4
+task_create smp1 4 
+task_create smp2 4
+task_create smp3 4
+task_create smp4 4
+task_create smp5 4
+
+# GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
+# GOAL:   on CPUs 0 -3 respectively
+cpus smp4 smp3 smp2 smp1
+
+task_set_affinity smp5 0x03
+task_priority smp5 3
+ 
+# GOAL: want 0x0a010005, 0x0a010003, 0x0a010002,0x0a010001
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp5 smp3 smp2 smp1
+
+task_set_affinity smp4 0x01
+# GOAL: want 0x0a010002, 0x0a010005, 0x0a010003,0x0a010001
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp5 smp3 smp2 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,78 @@
+Script File               : scenarios/cpus4_affinity_migrate_case2.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Create threads of single cpu affinity to fill the
+==> 3: #  cpus.  Have a single of the same priority on the
+==> 4: #  ready chain that can run on any cpu.  Change the
+==> 5: #  affinity of one of the running threads forcing it
+==> 6: #  to move to the ready chain and quit running. 
+==> 7: #
+==> 8: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 9: task_create smp1 4 -a 0x2 
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=4
+Task (0x0a010001) Set affinity=0x00000002
+Task (smp1) starting: id=0x0a010001, priority=4
+  CPU 1: Thread Heir 0x0a010001 priority=4
+  CPU 1: Thread Executing 0x0a010001 priority=4
+==> 10: task_create smp2 4 -a 0x1
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (0x0a010002) Set affinity=0x00000001
+Task (smp2) starting: id=0x0a010002, priority=4
+  CPU 0: Thread Heir 0x0a010002 priority=4
+  CPU 0: Thread Executing 0x0a010002 priority=4
+==> 11: task_create smp3 4 -a 0x8
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=4
+Task (0x0a010003) Set affinity=0x00000008
+Task (smp3) starting: id=0x0a010003, priority=4
+  CPU 3: Thread Heir 0x0a010003 priority=4
+  CPU 3: Thread Executing 0x0a010003 priority=4
+==> 12: task_create smp4 4 -a 0x4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=4
+Task (0x0a010004) Set affinity=0x00000004
+Task (smp4) starting: id=0x0a010004, priority=4
+  CPU 2: Thread Heir 0x0a010004 priority=4
+  CPU 2: Thread Executing 0x0a010004 priority=4
+==> 13: task_create smp5 4
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=4
+Task (smp5) starting: id=0x0a010005, priority=4
+==> 14: 
+==> 15: # GOAL: want 0x0a010002, 0x0a010001, 0x0a010004, 0x0a010003
+==> 16: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 17: cpus smp2 smp1 smp4 smp3
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 1: 0x0a010001 @  4 / 0x0a010001 @  4          false
+  CPU 2: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 3: 0x0a010003 @  4 / 0x0a010003 @  4          false
+=== End of Ready Set of Threads
+==> 18: 
+==> 19: 
+==> 20: task_set_affinity smp1 0x0e
+  CPU 1: Thread Heir 0x0a010005 priority=4
+  CPU 1: Thread Executing 0x0a010005 priority=4
+Task (0x0a010001) Set affinity=0x0000000e
+==> 21: # GOAL: want 0x0a010002, 0x0a010005, 0x0a010004, 0x0a010003
+==> 22: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 23: cpus smp2 smp5 smp4 smp3
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 1: 0x0a010005 @  4 / 0x0a010005 @  4          false
+  CPU 2: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 3: 0x0a010003 @  4 / 0x0a010003 @  4          false
+=== End of Ready Set of Threads
+==> 24: 
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_migrate_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,24 @@
+#
+#  Create threads of single cpu affinity to fill the
+#  cpus.  Have a single of the same priority on the
+#  ready chain that can run on any cpu.  Change the
+#  affinity of one of the running threads forcing it
+#  to move to the ready chain and quit running. 
+#
+rtems_init 4
+task_create smp1 4 -a 0x2 
+task_create smp2 4 -a 0x1
+task_create smp3 4 -a 0x8
+task_create smp4 4 -a 0x4
+task_create smp5 4
+
+# GOAL: want 0x0a010002, 0x0a010001, 0x0a010004, 0x0a010003
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp2 smp1 smp4 smp3
+
+
+task_set_affinity smp1 0x0e
+# GOAL: want 0x0a010002, 0x0a010005, 0x0a010004, 0x0a010003
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp2 smp5 smp4 smp3
+
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,129 @@
+Script File               : scenarios/cpus4_affinity_overlap_case1.scen
+verbose                   : 1
+==> 1: #
+==> 2: # Create 2 sets of threads one that can run on cpus
+==> 3: # {0,1} the others can run on cpus {1,2,3}.  Then
+==> 4: # swap the affinity of the two sets
+==> 5: #
+==> 6: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 7: task_create smp1 4 -a 0x0e
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=4
+Task (0x0a010001) Set affinity=0x0000000e
+Task (smp1) starting: id=0x0a010001, priority=4
+  CPU 3: Thread Heir 0x0a010001 priority=4
+  CPU 3: Thread Executing 0x0a010001 priority=4
+==> 8: task_create smp2 4 -a 0x0e
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (0x0a010002) Set affinity=0x0000000e
+Task (smp2) starting: id=0x0a010002, priority=4
+  CPU 2: Thread Heir 0x0a010002 priority=4
+  CPU 2: Thread Executing 0x0a010002 priority=4
+==> 9: task_create smp3 4 -a 0x03
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=4
+Task (0x0a010003) Set affinity=0x00000003
+Task (smp3) starting: id=0x0a010003, priority=4
+  CPU 1: Thread Heir 0x0a010003 priority=4
+  CPU 1: Thread Executing 0x0a010003 priority=4
+==> 10: task_create smp4 4 -a 0x03
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=4
+Task (0x0a010004) Set affinity=0x00000003
+Task (smp4) starting: id=0x0a010004, priority=4
+  CPU 0: Thread Heir 0x0a010004 priority=4
+  CPU 0: Thread Executing 0x0a010004 priority=4
+==> 11: 
+==> 12: # EXECUTING: {smp1 smp2 smp3 smp4}
+==> 13: # READY:     {IDLE IDLE IDLE IDLE}
+==> 14: # GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
+==> 15: # GOAL:   on CPUs 0 -3 respectively
+==> 16: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 3: 0x0a010001 @  4 / 0x0a010001 @  4          false
+=== End of Ready Set of Threads
+==> 17: 
+==> 18: task_set_affinity smp1 0x03
+  CPU 3: Thread Heir 0x09010001 priority=255
+  CPU 3: Thread Executing 0x09010001 priority=255
+Task (0x0a010001) Set affinity=0x00000003
+==> 19: # EXECUTING: {smp2 smp3 smp4 IDLE}
+==> 20: # READY:     {smp1 IDLE IDLE IDLE}
+==> 21: # GOAL: want 0x0a010004, 0x0a010003, 0x0a010002,0x09010001
+==> 22: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 23: cpus smp4 smp3 smp2 IDLE
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 3: 0x09010001 @255 / 0x09010001 @255          false
+=== End of Ready Set of Threads
+==> 24: 
+==> 25: task_set_affinity smp2 0x03
+  CPU 2: Thread Heir 0x09010002 priority=255
+  CPU 2: Thread Executing 0x09010002 priority=255
+Task (0x0a010002) Set affinity=0x00000003
+==> 26: # EXECUTING: {smp3 smp4 IDLE IDLE}
+==> 27: # READY:     {smp1 smp2 IDLE IDLE}
+==> 28: # GOAL: want 0x0a010004, 0x0a010003, 0x00910002,0x09010001
+==> 29: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 30: cpus smp4 smp3 IDLE IDLE
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 1: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 2: 0x09010002 @255 / 0x09010002 @255          false
+  CPU 3: 0x09010001 @255 / 0x09010001 @255          false
+=== End of Ready Set of Threads
+==> 31: 
+==> 32: task_set_affinity smp3 0x0e
+  CPU 1: Thread Heir 0x0a010002 priority=4
+  CPU 1: Thread Executing 0x0a010002 priority=4
+  CPU 2: Thread Heir 0x0a010003 priority=4
+  CPU 2: Thread Executing 0x0a010003 priority=4
+Task (0x0a010003) Set affinity=0x0000000e
+==> 33: # EXECUTING: {smp4 smp2 smp3 IDLE}
+==> 34: # READY:     {smp1 smp2 IDLE IDLE}
+==> 35: # GOAL: want 0x0a010004, 0x0a010002, 0x0a010003,0x09010001
+==> 36: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 37: cpus smp4 smp2 smp3 IDLE
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  4 / 0x0a010004 @  4          false
+  CPU 1: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 2: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 3: 0x09010001 @255 / 0x09010001 @255          false
+=== End of Ready Set of Threads
+==> 38: 
+==> 39: task_set_affinity smp4 0x0e
+  CPU 0: Thread Heir 0x0a010001 priority=4
+  CPU 0: Thread Executing 0x0a010001 priority=4
+  CPU 3: Thread Heir 0x0a010004 priority=4
+  CPU 3: Thread Executing 0x0a010004 priority=4
+Task (0x0a010004) Set affinity=0x0000000e
+==> 40: # EXECUTING: {smp4 smp2 smp3 smp1}
+==> 41: # READY:     {IDLE IDLE IDLE IDLE}
+==> 42: # GOAL: want 0x0a010001, 0x0a010002, 0x0a010003,0x0a010004
+==> 43: # GOAL:   as heir and executings on CPUs 0-3 respectively
+==> 44: cpus smp1 smp2 smp3 smp4
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010001 @  4 / 0x0a010001 @  4          false
+  CPU 1: 0x0a010002 @  4 / 0x0a010002 @  4          false
+  CPU 2: 0x0a010003 @  4 / 0x0a010003 @  4          false
+  CPU 3: 0x0a010004 @  4 / 0x0a010004 @  4          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_overlap_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,44 @@
+#
+# Create 2 sets of threads one that can run on cpus
+# {0,1} the others can run on cpus {1,2,3}.  Then
+# swap the affinity of the two sets
+#
+rtems_init 4
+task_create smp1 4 -a 0x0e
+task_create smp2 4 -a 0x0e
+task_create smp3 4 -a 0x03
+task_create smp4 4 -a 0x03
+
+# EXECUTING: {smp1 smp2 smp3 smp4}
+# READY:     {IDLE IDLE IDLE IDLE}
+# GOAL: want 0x0a010004 - 0x0a010001 as heir and executings
+# GOAL:   on CPUs 0 -3 respectively
+cpus smp4 smp3 smp2 smp1
+
+task_set_affinity smp1 0x03
+# EXECUTING: {smp2 smp3 smp4 IDLE}
+# READY:     {smp1 IDLE IDLE IDLE}
+# GOAL: want 0x0a010004, 0x0a010003, 0x0a010002,0x09010001
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp4 smp3 smp2 IDLE
+
+task_set_affinity smp2 0x03
+# EXECUTING: {smp3 smp4 IDLE IDLE}
+# READY:     {smp1 smp2 IDLE IDLE}
+# GOAL: want 0x0a010004, 0x0a010003, 0x00910002,0x09010001
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp4 smp3 IDLE IDLE
+
+task_set_affinity smp3 0x0e
+# EXECUTING: {smp4 smp2 smp3 IDLE}
+# READY:     {smp1 smp2 IDLE IDLE}
+# GOAL: want 0x0a010004, 0x0a010002, 0x0a010003,0x09010001
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp4 smp2 smp3 IDLE
+
+task_set_affinity smp4 0x0e
+# EXECUTING: {smp4 smp2 smp3 smp1}
+# READY:     {IDLE IDLE IDLE IDLE}
+# GOAL: want 0x0a010001, 0x0a010002, 0x0a010003,0x0a010004
+# GOAL:   as heir and executings on CPUs 0-3 respectively
+cpus smp1 smp2 smp3 smp4
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,86 @@
+Script File               : scenarios/cpus4_affinity_priority_case1.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Ensure lowest priority is preempted
+==> 3: #
+==> 4: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 5: task_create smp1 7
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=7
+Task (smp1) starting: id=0x0a010001, priority=7
+  CPU 3: Thread Heir 0x0a010001 priority=7
+  CPU 3: Thread Executing 0x0a010001 priority=7
+==> 6: task_create smp2 8
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=8
+Task (smp2) starting: id=0x0a010002, priority=8
+  CPU 2: Thread Heir 0x0a010002 priority=8
+  CPU 2: Thread Executing 0x0a010002 priority=8
+==> 7: task_create smp3 5
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=5
+Task (smp3) starting: id=0x0a010003, priority=5
+  CPU 1: Thread Heir 0x0a010003 priority=5
+  CPU 1: Thread Executing 0x0a010003 priority=5
+==> 8: task_create smp4 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=6
+Task (smp4) starting: id=0x0a010004, priority=6
+  CPU 0: Thread Heir 0x0a010004 priority=6
+  CPU 0: Thread Executing 0x0a010004 priority=6
+==> 9: task_create smp5 9
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=9
+Task (smp5) starting: id=0x0a010005, priority=9
+==> 10: 
+==> 11: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+==> 12: # GOAL:   on CPUs 3-0 respectively
+==> 13: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
+==> 14: 
+==> 15: # Tasks are created and distributed across CPUs
+==> 16: task_set_affinity smp5 0x01
+Task (0x0a010005) Set affinity=0x00000001
+==> 17: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+==> 18: # GOAL:   on CPUs 3-0 respectively
+==> 19: # PRI: 6    5    8   7
+==> 20: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
+==> 21: 
+==> 22: task_priority smp5 5
+  CPU 0: Thread Heir 0x0a010005 priority=5
+  CPU 0: Thread Executing 0x0a010005 priority=5
+  CPU 2: Thread Heir 0x0a010004 priority=6
+  CPU 2: Thread Executing 0x0a010004 priority=6
+Task (0x0a010005) Change Priority from 9 to 5
+==> 23: # GOAL: want 0x0a010005, 0x0a010003, 0x0a010004, 0x0a010001
+==> 24: # GOAL:   to be heir AND executing on CPU 0-3 respectively
+==> 25: # PRI: 5    5    6   7
+==> 26: cpus smp5 smp3 smp4 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @  5 / 0x0a010005 @  5          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case1.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,26 @@
+#
+#  Ensure lowest priority is preempted
+#
+rtems_init 4
+task_create smp1 7
+task_create smp2 8
+task_create smp3 5
+task_create smp4 6
+task_create smp5 9
+
+# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+# GOAL:   on CPUs 3-0 respectively
+cpus smp4 smp3 smp2 smp1
+
+# Tasks are created and distributed across CPUs
+task_set_affinity smp5 0x01
+# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+# GOAL:   on CPUs 3-0 respectively
+# PRI: 6    5    8   7
+cpus smp4 smp3 smp2 smp1
+
+task_priority smp5 5
+# GOAL: want 0x0a010005, 0x0a010003, 0x0a010004, 0x0a010001
+# GOAL:   to be heir AND executing on CPU 0-3 respectively
+# PRI: 5    5    6   7
+cpus smp5 smp3 smp4 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,79 @@
+Script File               : scenarios/cpus4_affinity_priority_case2.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Ensure lowest priority is preempted
+==> 3: #
+==> 4: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 5: task_create smp1 7
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=7
+Task (smp1) starting: id=0x0a010001, priority=7
+  CPU 3: Thread Heir 0x0a010001 priority=7
+  CPU 3: Thread Executing 0x0a010001 priority=7
+==> 6: task_create smp2 8
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=8
+Task (smp2) starting: id=0x0a010002, priority=8
+  CPU 2: Thread Heir 0x0a010002 priority=8
+  CPU 2: Thread Executing 0x0a010002 priority=8
+==> 7: task_create smp3 5
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=5
+Task (smp3) starting: id=0x0a010003, priority=5
+  CPU 1: Thread Heir 0x0a010003 priority=5
+  CPU 1: Thread Executing 0x0a010003 priority=5
+==> 8: task_create smp4 6
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=6
+Task (smp4) starting: id=0x0a010004, priority=6
+  CPU 0: Thread Heir 0x0a010004 priority=6
+  CPU 0: Thread Executing 0x0a010004 priority=6
+==> 9: task_create smp5 9 
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=9
+Task (smp5) starting: id=0x0a010005, priority=9
+==> 10: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+==> 11: # GOAL:   on CPUs 3-0 respectively
+==> 12: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
+==> 13: 
+==> 14: # Tasks are created and distributed across CPUs
+==> 15: task_set_affinity smp5 0x02
+Task (0x0a010005) Set affinity=0x00000002
+==> 16: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+==> 17: # GOAL:   on CPUs 3-0 respectively
+==> 18: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
+==> 19: 
+==> 20: task_priority smp5 6
+Task (0x0a010005) Change Priority from 9 to 6
+==> 21: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+==> 22: # GOAL:   on CPUs 3-0 respectively
+==> 23: cpus smp4 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
+  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
+  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
+  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case2.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,23 @@
+#
+#  Ensure lowest priority is preempted
+#
+rtems_init 4
+task_create smp1 7
+task_create smp2 8
+task_create smp3 5
+task_create smp4 6
+task_create smp5 9 
+# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+# GOAL:   on CPUs 3-0 respectively
+cpus smp4 smp3 smp2 smp1
+
+# Tasks are created and distributed across CPUs
+task_set_affinity smp5 0x02
+# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+# GOAL:   on CPUs 3-0 respectively
+cpus smp4 smp3 smp2 smp1
+
+task_priority smp5 6
+# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
+# GOAL:   on CPUs 3-0 respectively
+cpus smp4 smp3 smp2 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.expected	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,85 @@
+Script File               : scenarios/cpus4_affinity_priority_case3.scen
+verbose                   : 1
+==> 1: #
+==> 2: #  Exercise priority and affinity.
+==> 3: #  priorities such that finding an heir requires scanning the
+==> 4: #  ready set of threads.
+==> 5: #
+==> 6: rtems_init 4
+  CPU 0: Thread Heir 0x09010001 priority=255
+  CPU 0: Thread Executing 0x09010001 priority=255
+  CPU 1: Thread Heir 0x09010002 priority=255
+  CPU 1: Thread Executing 0x09010002 priority=255
+  CPU 2: Thread Heir 0x09010003 priority=255
+  CPU 2: Thread Executing 0x09010003 priority=255
+  CPU 3: Thread Heir 0x09010004 priority=255
+  CPU 3: Thread Executing 0x09010004 priority=255
+==> 7: task_create smp1 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=10
+Task (smp1) starting: id=0x0a010001, priority=10
+  CPU 3: Thread Heir 0x0a010001 priority=10
+  CPU 3: Thread Executing 0x0a010001 priority=10
+==> 8: task_create smp2 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=10
+Task (smp2) starting: id=0x0a010002, priority=10
+  CPU 2: Thread Heir 0x0a010002 priority=10
+  CPU 2: Thread Executing 0x0a010002 priority=10
+==> 9: task_create smp3 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp3) created: id=0x0a010003, priority=10
+Task (smp3) starting: id=0x0a010003, priority=10
+  CPU 1: Thread Heir 0x0a010003 priority=10
+  CPU 1: Thread Executing 0x0a010003 priority=10
+==> 10: task_create smp4 12
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp4) created: id=0x0a010004, priority=12
+Task (smp4) starting: id=0x0a010004, priority=12
+  CPU 0: Thread Heir 0x0a010004 priority=12
+  CPU 0: Thread Executing 0x0a010004 priority=12
+==> 11: task_create smp5 10
+Creating task with:  Preemption: yes Timeslicing: no
+Task (smp5) created: id=0x0a010005, priority=10
+Task (smp5) starting: id=0x0a010005, priority=10
+  CPU 0: Thread Heir 0x0a010005 priority=10
+  CPU 0: Thread Executing 0x0a010005 priority=10
+==> 12: # GOAL: Cores 0-3 should be 0x0a01000[5321] respectively
+==> 13: cpus smp5 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @ 10 / 0x0a010005 @ 10          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
+==> 14: 
+==> 15: # GOAL: No change - pri is too low to run 
+==> 16: task_create pri1 -a 0x2 11
+Creating task with:  Preemption: yes Timeslicing: no
+Task (pri1) created: id=0x0a010006, priority=11
+Task (0x0a010006) Set affinity=0x00000002
+Task (pri1) starting: id=0x0a010006, priority=11
+==> 17: cpus smp5 smp3 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @ 10 / 0x0a010005 @ 10          false
+  CPU 1: 0x0a010003 @ 10 / 0x0a010003 @ 10          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
+==> 18: 
+==> 19: # GOAL: pri1 should preempt smp3 on core 1
+==> 20: # GOAL: Cores 0-3 should be 0x0a01000[5621] respectively
+==> 21: task_priority pri1 9
+  CPU 1: Thread Heir 0x0a010006 priority=9
+  CPU 1: Thread Executing 0x0a010006 priority=9
+Task (0x0a010006) Change Priority from 11 to 9
+==> 22: cpus smp5 pri1 smp2 smp1
+=== CPU Status
+          EXECUTING      /   HEIR             / SWITCH NEEDED
+  CPU 0: 0x0a010005 @ 10 / 0x0a010005 @ 10          false
+  CPU 1: 0x0a010006 @  9 / 0x0a010006 @  9          false
+  CPU 2: 0x0a010002 @ 10 / 0x0a010002 @ 10          false
+  CPU 3: 0x0a010001 @ 10 / 0x0a010001 @ 10          false
+=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
+++ schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_priority_case3.scen	(revision f965428ac73adf305190cafa9d484134089dd1bf)
@@ -0,0 +1,22 @@
+#
+#  Exercise priority and affinity.
+#  priorities such that finding an heir requires scanning the
+#  ready set of threads.
+#
+rtems_init 4
+task_create smp1 10
+task_create smp2 10
+task_create smp3 10
+task_create smp4 12
+task_create smp5 10
+# GOAL: Cores 0-3 should be 0x0a01000[5321] respectively
+cpus smp5 smp3 smp2 smp1
+
+# GOAL: No change - pri is too low to run 
+task_create pri1 -a 0x2 11
+cpus smp5 smp3 smp2 smp1
+
+# GOAL: pri1 should preempt smp3 on core 1
+# GOAL: Cores 0-3 should be 0x0a01000[5621] respectively
+task_priority pri1 9
+cpus smp5 pri1 smp2 smp1
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_exercise_affinity_api.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_exercise_affinity_api.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,79 +1,0 @@
-Script File               : scenarios/cpus4_exercise_affinity_api.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  Verify that affinity APIs work with the right values
-==> 3: #
-==> 4: rtems_init 4
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-  CPU 2: Thread Heir 0x09010003 priority=255
-  CPU 2: Thread Executing 0x09010003 priority=255
-  CPU 3: Thread Heir 0x09010004 priority=255
-  CPU 3: Thread Executing 0x09010004 priority=255
-==> 5: task_create smp1 3
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=3
-Task (smp1) starting: id=0x0a010001, priority=3
-  CPU 3: Thread Heir 0x0a010001 priority=3
-  CPU 3: Thread Executing 0x0a010001 priority=3
-==> 6: task_create smp2 6
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=6
-Task (smp2) starting: id=0x0a010002, priority=6
-  CPU 2: Thread Heir 0x0a010002 priority=6
-  CPU 2: Thread Executing 0x0a010002 priority=6
-==> 7: task_create smp3 7
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp3) created: id=0x0a010003, priority=7
-Task (smp3) starting: id=0x0a010003, priority=7
-  CPU 1: Thread Heir 0x0a010003 priority=7
-  CPU 1: Thread Executing 0x0a010003 priority=7
-==> 8: task_create smp4 8
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp4) created: id=0x0a010004, priority=8
-Task (smp4) starting: id=0x0a010004, priority=8
-  CPU 0: Thread Heir 0x0a010004 priority=8
-  CPU 0: Thread Executing 0x0a010004 priority=8
-==> 9: task_create smp5 10
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp5) created: id=0x0a010005, priority=10
-Task (smp5) starting: id=0x0a010005, priority=10
-==> 10: dispatch
-==> 11: # GOAL: Tasks 0x0a010001 - 0x0a010004 as heir and executing
-==> 12: # GOAL:    on CPUs 1 - 4 respectively
-==> 13: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  8 / 0x0a010004 @  8          false
-  CPU 1: 0x0a010003 @  7 / 0x0a010003 @  7          false
-  CPU 2: 0x0a010002 @  6 / 0x0a010002 @  6          false
-  CPU 3: 0x0a010001 @  3 / 0x0a010001 @  3          false
-=== End of Ready Set of Threads
-==> 14: 
-==> 15: # GOAL: These should work OK and change the affinity
-==> 16: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x0000000f
-==> 17: task_set_affinity smp5 0x01
-Task (0x0a010005) Set affinity=0x00000001
-==> 18: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x00000001
-==> 19: task_set_affinity smp5 0x02
-Task (0x0a010005) Set affinity=0x00000002
-==> 20: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x00000002
-==> 21: task_set_affinity smp5 0x04
-Task (0x0a010005) Set affinity=0x00000004
-==> 22: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x00000004
-==> 23: task_set_affinity smp5 0x08
-Task (0x0a010005) Set affinity=0x00000008
-==> 24: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x00000008
-==> 25: 
-==> 26: # GOAL This should fail.
-==> 27: task_set_affinity smp5 0x10
-==> 28: task_get_affinity smp5
-Task (0x0a010005) Get affinity=0x00000008
-==> 29: 
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_exercise_affinity_api.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_exercise_affinity_api.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#
-#  Verify that affinity APIs work with the right values
-#
-#  This scenario does **NOT** change the affinity of any thread
-#  which ever executes.
-#
-rtems_init 4
-task_create smp1 3
-task_create smp2 6
-task_create smp3 7
-task_create smp4 8
-task_create smp5 10
-dispatch
-# GOAL: Tasks 0x0a010001 - 0x0a010004 as heir and executing
-# GOAL:    on CPUs 1 - 4 respectively
-cpus
-
-# GOAL: These should work OK and change the affinity
-task_get_affinity smp5
-task_set_affinity smp5 0x01
-task_get_affinity smp5
-task_set_affinity smp5 0x02
-task_get_affinity smp5
-task_set_affinity smp5 0x04
-task_get_affinity smp5
-task_set_affinity smp5 0x08
-task_get_affinity smp5
-
-# GOAL This should fail.
-task_set_affinity smp5 0x10
-task_get_affinity smp5
-
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case1.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case1.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,82 +1,0 @@
-Script File               : scenarios/cpus4_priority_case1.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  Ensure lowest priority is preempted
-==> 3: #
-==> 4: rtems_init 4
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-  CPU 2: Thread Heir 0x09010003 priority=255
-  CPU 2: Thread Executing 0x09010003 priority=255
-  CPU 3: Thread Heir 0x09010004 priority=255
-  CPU 3: Thread Executing 0x09010004 priority=255
-==> 5: task_create smp1 7
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=7
-Task (smp1) starting: id=0x0a010001, priority=7
-  CPU 3: Thread Heir 0x0a010001 priority=7
-  CPU 3: Thread Executing 0x0a010001 priority=7
-==> 6: task_create smp2 8
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=8
-Task (smp2) starting: id=0x0a010002, priority=8
-  CPU 2: Thread Heir 0x0a010002 priority=8
-  CPU 2: Thread Executing 0x0a010002 priority=8
-==> 7: task_create smp3 5
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp3) created: id=0x0a010003, priority=5
-Task (smp3) starting: id=0x0a010003, priority=5
-  CPU 1: Thread Heir 0x0a010003 priority=5
-  CPU 1: Thread Executing 0x0a010003 priority=5
-==> 8: task_create smp4 6
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp4) created: id=0x0a010004, priority=6
-Task (smp4) starting: id=0x0a010004, priority=6
-  CPU 0: Thread Heir 0x0a010004 priority=6
-  CPU 0: Thread Executing 0x0a010004 priority=6
-==> 9: task_create smp5 9
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp5) created: id=0x0a010005, priority=9
-Task (smp5) starting: id=0x0a010005, priority=9
-==> 10: 
-==> 11: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-==> 12: # GOAL:   on CPUs 3-0 respectively
-==> 13: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
-==> 14: 
-==> 15: # Tasks are created and distributed across CPUs
-==> 16: task_set_affinity smp5 0x01
-Task (0x0a010005) Set affinity=0x00000001
-==> 17: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-==> 18: # GOAL:   on CPUs 3-0 respectively
-==> 19: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
-==> 20: 
-==> 21: task_priority smp5 5
-  CPU 2: Thread Heir 0x0a010005 priority=5
-  CPU 2: Thread Executing 0x0a010005 priority=5
-Task (0x0a010005) Change Priority from 9 to 5
-==> 22: # GOAL: want 0x0a010005, 0x0a010003, 0x0a010004, 0x0a010001
-==> 23: # GOAL:   to be heir AND executing on CPU 0-3 respectively
-==> 24: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010005 @  5 / 0x0a010005 @  5          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case1.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case1.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#
-#  Ensure lowest priority is preempted
-#
-rtems_init 4
-task_create smp1 7
-task_create smp2 8
-task_create smp3 5
-task_create smp4 6
-task_create smp5 9
-
-# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-# GOAL:   on CPUs 3-0 respectively
-cpus
-
-# Tasks are created and distributed across CPUs
-task_set_affinity smp5 0x01
-# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-# GOAL:   on CPUs 3-0 respectively
-cpus
-
-task_priority smp5 5
-# GOAL: want 0x0a010005, 0x0a010003, 0x0a010004, 0x0a010001
-# GOAL:   to be heir AND executing on CPU 0-3 respectively
-cpus
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case2.expected
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case2.expected	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,79 +1,0 @@
-Script File               : scenarios/cpus4_priority_case2.scen
-verbose                   : 1
-==> 1: #
-==> 2: #  Ensure lowest priority is preempted
-==> 3: #
-==> 4: rtems_init 4
-  CPU 0: Thread Heir 0x09010001 priority=255
-  CPU 0: Thread Executing 0x09010001 priority=255
-  CPU 1: Thread Heir 0x09010002 priority=255
-  CPU 1: Thread Executing 0x09010002 priority=255
-  CPU 2: Thread Heir 0x09010003 priority=255
-  CPU 2: Thread Executing 0x09010003 priority=255
-  CPU 3: Thread Heir 0x09010004 priority=255
-  CPU 3: Thread Executing 0x09010004 priority=255
-==> 5: task_create smp1 7
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp1) created: id=0x0a010001, priority=7
-Task (smp1) starting: id=0x0a010001, priority=7
-  CPU 3: Thread Heir 0x0a010001 priority=7
-  CPU 3: Thread Executing 0x0a010001 priority=7
-==> 6: task_create smp2 8
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp2) created: id=0x0a010002, priority=8
-Task (smp2) starting: id=0x0a010002, priority=8
-  CPU 2: Thread Heir 0x0a010002 priority=8
-  CPU 2: Thread Executing 0x0a010002 priority=8
-==> 7: task_create smp3 5
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp3) created: id=0x0a010003, priority=5
-Task (smp3) starting: id=0x0a010003, priority=5
-  CPU 1: Thread Heir 0x0a010003 priority=5
-  CPU 1: Thread Executing 0x0a010003 priority=5
-==> 8: task_create smp4 6
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp4) created: id=0x0a010004, priority=6
-Task (smp4) starting: id=0x0a010004, priority=6
-  CPU 0: Thread Heir 0x0a010004 priority=6
-  CPU 0: Thread Executing 0x0a010004 priority=6
-==> 9: task_create smp5 9 
-Creating task with:  Preemption: yes Timeslicing: no
-Task (smp5) created: id=0x0a010005, priority=9
-Task (smp5) starting: id=0x0a010005, priority=9
-==> 10: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-==> 11: # GOAL:   on CPUs 3-0 respectively
-==> 12: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
-==> 13: 
-==> 14: # Tasks are created and distributed across CPUs
-==> 15: task_set_affinity smp5 0x02
-Task (0x0a010005) Set affinity=0x00000002
-==> 16: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-==> 17: # GOAL:   on CPUs 3-0 respectively
-==> 18: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
-==> 19: 
-==> 20: task_priority smp5 6
-Task (0x0a010005) Change Priority from 9 to 6
-==> 21: # GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-==> 22: # GOAL:   on CPUs 3-0 respectively
-==> 23: cpus
-=== CPU Status
-          EXECUTING      /   HEIR             / SWITCH NEEDED
-  CPU 0: 0x0a010004 @  6 / 0x0a010004 @  6          false
-  CPU 1: 0x0a010003 @  5 / 0x0a010003 @  5          false
-  CPU 2: 0x0a010002 @  8 / 0x0a010002 @  8          false
-  CPU 3: 0x0a010001 @  7 / 0x0a010001 @  7          false
-=== End of Ready Set of Threads
Index: schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case2.scen
===================================================================
--- schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_priority_case2.scen	(revision be883c2f64a5efed223c1d1ab30d9e61a30867e2)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#
-#  Ensure lowest priority is preempted
-#
-rtems_init 4
-task_create smp1 7
-task_create smp2 8
-task_create smp3 5
-task_create smp4 6
-task_create smp5 9 
-# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-# GOAL:   on CPUs 3-0 respectively
-cpus
-
-# Tasks are created and distributed across CPUs
-task_set_affinity smp5 0x02
-# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-# GOAL:   on CPUs 3-0 respectively
-cpus
-
-task_priority smp5 6
-# GOAL: want 0x0a010001 - 0x0a010004 as heir and executings
-# GOAL:   on CPUs 3-0 respectively
-cpus
