--- trunk/src/cpus/cpu_arm.c 2007/10/08 16:20:48 31 +++ trunk/src/cpus/cpu_arm.c 2007/10/08 16:20:58 32 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: cpu_arm.c,v 1.61 2006/07/16 13:32:26 debug Exp $ + * $Id: cpu_arm.c,v 1.64 2006/09/09 09:04:32 debug Exp $ * * ARM CPU emulation. * @@ -46,6 +46,7 @@ #include "memory.h" #include "misc.h" #include "of.h" +#include "settings.h" #include "symbol.h" #define DYNTRANS_32 @@ -77,7 +78,7 @@ int arm_cpu_new(struct cpu *cpu, struct memory *mem, struct machine *machine, int cpu_id, char *cpu_type_name) { - int any_cache = 0, i, found; + int i, found; struct arm_cpu_type_def cpu_type_defs[] = ARM_CPU_TYPE_DEFS; /* Scan the list for this cpu type: */ @@ -103,6 +104,7 @@ cpu->cd.arm.cpu_type = cpu_type_defs[found]; cpu->name = cpu->cd.arm.cpu_type.name; cpu->is_32bit = 1; + cpu->byte_order = EMUL_LITTLE_ENDIAN; cpu->cd.arm.cpsr = ARM_FLAG_I | ARM_FLAG_F; cpu->cd.arm.control = ARM_CONTROL_PROG32 | ARM_CONTROL_DATA32 @@ -120,15 +122,15 @@ /* Only show name and caches etc for CPU nr 0: */ if (cpu_id == 0) { debug("%s", cpu->name); - if (cpu->cd.arm.cpu_type.icache_shift != 0) - any_cache = 1; - if (cpu->cd.arm.cpu_type.dcache_shift != 0) - any_cache = 1; - if (any_cache) { - debug(" (I+D = %i+%i KB", - (int)(1 << (cpu->cd.arm.cpu_type.icache_shift-10)), - (int)(1 << (cpu->cd.arm.cpu_type.dcache_shift-10))); - debug(")"); + if (cpu->cd.arm.cpu_type.icache_shift != 0 || + cpu->cd.arm.cpu_type.dcache_shift != 0) { + int isize = cpu->cd.arm.cpu_type.icache_shift; + int dsize = cpu->cd.arm.cpu_type.dcache_shift; + if (isize != 0) + isize = 1 << (isize - 10); + if (dsize != 0) + dsize = 1 << (dsize - 10); + debug(" (I+D = %i+%i KB)", isize, dsize); } } @@ -163,6 +165,10 @@ cpu->cd.arm.flags = cpu->cd.arm.cpsr >> 28; + CPU_SETTINGS_ADD_REGISTER64("pc", cpu->pc); + for (i=0; icd.arm.r[i]); + return 1; } @@ -302,36 +308,6 @@ } } - -/* - * arm_cpu_register_match(): - */ -void arm_cpu_register_match(struct machine *m, char *name, - int writeflag, uint64_t *valuep, int *match_register) -{ - int i, cpunr = 0; - - /* CPU number: */ - - /* TODO */ - - /* Register names: */ - for (i=0; icpus[cpunr]->cd.arm.r[i] = *valuep; - if (i == ARM_PC) - m->cpus[cpunr]->pc = *valuep; - } else { - *valuep = m->cpus[cpunr]->cd.arm.r[i]; - if (i == ARM_PC) - *valuep = m->cpus[cpunr]->pc; - } - *match_register = 1; - } - } -} - /* * arm_cpu_register_dump():