Search
lxdream.org :: lxdream/src/mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.c
changeset 490:1e0f9940e064
prev488:d19a63e47cd9
next502:c4ecae2b1b5e
author nkeynes
date Sun Nov 04 08:49:18 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Fix pointer=>int conversions to use intptr_t types
file annotate diff log raw
1.1 --- a/src/mem.c Sun Nov 04 01:03:00 2007 +0000
1.2 +++ b/src/mem.c Sun Nov 04 08:49:18 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: mem.c,v 1.20 2007-11-04 01:03:00 nkeynes Exp $
1.6 + * $Id: mem.c,v 1.21 2007-11-04 08:49:18 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 @@ -45,7 +45,7 @@
1.11 struct mmio_region *io_rgn[MAX_IO_REGIONS];
1.12 struct mmio_region *P4_io[4096];
1.13
1.14 -int num_io_rgns = 0, num_mem_rgns = 0;
1.15 +uintptr_t num_io_rgns = 0, num_mem_rgns = 0;
1.16
1.17 void *mem_alloc_pages( int n )
1.18 {
1.19 @@ -356,7 +356,7 @@
1.20 char *mem_get_region( uint32_t addr )
1.21 {
1.22 char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
1.23 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
1.24 + if( ((uintptr_t)page) < MAX_IO_REGIONS ) { /* IO Region */
1.25 return NULL;
1.26 } else {
1.27 return page+(addr&0xFFF);
1.28 @@ -369,8 +369,8 @@
1.29 return P4_io[(addr&0x00FFFFFF)>>12];
1.30 }
1.31 char *page = page_map[(addr&0x1FFFFFFF)>>12];
1.32 - if( ((uint32_t)page) < MAX_IO_REGIONS ) {
1.33 - return io_rgn[(uint32_t)page];
1.34 + if( ((uintptr_t)page) < MAX_IO_REGIONS ) {
1.35 + return io_rgn[(uintptr_t)page];
1.36 } else {
1.37 return NULL;
1.38 }
.