Search
lxdream.org :: lxdream/src/mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.c
changeset 156:3b93648a3b07
prev146:f91fa34ab219
next180:e6dcf9b65658
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/mem.c Sat May 20 02:38:58 2006 +0000
1.2 +++ b/src/mem.c Thu Jun 15 10:25:45 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: mem.c,v 1.12 2006-05-20 02:38:58 nkeynes Exp $
1.6 + * $Id: mem.c,v 1.13 2006-06-15 10:25:42 nkeynes Exp $
1.7 * mem.c is responsible for creating and maintaining the overall system memory
1.8 * map, as visible from the SH4 processor.
1.9 *
1.10 @@ -356,3 +356,23 @@
1.11 }
1.12 }
1.13
1.14 +struct mmio_region *mem_get_io_region( uint32_t addr )
1.15 +{
1.16 + if( addr > 0xFF000000 ) {
1.17 + return P4_io[(addr&0x00FFFFFF)>>12];
1.18 + }
1.19 + char *page = page_map[(addr&0x1FFFFFFF)>>12];
1.20 + if( ((uint32_t)page) < MAX_IO_REGIONS ) {
1.21 + return io_rgn[(uint32_t)page];
1.22 + } else {
1.23 + return NULL;
1.24 + }
1.25 +}
1.26 +
1.27 +void mem_set_trace( uint32_t addr, int flag )
1.28 +{
1.29 + struct mmio_region *region = mem_get_io_region(addr);
1.30 + if( region != NULL )
1.31 + region->trace_flag = flag;
1.32 +}
1.33 +
.