Index: ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v retrieving revision 1.212 diff -u -5 -p -r1.212 ChangeLog --- ChangeLog 8 Oct 2004 11:08:41 -0000 1.212 +++ ChangeLog 3 Dec 2004 11:35:44 -0000 @@ -1,5 +1,11 @@ +2004-12-01 Andrea Michelotti + + * main.c : + * mfill.c: + * mcmp.c : cast as lvalue removed to make it compile with gcc 4 and higher + 2004-10-08 Andrew Lunn * doc/redboot_installing.sgml: Added links to the tools for the Atmel AT91 JTST board. Index: src/main.c =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v retrieving revision 1.60 diff -u -5 -p -r1.60 main.c --- src/main.c 1 Sep 2004 21:21:30 -0000 1.60 +++ src/main.c 3 Dec 2004 11:35:45 -0000 @@ -238,10 +238,11 @@ static void error_handler(void) // // This is the main entry point for RedBoot // + void cyg_start(void) { int res = 0; bool prompt = true; @@ -322,10 +323,11 @@ cyg_start(void) cyg_plf_memory_segment(seg, &mem_segments[seg].start, &mem_segments[seg].end); } #endif #ifdef CYGSEM_REDBOOT_PLF_STARTUP + cyg_plf_redboot_startup(); #endif do_version(0,0); #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT @@ -390,12 +392,11 @@ 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); gdb_active = false; @@ -592,11 +593,11 @@ do_go(int argc, char *argv[]) HAL_DCACHE_SYNC(); } 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); // we get back here by way of return_to_redboot() Index: src/mcmp.c =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/src/mcmp.c,v retrieving revision 1.2 diff -u -5 -p -r1.2 mcmp.c --- src/mcmp.c 24 Feb 2004 14:15:15 -0000 1.2 +++ src/mcmp.c 3 Dec 2004 11:35:45 -0000 @@ -88,44 +88,52 @@ do_mcmp(int argc, char *argv[]) } if (!src_base_set || !dst_base_set || !len_set) { diag_printf("usage: mcmp -s -d -l [-1|-2|-4]\n"); return; } - // No checks here - if (set_8bit) { - // Compare 8 bits at a time - while ((len -= sizeof(cyg_uint8)) >= 0) { - if (*((cyg_uint8 *)src_base)++ != *((cyg_uint8 *)dst_base)++) { - ((cyg_uint8 *)src_base)--; - ((cyg_uint8 *)dst_base)--; - 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)); - 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)--; - 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)); - return; - } - } + + + + if(set_8bit){ + cyg_uint8* s=(cyg_uint8*)src_base; + cyg_uint8* d=(cyg_uint8*)dst_base; + while((len-= sizeof(cyg_uint8))>=0){ + if(*s++!=*d++){ + s--; + d--; + diag_printf("Buffers don't match - %p=0x%02x, %p=0x%02x\n", + s, *s, + d, *d); + return; + } + + } + } else if(set_16bit){ + 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", + 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; + } + + } } } Index: src/mfill.c =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/src/mfill.c,v retrieving revision 1.2 diff -u -5 -p -r1.2 mfill.c --- src/mfill.c 24 Feb 2004 14:15:15 -0000 1.2 +++ src/mfill.c 3 Dec 2004 11:35:46 -0000 @@ -92,22 +92,22 @@ do_mfill(int argc, char *argv[]) } if (!pat_set) { 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; - } - } else if (set_16bit) { - // Fill 16 bits at a time - while ((len -= sizeof(cyg_uint16)) >= 0) { - *((cyg_uint16 *)base)++ = (cyg_uint16)pat; - } + + if(set_8bit){ + cyg_uint8 *p=(cyg_uint8 *)base; + while((len-= sizeof(cyg_uint8))>=0) + *p++= (cyg_uint8)pat; + } else if(set_16bit){ + 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; } + } +