Search
lxdream.org :: lxdream :: r490:1e0f9940e064
lxdream 0.9.1
released Jun 29
Download Now
changeset490:1e0f9940e064
parent489:45c8ddcf52cb
child491:515c81624943
authornkeynes
dateSun Nov 04 08:49:18 2007 +0000 (11 years ago)
Fix pointer=>int conversions to use intptr_t types
src/mem.c
src/mmio.h
src/sh4/sh4core.c
src/sh4/sh4core.in
1.1 --- a/src/mem.c Sun Nov 04 05:07:49 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 }
2.1 --- a/src/mmio.h Sun Nov 04 05:07:49 2007 +0000
2.2 +++ b/src/mmio.h Sun Nov 04 08:49:18 2007 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: mmio.h,v 1.7 2007-10-31 09:05:44 nkeynes Exp $
2.6 + * $Id: mmio.h,v 1.8 2007-11-04 08:49:18 nkeynes Exp $
2.7 *
2.8 * mmio.h defines a complicated batch of macros used to build up the
2.9 * memory-mapped I/O regions in a reasonably readable fashion.
2.10 @@ -65,7 +65,7 @@
2.11 void register_io_regions( struct mmio_region **mmiolist );
2.12
2.13 extern struct mmio_region *io_rgn[];
2.14 -extern int num_io_rgns;
2.15 +extern uintptr_t num_io_rgns;
2.16
2.17 #define MMIO_READ( id, r ) *((int32_t *)(mmio_region_##id.mem + (r)))
2.18 #define MMIO_READF( id, r ) *((float *)(mmio_region_##id.mem + (r)))
3.1 --- a/src/sh4/sh4core.c Sun Nov 04 05:07:49 2007 +0000
3.2 +++ b/src/sh4/sh4core.c Sun Nov 04 08:49:18 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: sh4core.c,v 1.49 2007-10-08 12:06:01 nkeynes Exp $
3.6 + * $Id: sh4core.c,v 1.50 2007-11-04 08:49:18 nkeynes Exp $
3.7 *
3.8 * SH4 emulation core, and parent module for all the SH4 peripheral
3.9 * modules.
3.10 @@ -241,7 +241,7 @@
3.11 ir = sh4_icache[(pc&0xFFF)>>1];
3.12 } else {
3.13 sh4_icache = (uint16_t *)mem_get_page(pc);
3.14 - if( ((uint32_t)sh4_icache) < MAX_IO_REGIONS ) {
3.15 + if( ((uintptr_t)sh4_icache) < MAX_IO_REGIONS ) {
3.16 /* If someone's actually been so daft as to try to execute out of an IO
3.17 * region, fallback on the full-blown memory read
3.18 */
4.1 --- a/src/sh4/sh4core.in Sun Nov 04 05:07:49 2007 +0000
4.2 +++ b/src/sh4/sh4core.in Sun Nov 04 08:49:18 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: sh4core.in,v 1.9 2007-10-08 12:06:01 nkeynes Exp $
4.6 + * $Id: sh4core.in,v 1.10 2007-11-04 08:49:18 nkeynes Exp $
4.7 *
4.8 * SH4 emulation core, and parent module for all the SH4 peripheral
4.9 * modules.
4.10 @@ -241,7 +241,7 @@
4.11 ir = sh4_icache[(pc&0xFFF)>>1];
4.12 } else {
4.13 sh4_icache = (uint16_t *)mem_get_page(pc);
4.14 - if( ((uint32_t)sh4_icache) < MAX_IO_REGIONS ) {
4.15 + if( ((uintptr_t)sh4_icache) < MAX_IO_REGIONS ) {
4.16 /* If someone's actually been so daft as to try to execute out of an IO
4.17 * region, fallback on the full-blown memory read
4.18 */
.