changeset 1855:6535959b8edf

Updates required by GCC v4 - from Andrea Michelotti <amichelotti@atmel.com>
author gthomas
date Fri, 03 Dec 2004 12:22:41 +0000
parents 72e8af9191e0
children 15dd41bdd560
files packages/redboot/current/ChangeLog packages/redboot/current/src/main.c packages/redboot/current/src/mcmp.c packages/redboot/current/src/mfill.c
diffstat 4 files changed, 53 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-01  Andrea Michelotti  <amichelotti@atmel.com>
+
+	* main.c :
+	* mfill.c: 
+	* mcmp.c : Changes required for use with GCC v4 - cast as lvalue
+	is no longer supported.
+
 2004-11-09  Ian Campbell  <icampbell@arcom.com>
 
 	* cdl/redboot.cdl, doc/redboot_cmds.sgml, src/iomem.c: Add support
--- a/packages/redboot/current/src/main.c
+++ b/packages/redboot/current/src/main.c
@@ -240,6 +240,7 @@ static void error_handler(void)
 //
 // This is the main entry point for RedBoot
 //
+
 void
 cyg_start(void)
 {
@@ -324,6 +325,7 @@ cyg_start(void)
 #endif
 
 #ifdef CYGSEM_REDBOOT_PLF_STARTUP
+
     cyg_plf_redboot_startup();
 #endif
     do_version(0,0);
@@ -392,8 +394,7 @@ cyg_start(void)
                 CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
 
                 // set up a temporary context that will take us to the trampoline
-                HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end,
-                                        breakpoint, trampoline, 0);
+                HAL_THREAD_INIT_CONTEXT(workspace_end,breakpoint, trampoline,0);
 
                 // switch context to trampoline (get GDB stubs started)
                 HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end);
@@ -594,7 +595,7 @@ do_go(int argc, char *argv[])
     HAL_ICACHE_INVALIDATE_ALL();
     HAL_DCACHE_INVALIDATE_ALL();
     // set up a temporary context that will take us to the trampoline
-    HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, trampoline, 0);
+    HAL_THREAD_INIT_CONTEXT(workspace_end, entry, trampoline, 0);
 
     // switch context to trampoline
     HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end);
--- a/packages/redboot/current/src/mcmp.c
+++ b/packages/redboot/current/src/mcmp.c
@@ -90,42 +90,46 @@ do_mcmp(int argc, char *argv[])
         diag_printf("usage: mcmp -s <addr> -d <addr> -l <length> [-1|-2|-4]\n");
         return;
     }
-    // No checks here    
+
+    
+
     if (set_8bit) {
-        // Compare 8 bits at a time
+        cyg_uint8 *s = (cyg_uint8 *)src_base;
+        cyg_uint8 *d = (cyg_uint8 *)dst_base;
         while ((len -= sizeof(cyg_uint8)) >= 0) {
-            if (*((cyg_uint8 *)src_base)++ != *((cyg_uint8 *)dst_base)++) {
-                ((cyg_uint8 *)src_base)--;
-                ((cyg_uint8 *)dst_base)--;
+            if (*s++ != *d++) {
+                s--;
+                d--;
                 diag_printf("Buffers don't match - %p=0x%02x, %p=0x%02x\n",
-                            src_base, *((cyg_uint8 *)src_base),
-                            dst_base, *((cyg_uint8 *)dst_base));
+                            s, *s, d, *d);
                 return;
             }
+
         }
     } else if (set_16bit) {
-        // Compare 16 bits at a time
-        while ((len -= sizeof(cyg_uint16)) >= 0) {
-            if (*((cyg_uint16 *)src_base)++ != *((cyg_uint16 *)dst_base)++) {
-                ((cyg_uint16 *)src_base)--;
-                ((cyg_uint16 *)dst_base)--;
+	cyg_uint16 *s = (cyg_uint16 *)src_base;
+	cyg_uint16 *d = (cyg_uint16 *)dst_base;
+	while ((len -= sizeof(cyg_uint16)) >= 0) {
+            if (*s++ != *d++) { 
+                s--;
+                d--;
                 diag_printf("Buffers don't match - %p=0x%04x, %p=0x%04x\n",
-                            src_base, *((cyg_uint16 *)src_base),
-                            dst_base, *((cyg_uint16 *)dst_base));
+                            s, *s, d, *d);
                 return;
             }
-        }
+
+	}
     } else {
-        // Default - 32 bits
-        while ((len -= sizeof(cyg_uint32)) >= 0) {
-            if (*((cyg_uint32 *)src_base)++ != *((cyg_uint32 *)dst_base)++) {
-                ((cyg_uint32 *)src_base)--;
-                ((cyg_uint32 *)dst_base)--;
-                diag_printf("Buffers don't match - %p=0x%08x, %p=0x%08x\n",
-                            src_base, *((cyg_uint32 *)src_base),
-                            dst_base, *((cyg_uint32 *)dst_base));
-                return;
-            }
-        }
+      cyg_uint32 *s = (cyg_uint32 *)src_base;
+      cyg_uint32 *d = (cyg_uint32 *)dst_base;
+      while ((len -= sizeof(cyg_uint32)) >= 0) {
+	if (*s++ != *d++) {
+	  s--;
+	  d--;
+	  diag_printf("Buffers don't match - %p=0x%08x, %p=0x%08x\n",
+		      s, *s, d, *d);
+	  return;
+	}
+      }
     }
 }
--- a/packages/redboot/current/src/mfill.c
+++ b/packages/redboot/current/src/mfill.c
@@ -94,20 +94,20 @@ do_mfill(int argc, char *argv[])
         pat = 0;
     }
     // No checks here    
+
     if (set_8bit) {
-        // Fill 8 bits at a time
-        while ((len -= sizeof(cyg_uint8)) >= 0) {
-            *((cyg_uint8 *)base)++ = (cyg_uint8)pat;
-        }
+        cyg_uint8 *p = (cyg_uint8 *)base;
+        while ((len -= sizeof(cyg_uint8)) >= 0)
+            *p++ = (cyg_uint8)pat;
     } else if (set_16bit) {
-        // Fill 16 bits at a time
-        while ((len -= sizeof(cyg_uint16)) >= 0) {
-            *((cyg_uint16 *)base)++ = (cyg_uint16)pat;
-        }
+        cyg_uint16 *p = (cyg_uint16 *)base;
+        while ((len -= sizeof(cyg_uint16)) >= 0)
+            *p++ = (cyg_uint16)pat;
     } else {
-        // Default - 32 bits
-        while ((len -= sizeof(cyg_uint32)) >= 0) {
-            *((cyg_uint32 *)base)++ = (cyg_uint32)pat;
-        }
+        cyg_uint32 *p = (cyg_uint32 *)base;
+        while ((len -= sizeof(cyg_uint32)) >= 0)
+            *p++ = (cyg_uint32)pat;
     }
+    
 }
+