25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: emul.c,v 1.255 2006/06/24 19:52:27 debug Exp $ |
* $Id: emul.c,v 1.260 2006/07/26 23:21:47 debug Exp $ |
29 |
* |
* |
30 |
* Emulation startup and misc. routines. |
* Emulation startup and misc. routines. |
31 |
*/ |
*/ |
1271 |
break; |
break; |
1272 |
|
|
1273 |
case ARCH_SH: |
case ARCH_SH: |
1274 |
if (cpu->cd.sh.bits == 32) |
if (cpu->cd.sh.cpu_type.bits == 32) |
1275 |
cpu->pc &= 0xffffffffULL; |
cpu->pc &= 0xffffffffULL; |
1276 |
cpu->pc &= ~1; |
cpu->pc &= ~1; |
1277 |
break; |
break; |
1279 |
case ARCH_SPARC: |
case ARCH_SPARC: |
1280 |
break; |
break; |
1281 |
|
|
1282 |
|
case ARCH_TRANSPUTER: |
1283 |
|
cpu->pc &= 0xffffffffULL; |
1284 |
|
break; |
1285 |
|
|
1286 |
case ARCH_X86: |
case ARCH_X86: |
1287 |
/* |
/* |
1288 |
* NOTE: The toc field is used to indicate an ELF32 |
* NOTE: The toc field is used to indicate an ELF32 |
1336 |
useremul_setup(cpu, n_load, load_names); |
useremul_setup(cpu, n_load, load_names); |
1337 |
|
|
1338 |
/* Startup the bootstrap CPU: */ |
/* Startup the bootstrap CPU: */ |
1339 |
cpu->bootstrap_cpu_flag = 1; |
cpu->running = 1; |
|
cpu->running = 1; |
|
1340 |
|
|
1341 |
/* ... or pause all CPUs, if start_paused is set: */ |
/* ... or pause all CPUs, if start_paused is set: */ |
1342 |
if (m->start_paused) { |
if (m->start_paused) { |
1585 |
go = 0; |
go = 0; |
1586 |
|
|
1587 |
/* Flush X11 and serial console output every now and then: */ |
/* Flush X11 and serial console output every now and then: */ |
1588 |
if (emuls[0]->machines[0]->ncycles > |
if (emuls[0]->machines[0]->ninstrs > |
1589 |
emuls[0]->machines[0]->ncycles_flush + (1<<18)) { |
emuls[0]->machines[0]->ninstrs_flush + (1<<19)) { |
1590 |
x11_check_event(emuls, n_emuls); |
x11_check_event(emuls, n_emuls); |
1591 |
console_flush(); |
console_flush(); |
1592 |
emuls[0]->machines[0]->ncycles_flush = |
emuls[0]->machines[0]->ninstrs_flush = |
1593 |
emuls[0]->machines[0]->ncycles; |
emuls[0]->machines[0]->ninstrs; |
1594 |
} |
} |
1595 |
|
|
1596 |
if (emuls[0]->machines[0]->ncycles > |
if (emuls[0]->machines[0]->ninstrs > |
1597 |
emuls[0]->machines[0]->ncycles_show + (1<<25)) { |
emuls[0]->machines[0]->ninstrs_show + (1<<25)) { |
1598 |
emuls[0]->machines[0]->ncycles_since_gettimeofday += |
emuls[0]->machines[0]->ninstrs_since_gettimeofday += |
1599 |
(emuls[0]->machines[0]->ncycles - |
(emuls[0]->machines[0]->ninstrs - |
1600 |
emuls[0]->machines[0]->ncycles_show); |
emuls[0]->machines[0]->ninstrs_show); |
1601 |
cpu_show_cycles(emuls[0]->machines[0], 0); |
cpu_show_cycles(emuls[0]->machines[0], 0); |
1602 |
emuls[0]->machines[0]->ncycles_show = |
emuls[0]->machines[0]->ninstrs_show = |
1603 |
emuls[0]->machines[0]->ncycles; |
emuls[0]->machines[0]->ninstrs; |
1604 |
} |
} |
1605 |
|
|
1606 |
if (single_step == ENTER_SINGLE_STEPPING) { |
if (single_step == ENTER_SINGLE_STEPPING) { |