changeset 2643:5ba0b3e7a0cb

* src/synth.c: Removed cyg_hal_sys_do_mmap() wrapper function. * tests/flash1.c, tests/flash2.c, tests/flash3.c: Fixed a few compiler warnings.
author asl
date Thu, 20 Nov 2008 19:17:27 +0000
parents 2c55567fff49
children 80c8675af39a
files packages/devs/flash/synthv2/current/ChangeLog packages/devs/flash/synthv2/current/src/synth.c packages/devs/flash/synthv2/current/tests/flash1.c packages/devs/flash/synthv2/current/tests/flash2.c packages/devs/flash/synthv2/current/tests/flash3.c
diffstat 5 files changed, 14 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/synthv2/current/ChangeLog
+++ b/packages/devs/flash/synthv2/current/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-19  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* src/synth.c: Removed cyg_hal_sys_do_mmap() wrapper function.
+	* tests/flash1.c, tests/flash2.c, tests/flash3.c:
+	Fixed a few compiler warnings.
+
 2004-12-02  Bart Veer  <bartv@ecoscentric.com>
 
 	* include/synth.h, src/synth.c: explicitly include
--- a/packages/devs/flash/synthv2/current/src/synth.c
+++ b/packages/devs/flash/synthv2/current/src/synth.c
@@ -64,25 +64,6 @@
 #define MIN(x,y) ((x)<(y) ? (x) : (y))
 #endif
 
-/* Helper function. The Linux system call cannot pass 6 parameters. Instead
-   a structure is filled in and passed as one parameter */
-static int 
-cyg_hal_sys_do_mmap(void *addr, unsigned long length, unsigned long prot, 
-                    unsigned long flags, unsigned long fd, unsigned long off)
-{
-
-    struct cyg_hal_sys_mmap_args args;
-  
-    args.addr = (unsigned long) addr;
-    args.len = length;
-    args.prot = prot = prot;
-    args.flags = flags;
-    args.fd = fd;
-    args.offset = off;
-
-    return (cyg_hal_sys_mmap(&args));
-}           
-
 static int
 synth_flash_init(struct cyg_flash_dev *dev)
 {
@@ -131,7 +112,7 @@ synth_flash_init(struct cyg_flash_dev *d
     if (dev->start != 0) {
         flags |= CYG_HAL_SYS_MAP_FIXED;
     }
-    base = (cyg_flashaddr_t)cyg_hal_sys_do_mmap( 
+    base = (cyg_flashaddr_t)cyg_hal_sys_mmap( 
         (void *)dev->start,
         priv->blocks * priv->block_size + 
         priv->boot_block_size * priv->boot_blocks,
--- a/packages/devs/flash/synthv2/current/tests/flash1.c
+++ b/packages/devs/flash/synthv2/current/tests/flash1.c
@@ -82,7 +82,9 @@ void cyg_user_start(void)
 void cyg_user_start(void)
 {
     int ret;
+#ifdef CYGHWR_IO_FLASH_DEVICE_LEGACY
     char data[1024];
+#endif
     void *flash_start, *flash_end;
     int block_size, blocks;
     char *prog_start;
@@ -138,7 +140,7 @@ void cyg_user_start(void)
     CYG_TEST_PASS_FAIL((ret == 0),"flash program overrun check");
 
     /* Program over a block boundary */
-    prog_start = (unsigned char *)flash_start + block_size - sizeof(copyright)/2;
+    prog_start = (char *)flash_start + block_size - sizeof(copyright)/2;
     ret = flash_program(prog_start,&copyright,sizeof(copyright),NULL);
     CYG_TEST_PASS_FAIL((ret == FLASH_ERR_OK),"flash_program2");
   
--- a/packages/devs/flash/synthv2/current/tests/flash2.c
+++ b/packages/devs/flash/synthv2/current/tests/flash2.c
@@ -104,7 +104,7 @@ void cyg_user_start(void)
       ret = cyg_flash_get_info(i, &info);
       if (ret == CYG_FLASH_ERR_OK) {
         diag_printf("INFO: Nth=%d, start=%p, end=%p\n",
-                    i, info.start, info.end);
+                    i, (void *) info.start, (void *) info.end);
         if (i == 0) {
           flash_start = info.start;
           flash_end = info.end;
@@ -112,7 +112,7 @@ void cyg_user_start(void)
           blocks = info.block_info[0].blocks;
         }
         for (j=0;j < info.num_block_infos; j++) {
-          diag_printf("INFO:\t block_size %d, blocks %d\n",
+          diag_printf("INFO:\t block_size %zd, blocks %u\n",
                       info.block_info[j].block_size,
                       info.block_info[j].blocks);
         }
--- a/packages/devs/flash/synthv2/current/tests/flash3.c
+++ b/packages/devs/flash/synthv2/current/tests/flash3.c
@@ -128,7 +128,7 @@ void cyg_user_start(void)
       ret = cyg_flash_get_info(i, &info);
       if (ret == CYG_FLASH_ERR_OK) {
         diag_printf("INFO: Nth=%d, start=%p, end=%p\n",
-                    i, info.start, info.end);
+                    i, (void *) info.start, (void *) info.end);
         if (i == 0) {
           flash_start = info.start;
           flash_end = info.end;
@@ -137,7 +137,7 @@ void cyg_user_start(void)
         }
         
         for (j=0;j < info.num_block_infos; j++) {
-          diag_printf("INFO:\t block_size %d, blocks %d\n",
+          diag_printf("INFO:\t block_size %zd, blocks %u\n",
                       info.block_info[j].block_size,
                       info.block_info[j].blocks);
         }