--- upstream/dynamips-0.2.6-RC3/dev_c2691_iofpga.c 2007/10/06 16:06:49 4 +++ upstream/dynamips-0.2.7-RC1/dev_c2691_iofpga.c 2007/10/06 16:23:47 7 @@ -13,7 +13,8 @@ #include #include "ptask.h" -#include "mips64.h" +#include "cpu.h" +#include "vm.h" #include "dynamips.h" #include "memory.h" #include "device.h" @@ -85,7 +86,7 @@ * dev_c2691_iofpga_access() */ static void * -dev_c2691_iofpga_access(cpu_mips_t *cpu,struct vdevice *dev, +dev_c2691_iofpga_access(cpu_gen_t *cpu,struct vdevice *dev, m_uint32_t offset,u_int op_size,u_int op_type, m_uint64_t *data) { @@ -97,22 +98,22 @@ #if DEBUG_ACCESS if (op_type == MTS_READ) { cpu_log(cpu,"IO_FPGA","reading reg 0x%x at pc=0x%llx (size=%u)\n", - offset,cpu->pc,op_size); + offset,cpu_get_pc(cpu),op_size); } else { cpu_log(cpu,"IO_FPGA", "writing reg 0x%x at pc=0x%llx, data=0x%llx (size=%u)\n", - offset,cpu->pc,*data,op_size); + offset,cpu_get_pc(cpu),*data,op_size); } #endif switch(offset) { /* - * Platform type ? - * (other values than 0 cause crashes or lot of errors). + * Platform type ? + * 0x04 and 0x05 seem to work. */ case 0x36: if (op_type == MTS_READ) - *data = 0x0000; + *data = 0x04 << 5; break; /* Mainboard EEPROM */ @@ -277,11 +278,12 @@ if (op_type == MTS_READ) { cpu_log(cpu,"IO_FPGA", "read from unknown addr 0x%x, pc=0x%llx (size=%u)\n", - offset,cpu->pc,op_size); + offset,cpu_get_pc(cpu),op_size); } else { cpu_log(cpu,"IO_FPGA", "write to unknown addr 0x%x, value=0x%llx, " - "pc=0x%llx (size=%u)\n",offset,*data,cpu->pc,op_size); + "pc=0x%llx (size=%u)\n", + offset,*data,cpu_get_pc(cpu),op_size); } #endif }