Search
lxdream.org :: lxdream/src/sh4/sh4mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4mem.c
changeset 156:3b93648a3b07
prev150:c728a442b43f
next165:126794f2ea6d
author nkeynes
date Thu Jun 15 10:25:45 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add P4 I/O tracing
Add ability to set I/O trace by region address
file annotate diff log raw
1.1 --- a/src/sh4/sh4mem.c Tue May 23 13:10:28 2006 +0000
1.2 +++ b/src/sh4/sh4mem.c Thu Jun 15 10:25:45 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4mem.c,v 1.11 2006-05-23 13:10:28 nkeynes Exp $
1.6 + * $Id: sh4mem.c,v 1.12 2006-06-15 10:25:45 nkeynes Exp $
1.7 * sh4mem.c is responsible for the SH4's access to memory (including memory
1.8 * mapped I/O), using the page maps created in mem.c
1.9 *
1.10 @@ -53,6 +53,10 @@
1.11 TRACE( str " [%s.%s: %s]", __VA_ARGS__, \
1.12 MMIO_NAME_BYNUM((uint32_t)p), MMIO_REGID_BYNUM((uint32_t)p, r), \
1.13 MMIO_REGDESC_BYNUM((uint32_t)p, r) )
1.14 +#define TRACE_P4IO( str, io, r, ... ) if(io->trace_flag) \
1.15 +TRACE( str " [%s.%s: %s]", __VA_ARGS__, \
1.16 + io->id, MMIO_REGID_IOBYNUM(io, r), \
1.17 + MMIO_REGDESC_IOBYNUM(io, r) )
1.18
1.19 extern struct mem_region mem_rgn[];
1.20 extern struct mmio_region *P4_io[];
1.21 @@ -64,7 +68,9 @@
1.22 ERROR( "Attempted read from unknown P4 region: %08X", addr );
1.23 return 0;
1.24 } else {
1.25 - return io->io_read( addr&0xFFF );
1.26 + int32_t val = io->io_read( addr&0xFFF );
1.27 + TRACE_P4IO( "Long read %08X <= %08X", io, (addr&0xFFF), val, addr );
1.28 + return val;
1.29 }
1.30 }
1.31
1.32 @@ -81,6 +87,7 @@
1.33 ERROR( "Attempted write to unknown P4 region: %08X", addr );
1.34 }
1.35 } else {
1.36 + TRACE_P4IO( "Long write %08X => %08X", io, (addr&0xFFF), val, addr );
1.37 io->io_write( addr&0xFFF, val );
1.38 }
1.39 }
.