On Sun, Nov 19, 2006 at 07:45:54AM -0500, John Clark wrote:
> Hello,
>
> Anyhow, because of the unconditional calls to valid_address() now, load
> reports success but fails to actually write to memory outside of its
> known range. For a quick fix, I put a check for
> CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS around the calls to
> valid_address(). Unfortunately, that breaks the load into flash feature
> completely when address validation is disabled.
Hi John.
How does it break the load? Please could you try the attached patch.
Thanks
Andrew
Index: redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.249
diff -u -r1.249 ChangeLog
--- redboot/current/ChangeLog 6 Sep 2006 14:26:52 -0000 1.249
+++ redboot/current/ChangeLog 19 Nov 2006 16:00:19 -0000
@@ -1,3 +1,8 @@
+2006-11-19 Andrew Lunn <[EMAIL PROTECTED]>
+
+ * src/load.c: Only call valid_address() if
+ CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS is enabled.
+
2006-09-06 Andrew Lunn <[EMAIL PROTECTED]>
* cdl/redboot.cdl: Fix description of CYGSEM_REDBOOT_DISK_IDE.
Index: redboot/current/src/load.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/load.c,v
retrieving revision 1.47
diff -u -r1.47 load.c
--- redboot/current/src/load.c 20 Jul 2006 20:27:47 -0000 1.47
+++ redboot/current/src/load.c 19 Nov 2006 16:00:20 -0000
@@ -422,9 +422,11 @@
redboot_getc_terminate(true);
return 0;
}
- if (valid_address(addr)) {
+#ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
+ if (valid_address(addr))
+#endif
*addr++ = ch;
- }
+
#ifdef CYGBLD_REDBOOT_LOAD_INTO_FLASH
else {
flash_load_write(addr, ch);
@@ -567,9 +569,11 @@
offset += count;
while (count-- > 0) {
val = _hex2(getc, 1, &sum);
- if (valid_address(addr)) {
+#ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
+ if (valid_address(addr))
+#endif
*addr++ = val;
- }
+
#ifdef CYGBLD_REDBOOT_LOAD_INTO_FLASH
else {
flash_load_write(addr, val);