--- trunk/src/cpus/cpu_alpha.c 2007/10/08 16:20:26 28 +++ trunk/src/cpus/cpu_alpha.c 2007/10/08 16:20:58 32 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: cpu_alpha.c,v 1.19 2006/07/20 21:52:59 debug Exp $ + * $Id: cpu_alpha.c,v 1.23 2006/09/19 10:50:08 debug Exp $ * * Alpha CPU emulation. * @@ -44,6 +44,7 @@ #include "machine.h" #include "memory.h" #include "misc.h" +#include "settings.h" #include "symbol.h" #define DYNTRANS_8K @@ -77,6 +78,9 @@ if (cpu_type_defs[i].name == NULL) return 0; + cpu->is_32bit = 0; + cpu->byte_order = EMUL_LITTLE_ENDIAN; + cpu->memory_rw = alpha_memory_rw; cpu->run_instr = alpha_run_instr; cpu->translate_v2p = alpha_translate_v2p; @@ -84,7 +88,8 @@ cpu->invalidate_translation_caches = alpha_invalidate_translation_caches; cpu->invalidate_code_translation = alpha_invalidate_code_translation; - cpu->is_32bit = 0; + + cpu->cd.alpha.cpu_type = cpu_type_defs[i]; /* Only show name and caches etc for CPU nr 0: */ if (cpu_id == 0) { @@ -93,6 +98,21 @@ cpu->cd.alpha.r[ALPHA_SP] = 0xfffffc000000ff00ULL; + /* Set up dummy kentry pointers to something which crashes + the machine: */ + store_32bit_word(cpu, 0x10010, 0x3fffffc); + for (i=0; icd.alpha.kentry[i] = 0x10010; + + /* Bogus initial context (will be overwritten on first + context switch): */ + cpu->cd.alpha.ctx = 0x10100; + + CPU_SETTINGS_ADD_REGISTER64("pc", cpu->pc); + for (i=0; icd.alpha.r[i]); + return 1; } @@ -130,39 +150,6 @@ /* - * alpha_cpu_register_match(): - */ -void alpha_cpu_register_match(struct machine *m, char *name, - int writeflag, uint64_t *valuep, int *match_register) -{ - int i, cpunr = 0; - - /* CPU number: */ - - /* TODO */ - - if (strcasecmp(name, "pc") == 0) { - if (writeflag) { - m->cpus[cpunr]->pc = *valuep; - } else - *valuep = m->cpus[cpunr]->pc; - *match_register = 1; - } - - /* Register names: */ - for (i=0; icpus[cpunr]->cd.alpha.r[i] = *valuep; - else - *valuep = m->cpus[cpunr]->cd.alpha.r[i]; - *match_register = 1; - } - } -} - - -/* * alpha_cpu_register_dump(): * * Dump cpu registers in a relatively readable format. @@ -501,6 +488,7 @@ case 0x061: mnem = "amask"; break; case 0x064: mnem = "cmovle"; break; case 0x066: mnem = "cmovgt"; break; + case 0x06c: mnem = "implver"; break; default:debug("UNIMPLEMENTED opcode 0x%x func 0x%x\n", opcode, func); } @@ -519,6 +507,9 @@ else debug("mov\t%s,%s\n", alpha_regname[ra], alpha_regname[rc]); + } else if (func == 0x1ec) { + /* implver */ + debug("%s\t%s\n", mnem, alpha_regname[rc]); } else if (func & 0x80) debug("%s\t%s,0x%x,%s\n", mnem, alpha_regname[ra], (rb << 3) + (func >> 8),