25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_arm_instr.c,v 1.74 2007/06/14 04:53:46 debug Exp $ |
* $Id: cpu_arm_instr.c,v 1.77 2007/06/28 13:36:46 debug Exp $ |
29 |
* |
* |
30 |
* ARM instructions. |
* ARM instructions. |
31 |
* |
* |
1569 |
} |
} |
1570 |
|
|
1571 |
if (rZ == 0) { |
if (rZ == 0) { |
1572 |
|
static int x = 0; |
1573 |
|
|
1574 |
/* Synch the program counter. */ |
/* Synch the program counter. */ |
1575 |
uint32_t low_pc = ((size_t)ic - (size_t) |
uint32_t low_pc = ((size_t)ic - (size_t) |
1576 |
cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call); |
cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call); |
1580 |
|
|
1581 |
/* Quasi-idle for a while: */ |
/* Quasi-idle for a while: */ |
1582 |
cpu->has_been_idling = 1; |
cpu->has_been_idling = 1; |
1583 |
if (cpu->machine->ncpus == 1) |
if (cpu->machine->ncpus == 1 && (++x) == 100) { |
1584 |
usleep(50); |
usleep(50); |
1585 |
cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT; |
x = 0; |
1586 |
|
} |
1587 |
|
|
1588 |
|
cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT / 6; |
1589 |
cpu->cd.arm.next_ic = ¬hing_call; |
cpu->cd.arm.next_ic = ¬hing_call; |
1590 |
return; |
return; |
1591 |
} |
} |
2533 |
|
|
2534 |
/* Read the instruction word from memory: */ |
/* Read the instruction word from memory: */ |
2535 |
page = cpu->cd.arm.host_load[addr >> 12]; |
page = cpu->cd.arm.host_load[addr >> 12]; |
2536 |
|
|
2537 |
if (page != NULL) { |
if (page != NULL) { |
2538 |
/* fatal("TRANSLATION HIT! 0x%08x\n", addr); */ |
/* fatal("TRANSLATION HIT! 0x%08x\n", addr); */ |
2539 |
memcpy(ib, page + (addr & 0xfff), sizeof(ib)); |
memcpy(ib, page + (addr & 0xfff), sizeof(ib)); |
2928 |
/* ic->f = cond_instr(mov); */ |
/* ic->f = cond_instr(mov); */ |
2929 |
ic->f = arm_dpi_instr[condition_code + 16*0xd]; |
ic->f = arm_dpi_instr[condition_code + 16*0xd]; |
2930 |
ic->arg[2] = (size_t)(&cpu->cd.arm.r[rd]); |
ic->arg[2] = (size_t)(&cpu->cd.arm.r[rd]); |
2931 |
p = cpu->cd.arm.host_load[a >> 12]; |
p = page; |
2932 |
if (p != NULL) { |
if (p != NULL) { |
2933 |
memcpy(c, p + (a & 0xfff), len); |
memcpy(c, p + (a & 0xfff), len); |
2934 |
} else { |
} else { |
2935 |
if (!cpu->memory_rw(cpu, cpu->mem, a, |
fatal("Hm? Internal error in " |
2936 |
c, len, MEM_READ, CACHE_DATA)) { |
"cpu_arm_instr.c!\n"); |
2937 |
if (!cpu->translation_readahead) |
goto bad; |
|
fatal("read failed X:" |
|
|
" TODO\n"); |
|
|
goto bad; |
|
|
} |
|
2938 |
} |
} |
2939 |
if (cpu->byte_order == EMUL_LITTLE_ENDIAN) |
if (cpu->byte_order == EMUL_LITTLE_ENDIAN) |
2940 |
x = c[0] + (c[1]<<8) + |
x = c[0] + (c[1]<<8) + |