Search
lxdream.org :: lxdream/src/mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.c
changeset 422:61a0598e07ff
prev180:e6dcf9b65658
next461:63d4de8dcec6
author nkeynes
date Sat Oct 06 09:03:24 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
1.1 --- a/src/mem.c Sun Jul 02 04:59:00 2006 +0000
1.2 +++ b/src/mem.c Sat Oct 06 09:03:24 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: mem.c,v 1.14 2006-07-02 04:59:00 nkeynes Exp $
1.6 + * $Id: mem.c,v 1.15 2007-10-06 08:59: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 @@ -165,7 +165,6 @@
1.11 char *region;
1.12 int len = 4096, total = 0;
1.13 uint32_t addr = start;
1.14 - struct stat st;
1.15 FILE *f = fopen(file,"w");
1.16
1.17 if( f == NULL )
1.18 @@ -224,7 +223,7 @@
1.19 }
1.20
1.21 struct mem_region *mem_map_region( void *mem, uint32_t base, uint32_t size,
1.22 - char *name, int flags, uint32_t repeat_offset,
1.23 + const char *name, int flags, uint32_t repeat_offset,
1.24 uint32_t repeat_until )
1.25 {
1.26 int i;
1.27 @@ -244,12 +243,12 @@
1.28 return &mem_rgn[num_mem_rgns-1];
1.29 }
1.30
1.31 -void *mem_create_ram_region( uint32_t base, uint32_t size, char *name )
1.32 +void *mem_create_ram_region( uint32_t base, uint32_t size, const char *name )
1.33 {
1.34 return mem_create_repeating_ram_region( base, size, name, size, base );
1.35 }
1.36
1.37 -void *mem_create_repeating_ram_region( uint32_t base, uint32_t size, char *name,
1.38 +void *mem_create_repeating_ram_region( uint32_t base, uint32_t size, const char *name,
1.39 uint32_t repeat_offset, uint32_t repeat_until )
1.40 {
1.41 char *mem;
1.42 @@ -266,7 +265,7 @@
1.43 return mem;
1.44 }
1.45
1.46 -void *mem_load_rom( char *file, uint32_t base, uint32_t size, uint32_t crc )
1.47 +void *mem_load_rom( const gchar *file, uint32_t base, uint32_t size, uint32_t crc )
1.48 {
1.49 char *mem;
1.50 int fd;
1.51 @@ -285,7 +284,7 @@
1.52 mem_map_region( mem, base, size, file, MEM_FLAG_ROM, size, base );
1.53
1.54 /* CRC check */
1.55 - calc_crc = crc32(0L, mem, size);
1.56 + calc_crc = crc32(0L, (unsigned char *)mem, size);
1.57 if( calc_crc != crc ) {
1.58 WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
1.59 file, calc_crc, crc);
1.60 @@ -294,7 +293,7 @@
1.61 return mem;
1.62 }
1.63
1.64 -char *mem_get_region_by_name( char *name )
1.65 +char *mem_get_region_by_name( const char *name )
1.66 {
1.67 int i;
1.68 for( i=0; i<num_mem_rgns; i++ ) {
.