diff -Naur dynamips-0.2.7/cpu.h dynamips-0.2.7-YLT/cpu.h
old
|
new
|
|
90 | 90 | void (*mmu_raw_dump)(cpu_gen_t *cpu); |
91 | 91 | void (*add_breakpoint)(cpu_gen_t *cpu,m_uint64_t addr); |
92 | 92 | void (*remove_breakpoint)(cpu_gen_t *cpu,m_uint64_t addr); |
93 | | void (*set_idle_pc)(cpu_gen_t *cpu,m_uint64_t addr); |
| 93 | void (*set_idle_pc)(cpu_gen_t *cpu,char* addr); |
94 | 94 | void (*get_idling_pc)(cpu_gen_t *cpu); |
95 | 95 | void (*mts_rebuild)(cpu_gen_t *cpu); |
96 | 96 | void (*mts_show_stats)(cpu_gen_t *cpu); |
diff -Naur dynamips-0.2.7/dev_c2600.c dynamips-0.2.7-YLT/dev_c2600.c
old
|
new
|
|
1360 | 1360 | |
1361 | 1361 | /* Copy some parameters from VM to CPU (idle PC, ...) */ |
1362 | 1362 | cpu->idle_pc = vm->idle_pc; |
| 1363 | cpu->num_idle_pc = vm->num_idle_pc; |
1363 | 1364 | |
1364 | 1365 | if (vm->timer_irq_check_itv) |
1365 | 1366 | cpu->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1503 | 1504 | vm->name,cpu->ia,vm->jit_use ? "en":"dis"); |
1504 | 1505 | |
1505 | 1506 | vm_log(vm,"C2600_BOOT", |
1506 | | "starting instance (CPU0 PC=0x%8.8x,idle_pc=0x%8.8x,JIT %s)\n", |
1507 | | cpu->ia,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1507 | "starting instance (CPU0 PC=0x%8.8x,JIT %s)\n", |
| 1508 | cpu->ia,vm->jit_use ? "on":"off"); |
1508 | 1509 | |
1509 | 1510 | /* Start main CPU */ |
1510 | 1511 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_c2691.c dynamips-0.2.7-YLT/dev_c2691.c
old
|
new
|
|
1153 | 1153 | |
1154 | 1154 | /* Copy some parameters from VM to CPU (idle PC, ...) */ |
1155 | 1155 | cpu->idle_pc = vm->idle_pc; |
| 1156 | cpu->num_idle_pc = vm->num_idle_pc; |
1156 | 1157 | |
1157 | 1158 | if (vm->timer_irq_check_itv) |
1158 | 1159 | cpu->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1263 | 1264 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
1264 | 1265 | |
1265 | 1266 | vm_log(vm,"C2691_BOOT", |
1266 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
1267 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1267 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 1268 | cpu->pc,vm->jit_use ? "on":"off"); |
1268 | 1269 | |
1269 | 1270 | /* Start main CPU */ |
1270 | 1271 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_c3600.c dynamips-0.2.7-YLT/dev_c3600.c
old
|
new
|
|
1323 | 1323 | |
1324 | 1324 | /* Copy some parameters from VM to CPU (idle PC, ...) */ |
1325 | 1325 | cpu->idle_pc = vm->idle_pc; |
| 1326 | cpu->num_idle_pc = vm->num_idle_pc; |
1326 | 1327 | |
1327 | 1328 | if (vm->timer_irq_check_itv) |
1328 | 1329 | cpu->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1440 | 1441 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
1441 | 1442 | |
1442 | 1443 | vm_log(vm,"C3600_BOOT", |
1443 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
1444 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1444 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 1445 | cpu->pc,vm->jit_use ? "on":"off"); |
1445 | 1446 | |
1446 | 1447 | /* Start main CPU */ |
1447 | 1448 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_c3725.c dynamips-0.2.7-YLT/dev_c3725.c
old
|
new
|
|
1167 | 1167 | |
1168 | 1168 | /* Copy some parameters from VM to CPU (idle PC, ...) */ |
1169 | 1169 | cpu->idle_pc = vm->idle_pc; |
| 1170 | cpu->num_idle_pc = vm->num_idle_pc; |
1170 | 1171 | |
1171 | 1172 | if (vm->timer_irq_check_itv) |
1172 | 1173 | cpu->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1277 | 1278 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
1278 | 1279 | |
1279 | 1280 | vm_log(vm,"C3725_BOOT", |
1280 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
1281 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1281 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 1282 | cpu->pc,vm->jit_use ? "on":"off"); |
1282 | 1283 | |
1283 | 1284 | /* Start main CPU */ |
1284 | 1285 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_c3745.c dynamips-0.2.7-YLT/dev_c3745.c
old
|
new
|
|
1207 | 1207 | |
1208 | 1208 | /* Copy some parameters from VM to CPU (idle PC, ...) */ |
1209 | 1209 | cpu->idle_pc = vm->idle_pc; |
| 1210 | cpu->num_idle_pc = vm->num_idle_pc; |
1210 | 1211 | |
1211 | 1212 | if (vm->timer_irq_check_itv) |
1212 | 1213 | cpu->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1317 | 1318 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
1318 | 1319 | |
1319 | 1320 | vm_log(vm,"C3745_BOOT", |
1320 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
1321 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1321 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 1322 | cpu->pc,vm->jit_use ? "on":"off"); |
1322 | 1323 | |
1323 | 1324 | /* Start main CPU */ |
1324 | 1325 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_c7200.c dynamips-0.2.7-YLT/dev_c7200.c
old
|
new
|
|
2072 | 2072 | |
2073 | 2073 | /* Copy some parameters from VM to CPU0 (idle PC, ...) */ |
2074 | 2074 | cpu0->idle_pc = vm->idle_pc; |
| 2075 | cpu0->num_idle_pc = vm->num_idle_pc; |
2075 | 2076 | |
2076 | 2077 | if (vm->timer_irq_check_itv) |
2077 | 2078 | cpu0->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
2193 | 2194 | |
2194 | 2195 | /* Copy some parameters from VM to CPU0 (idle PC, ...) */ |
2195 | 2196 | cpu0->idle_pc = vm->idle_pc; |
| 2197 | cpu0->num_idle_pc = vm->num_idle_pc; |
2196 | 2198 | |
2197 | 2199 | if (vm->timer_irq_check_itv) |
2198 | 2200 | cpu0->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
2314 | 2316 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
2315 | 2317 | |
2316 | 2318 | vm_log(vm,"C7200_BOOT", |
2317 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
2318 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 2319 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 2320 | cpu->pc,vm->jit_use ? "on":"off"); |
2319 | 2321 | |
2320 | 2322 | /* Start main CPU */ |
2321 | 2323 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
… |
… |
|
2364 | 2366 | vm->name,cpu->ia,vm->jit_use ? "en":"dis"); |
2365 | 2367 | |
2366 | 2368 | vm_log(vm,"C7200P_BOOT", |
2367 | | "starting instance (CPU0 IA=0x%8.8x,idle_pc=0x%8.8x,JIT %s)\n", |
2368 | | cpu->ia,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 2369 | "starting instance (CPU0 IA=0x%8.8x,JIT %s)\n", |
| 2370 | cpu->ia,vm->jit_use ? "on":"off"); |
2369 | 2371 | |
2370 | 2372 | /* Start main CPU */ |
2371 | 2373 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dev_msfc1.c dynamips-0.2.7-YLT/dev_msfc1.c
old
|
new
|
|
1220 | 1220 | |
1221 | 1221 | /* Copy some parameters from VM to CPU0 (idle PC, ...) */ |
1222 | 1222 | cpu0->idle_pc = vm->idle_pc; |
| 1223 | cpu0->num_idle_pc = vm->num_idle_pc; |
1223 | 1224 | |
1224 | 1225 | if (vm->timer_irq_check_itv) |
1225 | 1226 | cpu0->timer_irq_check_itv = vm->timer_irq_check_itv; |
… |
… |
|
1326 | 1327 | vm->name,cpu->pc,vm->jit_use ? "en":"dis"); |
1327 | 1328 | |
1328 | 1329 | vm_log(vm,"MSFC1_BOOT", |
1329 | | "starting instance (CPU0 PC=0x%llx,idle_pc=0x%llx,JIT %s)\n", |
1330 | | cpu->pc,cpu->idle_pc,vm->jit_use ? "on":"off"); |
| 1330 | "starting instance (CPU0 PC=0x%llx,JIT %s)\n", |
| 1331 | cpu->pc,vm->jit_use ? "on":"off"); |
1331 | 1332 | |
1332 | 1333 | /* Start main CPU */ |
1333 | 1334 | if (vm->ghost_status != VM_GHOST_RAM_GENERATE) { |
diff -Naur dynamips-0.2.7/dynamips.c dynamips-0.2.7-YLT/dynamips.c
old
|
new
|
|
818 | 818 | } |
819 | 819 | } |
820 | 820 | |
| 821 | /* slices the val values into idle_pc values, and set them to the vm */ |
| 822 | static void set_idle_pc(vm_instance_t *vm, char *val) { |
| 823 | char *tmp_val; |
| 824 | int len = 0; |
| 825 | /* find out how many the string length */ |
| 826 | while (val[len] != '\0') |
| 827 | len += 1; |
| 828 | int i = 0; |
| 829 | int num_val = 1; |
| 830 | /* find out how many idle_pc values we have in the string */ |
| 831 | while (i < len) { |
| 832 | if (val[i] == ',') |
| 833 | num_val += 1; |
| 834 | i += 1; |
| 835 | } |
| 836 | vm->num_idle_pc = num_val; |
| 837 | vm->idle_pc = (m_uint64_t*)malloc(num_val*sizeof(unsigned long long int)); |
| 838 | |
| 839 | i = 0; |
| 840 | int current_val_idx = 0; |
| 841 | /* slice the string, and assign each individual idle_pc values */ |
| 842 | while (i < len) { |
| 843 | tmp_val = (char *) malloc((len+1)*sizeof(char)); |
| 844 | int j = 0; |
| 845 | while ((i < len)&&(val[i] != ',')) { |
| 846 | tmp_val[j] = val[i]; |
| 847 | i += 1; |
| 848 | j += 1; |
| 849 | } |
| 850 | tmp_val[j] = '\0'; |
| 851 | vm->idle_pc[current_val_idx] = strtoull(tmp_val, NULL, 0); |
| 852 | current_val_idx += 1; |
| 853 | i += 1; |
| 854 | free(tmp_val); |
| 855 | } |
| 856 | } |
| 857 | |
| 858 | |
821 | 859 | /* Parse the command line */ |
822 | 860 | static int parse_std_cmd_line(int argc,char *argv[],int *platform) |
823 | 861 | { |
… |
… |
|
941 | 979 | |
942 | 980 | /* Idle PC */ |
943 | 981 | case OPT_IDLE_PC: |
944 | | vm->idle_pc = strtoull(optarg,NULL,0); |
945 | | printf("Idle PC set to 0x%llx.\n",vm->idle_pc); |
| 982 | set_idle_pc(vm, optarg); |
946 | 983 | break; |
947 | 984 | |
948 | 985 | /* Timer IRQ check interval */ |
diff -Naur dynamips-0.2.7/hv_vm.c dynamips-0.2.7-YLT/hv_vm.c
old
|
new
|
|
219 | 219 | if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
220 | 220 | return(-1); |
221 | 221 | |
222 | | vm->idle_pc = strtoull(argv[1],NULL,0); |
| 222 | char *tmp_val; |
| 223 | int len = 0; |
| 224 | /* find out how many the string length */ |
| 225 | while (argv[1][len] != '\0') |
| 226 | len += 1; |
| 227 | int i = 0; |
| 228 | int num_val = 1; |
| 229 | /* find out how many idle_pc values we have in the string */ |
| 230 | while (i < len) { |
| 231 | if (argv[1][i] == ',') |
| 232 | num_val += 1; |
| 233 | i += 1; |
| 234 | } |
| 235 | vm->num_idle_pc = num_val; |
| 236 | vm->idle_pc = (m_uint64_t*)malloc(num_val*sizeof(unsigned long long int)); |
| 237 | |
| 238 | i = 0; |
| 239 | int current_val_idx = 0; |
| 240 | while (i < len) { |
| 241 | tmp_val = (char *) malloc((len+1)*sizeof(char)); |
| 242 | int j = 0; |
| 243 | while ((i < len)&&(argv[1][i] != ',')) { |
| 244 | tmp_val[j] = argv[1][i]; |
| 245 | i += 1; |
| 246 | j += 1; |
| 247 | } |
| 248 | tmp_val[j] = '\0'; |
| 249 | vm->idle_pc[current_val_idx] = strtoull(tmp_val, NULL, 0); |
| 250 | current_val_idx += 1; |
| 251 | i += 1; |
| 252 | free(tmp_val); |
| 253 | } |
| 254 | |
223 | 255 | |
224 | 256 | vm_release(vm); |
225 | 257 | hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
… |
… |
|
239 | 271 | if (!(cpu = find_cpu(conn,vm,atoi(argv[1])))) |
240 | 272 | return(-1); |
241 | 273 | |
242 | | cpu->set_idle_pc(cpu,strtoull(argv[2],NULL,0)); |
| 274 | cpu->set_idle_pc(cpu,argv[2]); |
243 | 275 | |
244 | 276 | vm_release(vm); |
245 | 277 | hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
246 | 278 | return(0); |
247 | 279 | } |
248 | 280 | |
| 281 | |
249 | 282 | /* Get the idle PC proposals */ |
250 | 283 | static int cmd_get_idle_pc_prop(hypervisor_conn_t *conn,int argc,char *argv[]) |
251 | 284 | { |
diff -Naur dynamips-0.2.7/mips64.c dynamips-0.2.7-YLT/mips64.c
old
|
new
|
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /* Set idle PC value */ |
141 | | void mips64_set_idle_pc(cpu_gen_t *cpu,m_uint64_t addr) |
| 141 | void mips64_set_idle_pc(cpu_gen_t *cpu,char* addr) |
142 | 142 | { |
143 | | CPU_MIPS64(cpu)->idle_pc = addr; |
| 143 | char *tmp_val; |
| 144 | int len = 0; |
| 145 | /* find out how many the string length */ |
| 146 | while (addr[len] != '\0') |
| 147 | len += 1; |
| 148 | int i = 0; |
| 149 | int num_val = 1; |
| 150 | /* find out how many idle_pc values we have in the string */ |
| 151 | while (i < len) { |
| 152 | if (addr[i] == ',') |
| 153 | num_val += 1; |
| 154 | i += 1; |
| 155 | } |
| 156 | CPU_MIPS64(cpu)->num_idle_pc = num_val; |
| 157 | CPU_MIPS64(cpu)->idle_pc = (m_uint64_t*)malloc(num_val*sizeof(unsigned long long int)); |
| 158 | |
| 159 | i = 0; |
| 160 | int current_val_idx = 0; |
| 161 | /* slice the string, and assign each individual idle_pc values */ |
| 162 | while (i < len) { |
| 163 | tmp_val = (char *) malloc((len+1)*sizeof(char)); |
| 164 | int j = 0; |
| 165 | while ((i < len)&&(addr[i] != ',')) { |
| 166 | tmp_val[j] = addr[i]; |
| 167 | i += 1; |
| 168 | j += 1; |
| 169 | } |
| 170 | tmp_val[j] = '\0'; |
| 171 | CPU_MIPS64(cpu)->idle_pc[current_val_idx] = (m_uint32_t) strtoull(tmp_val, NULL, 0); |
| 172 | current_val_idx += 1; |
| 173 | i += 1; |
| 174 | free(tmp_val); |
| 175 | } |
144 | 176 | } |
145 | 177 | |
146 | 178 | /* Timer IRQ */ |
diff -Naur dynamips-0.2.7/mips64.h dynamips-0.2.7-YLT/mips64.h
old
|
new
|
|
389 | 389 | insn_exec_page_t *exec_page_free_list; |
390 | 390 | insn_exec_page_t *exec_page_array; |
391 | 391 | |
392 | | /* Idle PC value */ |
393 | | volatile m_uint64_t idle_pc; |
| 392 | /* Idle PC value array */ |
| 393 | volatile m_uint64_t* idle_pc; |
| 394 | |
| 395 | /* Number of Idle PC value */ |
| 396 | volatile int num_idle_pc; |
394 | 397 | |
395 | 398 | /* Timer IRQs */ |
396 | 399 | volatile u_int timer_irq_pending; |
… |
… |
|
479 | 482 | void mips64_set_prid(cpu_mips_t *cpu,m_uint32_t prid); |
480 | 483 | |
481 | 484 | /* Set idle PC value */ |
482 | | void mips64_set_idle_pc(cpu_gen_t *cpu,m_uint64_t addr); |
| 485 | void mips64_set_idle_pc(cpu_gen_t *cpu,char* addr); |
483 | 486 | |
484 | 487 | /* Timer IRQ */ |
485 | 488 | void *mips64_timer_irq_run(cpu_mips_t *cpu); |
diff -Naur dynamips-0.2.7/mips64_jit.c dynamips-0.2.7-YLT/mips64_jit.c
old
|
new
|
|
748 | 748 | cpu->perf_counter++; |
749 | 749 | #endif |
750 | 750 | /* Handle virtual idle loop */ |
751 | | if (unlikely(cpu->pc == cpu->idle_pc)) { |
752 | | if (++gen->idle_count == gen->idle_max) { |
753 | | cpu_idle_loop(gen); |
754 | | gen->idle_count = 0; |
755 | | } |
| 751 | int i; |
| 752 | for (i = 0; i < cpu->num_idle_pc; i++) { |
| 753 | if (unlikely(cpu->pc == cpu->idle_pc[i])) { |
| 754 | if (++gen->idle_count == gen->idle_max) { |
| 755 | cpu_idle_loop(gen); |
| 756 | gen->idle_count = 0; |
| 757 | } |
| 758 | } |
756 | 759 | } |
757 | 760 | |
758 | 761 | /* Handle the virtual CPU clock */ |
diff -Naur dynamips-0.2.7/ppc32.c dynamips-0.2.7-YLT/ppc32.c
old
|
new
|
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /* Set idle PC value */ |
95 | | void ppc32_set_idle_pc(cpu_gen_t *cpu,m_uint64_t addr) |
| 95 | void ppc32_set_idle_pc(cpu_gen_t *cpu, char* addr) |
96 | 96 | { |
97 | | CPU_PPC32(cpu)->idle_pc = (m_uint32_t)addr; |
| 97 | char *tmp_val; |
| 98 | int len = 0; |
| 99 | /* find out how many the string length */ |
| 100 | while (addr[len] != '\0') |
| 101 | len += 1; |
| 102 | int i = 0; |
| 103 | int num_val = 1; |
| 104 | /* find out how many idle_pc values we have in the string */ |
| 105 | while (i < len) { |
| 106 | if (addr[i] == ',') |
| 107 | num_val += 1; |
| 108 | i += 1; |
| 109 | } |
| 110 | CPU_PPC32(cpu)->num_idle_pc = num_val; |
| 111 | CPU_PPC32(cpu)->idle_pc = (m_uint64_t*)malloc(num_val*sizeof(unsigned long long int)); |
| 112 | |
| 113 | i = 0; |
| 114 | int current_val_idx = 0; |
| 115 | /* slice the string, and assign each individual idle_pc values */ |
| 116 | while (i < len) { |
| 117 | tmp_val = (char *) malloc((len+1)*sizeof(char)); |
| 118 | int j = 0; |
| 119 | while ((i < len)&&(addr[i] != ',')) { |
| 120 | tmp_val[j] = addr[i]; |
| 121 | i += 1; |
| 122 | j += 1; |
| 123 | } |
| 124 | tmp_val[j] = '\0'; |
| 125 | CPU_PPC32(cpu)->idle_pc[current_val_idx] = (m_uint32_t) strtoull(tmp_val, NULL, 0); |
| 126 | current_val_idx += 1; |
| 127 | i += 1; |
| 128 | free(tmp_val); |
| 129 | } |
98 | 130 | } |
99 | 131 | |
100 | 132 | /* Timer IRQ */ |
diff -Naur dynamips-0.2.7/ppc32.h dynamips-0.2.7-YLT/ppc32.h
old
|
new
|
|
336 | 336 | insn_exec_page_t *exec_page_free_list; |
337 | 337 | insn_exec_page_t *exec_page_array; |
338 | 338 | |
339 | | /* Idle PC value */ |
340 | | volatile m_uint32_t idle_pc; |
| 339 | /* Array Idle PC value */ |
| 340 | volatile m_uint32_t* idle_pc; |
| 341 | |
| 342 | /* Number of idle_pc values */ |
| 343 | volatile int num_idle_pc; |
341 | 344 | |
342 | 345 | /* Timer IRQs */ |
343 | 346 | volatile u_int timer_irq_pending,timer_irq_armed; |
… |
… |
|
489 | 492 | void ppc32_set_pvr(cpu_ppc_t *cpu,m_uint32_t pvr); |
490 | 493 | |
491 | 494 | /* Set idle PC value */ |
492 | | void ppc32_set_idle_pc(cpu_gen_t *cpu,m_uint64_t addr); |
| 495 | void ppc32_set_idle_pc(cpu_gen_t *cpu, char* addr); |
493 | 496 | |
494 | 497 | /* Timer IRQ */ |
495 | 498 | void *ppc32_timer_irq_run(cpu_ppc_t *cpu); |
diff -Naur dynamips-0.2.7/ppc32_jit.c dynamips-0.2.7-YLT/ppc32_jit.c
old
|
new
|
|
1239 | 1239 | cpu->perf_counter++; |
1240 | 1240 | #endif |
1241 | 1241 | /* Handle virtual idle loop */ |
1242 | | if (unlikely(cpu->ia == cpu->idle_pc)) { |
1243 | | if (++gen->idle_count == gen->idle_max) { |
1244 | | cpu_idle_loop(gen); |
1245 | | gen->idle_count = 0; |
1246 | | } |
| 1242 | int i; |
| 1243 | for (i = 0; i < cpu->num_idle_pc; i++) { |
| 1244 | if (unlikely(cpu->ia == cpu->idle_pc[i])) { |
| 1245 | if (++gen->idle_count == gen->idle_max) { |
| 1246 | cpu_idle_loop(gen); |
| 1247 | gen->idle_count = 0; |
| 1248 | } |
| 1249 | } |
1247 | 1250 | } |
1248 | 1251 | |
1249 | 1252 | /* Handle the virtual CPU clock */ |
diff -Naur dynamips-0.2.7/vm.c dynamips-0.2.7-YLT/vm.c
old
|
new
|
|
396 | 396 | vm->vtty_aux_type = VTTY_TYPE_NONE; |
397 | 397 | vm->timer_irq_check_itv = VM_TIMER_IRQ_CHECK_ITV; |
398 | 398 | vm->log_file_enabled = TRUE; |
| 399 | vm->num_idle_pc = 0; |
399 | 400 | |
400 | 401 | if (!(vm->name = strdup(name))) { |
401 | 402 | fprintf(stderr,"VM %s: unable to store instance name!\n",name); |
diff -Naur dynamips-0.2.7/vm.h dynamips-0.2.7-YLT/vm.h
old
|
new
|
|
148 | 148 | /* Timer IRQ interval check */ |
149 | 149 | u_int timer_irq_check_itv; |
150 | 150 | |
151 | | /* "idling" pointer counter */ |
152 | | m_uint64_t idle_pc; |
| 151 | /* "idling" pointer counter array*/ |
| 152 | m_uint64_t* idle_pc; |
| 153 | |
| 154 | /* number of idle_pc values */ |
| 155 | int num_idle_pc; |
153 | 156 | |
154 | 157 | /* JIT block direct jumps */ |
155 | 158 | int exec_blk_direct_jump; |
… |
… |
|
180 | 183 | |
181 | 184 | /* VM objects */ |
182 | 185 | struct vm_obj *vm_object_list; |
| 186 | |
183 | 187 | }; |
184 | 188 | |
185 | 189 | #define VM_C7200(vm) ((c7200_t *)vm->hw_data) |