revision 490:1e0f9940e064
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 490:1e0f9940e064 |
parent | 489:45c8ddcf52cb |
child | 491:515c81624943 |
author | nkeynes |
date | Sun Nov 04 08:49:18 2007 +0000 (14 years ago) |
Fix pointer=>int conversions to use intptr_t types
![]() | src/mem.c | view | annotate | diff | log | |
![]() | src/mmio.h | view | annotate | diff | log | |
![]() | src/sh4/sh4core.c | view | annotate | diff | log | |
![]() | src/sh4/sh4core.in | view | annotate | diff | log |
1.1 --- a/src/mem.c Sun Nov 04 05:07:49 2007 +00001.2 +++ b/src/mem.c Sun Nov 04 08:49:18 2007 +00001.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 memory1.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.14 -int num_io_rgns = 0, num_mem_rgns = 0;1.15 +uintptr_t num_io_rgns = 0, num_mem_rgns = 0;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 +00002.2 +++ b/src/mmio.h Sun Nov 04 08:49:18 2007 +00002.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 the2.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.13 extern struct mmio_region *io_rgn[];2.14 -extern int num_io_rgns;2.15 +extern uintptr_t num_io_rgns;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 +00003.2 +++ b/src/sh4/sh4core.c Sun Nov 04 08:49:18 2007 +00003.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 peripheral3.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 IO3.17 * region, fallback on the full-blown memory read3.18 */
4.1 --- a/src/sh4/sh4core.in Sun Nov 04 05:07:49 2007 +00004.2 +++ b/src/sh4/sh4core.in Sun Nov 04 08:49:18 2007 +00004.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 peripheral4.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 IO4.17 * region, fallback on the full-blown memory read4.18 */
.