1 #include "../macros.h" 2 3 int foo1(); 4 int foo2(); 5 void bar(); 6 int child1(); 7 int child2(); 8 int child3(); 9 int child4(); 10 int child5(); 11 12 int global; 13 start()14void start() 15 { 16 // Set the stack pointer 17 asm(" mov r13,#0x200000"); 18 PRINT_STR("hello\n"); 19 TRACE_INIT_NAME(701, "proc_foo"); 20 TRACE_INIT_NAME(702, "proc_bar"); 21 TRACE_SWITCH(701); 22 if (global++ > 0) 23 global++; 24 foo1(); 25 TRACE_SWITCH(702); 26 if (global++ > 0) 27 global++; 28 bar(); 29 TRACE_SWITCH(701); 30 if (global++ > 0) 31 global++; 32 foo2(); 33 TRACE_SWITCH(703); 34 if (global++ > 0) 35 global++; 36 foo1(); 37 TRACE_SWITCH(701); 38 if (global++ > 0) 39 global++; 40 foo1(); 41 42 TRACE_SWITCH(704); 43 if (global++ > 0) 44 global++; 45 foo1(); 46 47 TRACE_SWITCH(701); 48 if (global++ > 0) 49 global++; 50 foo1(); 51 52 TRACE_SWITCH(705); 53 if (global++ > 0) 54 global++; 55 foo1(); 56 57 TRACE_SWITCH(701); 58 if (global++ > 0) 59 global++; 60 foo1(); 61 62 TRACE_SWITCH(706); 63 if (global++ > 0) 64 global++; 65 foo1(); 66 67 TRACE_SWITCH(701); 68 if (global++ > 0) 69 global++; 70 foo1(); 71 72 TRACE_SWITCH(707); 73 if (global++ > 0) 74 global++; 75 foo1(); 76 77 TRACE_SWITCH(701); 78 if (global++ > 0) 79 global++; 80 foo1(); 81 82 TRACE_SWITCH(708); 83 if (global++ > 0) 84 global++; 85 foo1(); 86 87 TRACE_SWITCH(701); 88 if (global++ > 0) 89 global++; 90 foo1(); 91 92 TRACE_SWITCH(709); 93 if (global++ > 0) 94 global++; 95 foo1(); 96 97 TRACE_SWITCH(701); 98 if (global++ > 0) 99 global++; 100 foo1(); 101 102 TRACE_SWITCH(710); 103 if (global++ > 0) 104 global++; 105 foo1(); 106 107 TRACE_STOP_EMU(); 108 } 109 foo1()110int foo1() 111 { 112 int a = 0; 113 114 int ii; 115 for (ii = 0; ii < 3; ++ii) { 116 a += child1(); 117 a += child2(); 118 a += child3(); 119 } 120 return a; 121 } 122 foo2()123int foo2() 124 { 125 int a = 0; 126 127 int ii; 128 for (ii = 0; ii < 2; ++ii) { 129 a += child3(); 130 a += child4(); 131 a += child5(); 132 } 133 return a; 134 } 135 136 #define kStride 64 bar()137void bar() 138 { 139 int a = 0; 140 141 static char mem[1000 * kStride]; 142 143 int ii, jj; 144 145 for (ii = 0; ii < 4; ++ii) { 146 for (jj = 0; jj < 10; ++jj) 147 a += mem[jj * kStride]; 148 foo1(); 149 foo2(); 150 } 151 } 152 child1()153int child1() 154 { 155 int a = 0; 156 157 int ii; 158 for (ii = 0; ii < 2; ++ii) 159 a += ii; 160 return a; 161 } 162 child2()163int child2() 164 { 165 int a = 0; 166 167 int ii; 168 for (ii = 0; ii < 4; ++ii) 169 a += ii; 170 return a; 171 } 172 child3()173int child3() 174 { 175 int a = 0; 176 177 int ii; 178 for (ii = 0; ii < 6; ++ii) 179 a += ii; 180 return a; 181 } 182 child4()183int child4() 184 { 185 int a = 0; 186 187 int ii; 188 for (ii = 0; ii < 8; ++ii) 189 a += ii; 190 return a; 191 } 192 child5()193int child5() 194 { 195 int a = 0; 196 197 int ii; 198 for (ii = 0; ii < 10; ++ii) 199 a += ii; 200 return a; 201 } 202