--- trunk/src/devices/dev_mp.c 2007/10/08 16:18:19 8 +++ trunk/src/devices/dev_mp.c 2007/10/08 16:19:11 18 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_mp.c,v 1.27 2005/06/11 20:51:41 debug Exp $ + * $Id: dev_mp.c,v 1.29 2005/10/26 14:37:04 debug Exp $ * * This is a fake multiprocessor (MP) device. It can be useful for * theoretical experiments, but probably bares no resemblance to any @@ -70,7 +70,8 @@ int i, which_cpu; uint64_t idata = 0, odata = 0; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); /* * NOTE: It is up to the user of this device to read or write @@ -221,6 +222,15 @@ cpu_interrupt_ack(d->cpus[cpu->cpu_id], MIPS_IPI_INT); break; + case DEV_MP_NCYCLES: + /* + * Return approximately the number of cycles executed + * in this machine. (This value is not updated for each + * instruction.) + */ + odata = cpu->machine->ncycles; + break; + default: fatal("[ dev_mp: unimplemented relative addr 0x%x ]\n", relative_addr);