If the DCC working area is about to be overwritten, report
explicit error.

Perhaps this will put the user on the right track of
his problems?

Signed-off-by: Øyvind Harboe <oyvind.har...@zylin.com>
---
 src/target/arm7_9_common.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index abe0c2f..0e55f01 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2720,6 +2720,15 @@ int arm7_9_bulk_write_memory(struct target *target, 
uint32_t address, uint32_t c
                }
        }
 
+       if (!(address >
+                                       (arm7_9->dcc_working_area->address + 
arm7_9->dcc_working_area->size) ||
+                               (address + count*sizeof(uint32_t)) <
+                               arm7_9->dcc_working_area->address))
+       {
+               LOG_ERROR("Working area about to be overwritten by DCC write.");
+               return ERROR_FAIL;
+       }
+
        struct arm_algorithm armv4_5_info;
        struct reg_param reg_params[1];
 
-- 
1.6.3.3

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to