--- trunk/src/devices/dev_sgi_ip32.c 2007/10/08 16:19:05 17 +++ trunk/src/devices/dev_sgi_ip32.c 2007/10/08 16:19:11 18 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_sgi_ip32.c,v 1.32 2005/08/19 09:43:35 debug Exp $ + * $Id: dev_sgi_ip32.c,v 1.34 2005/10/27 14:01:14 debug Exp $ * * SGI IP32 devices. * @@ -110,23 +110,22 @@ uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *extra) { - int i; struct crime_data *d = extra; - uint64_t idata; + uint64_t idata = 0; + int i; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); /* * Set crime version/revision: * - * This might not be the most elegant or correct solution, - * but it seems that the IP32 PROM likes 0x11 for machines - * without graphics, and 0xa1 for machines with graphics. - * - * NetBSD 2.0 complains about "unknown" crime for 0x11, - * but I guess that's something one has to live with. + * This might not be the most elegant or correct solution, but it + * seems that the IP32 PROM likes 0x11 for machines without graphics, + * and 0xa1 for machines with graphics. * - * (TODO?) + * NetBSD 2.0 complains about "unknown" crime for 0x11, but I guess + * that's something one has to live with. (TODO?) */ d->reg[4] = 0x00; d->reg[5] = 0x00; d->reg[6] = 0x00; d->reg[7] = d->use_fb? 0xa1 : 0x11; @@ -344,7 +343,9 @@ uint64_t idata = 0, odata=0; int regnr, res = 1; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); + regnr = relative_addr / sizeof(uint32_t); /* Read from/write to the macepci: */ @@ -775,7 +776,9 @@ uint64_t idata = 0, odata = 0; int regnr; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); + regnr = relative_addr / sizeof(uint64_t); /* Treat most registers as read/write, by default. */