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 |
---|
7 | task_create smp1 4 -a 0x0e |
---|
8 | task_create smp2 4 -a 0x0e |
---|
9 | task_create smp3 4 -a 0x03 |
---|
10 | task_create smp4 4 -a 0x03 |
---|
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 |
---|
17 | |
---|
18 | task_set_affinity smp1 0x03 |
---|
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 |
---|
24 | |
---|
25 | task_set_affinity smp2 0x03 |
---|
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 |
---|
31 | |
---|
32 | task_set_affinity smp3 0x0e |
---|
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 |
---|
38 | |
---|
39 | task_set_affinity smp4 0x0e |
---|
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 |
---|