aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kasprzyk <ciri@ciri.pl>2018-12-08 03:27:51 +0100
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2019-10-18 09:19:09 +0100
commit03beb01239a8ca02787cb99d19401b1974fe41c4 (patch)
tree2967da654d6cc4e9b25b4e029339bbe33287cac1
parent3afb357934217ccd5889f8ffc7f6e9d65b3162f1 (diff)
downloadriscv-openocd-03beb01239a8ca02787cb99d19401b1974fe41c4.zip
riscv-openocd-03beb01239a8ca02787cb99d19401b1974fe41c4.tar.gz
riscv-openocd-03beb01239a8ca02787cb99d19401b1974fe41c4.tar.bz2
Fix wrong end-of-region calculation
Correct check for end-of-region is: $BASE + $LEN > $ADDRESS And it is currently (wrongly) calculated as: $ADDRESS > $BASE - $LEN Change-Id: If10bfee19b0c7dbc085731ac1eda943f5d8a36a3 Signed-off-by: Piotr Kasprzyk <ciri@ciri.pl> Reviewed-on: http://openocd.zylin.com/4798 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r--tcl/memory.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcl/memory.tcl b/tcl/memory.tcl
index 83c96d6..a7f5b9a 100644
--- a/tcl/memory.tcl
+++ b/tcl/memory.tcl
@@ -58,7 +58,7 @@ set ACCESS_WIDTH_ANY [expr $ACCESS_WIDTH_8 + $ACCESS_WIDTH_16 + $ACCESS_WIDTH_3
set UNKNOWN(0,ACCESS_WIDTH) $ACCESS_WIDTH_NONE
proc iswithin { ADDRESS BASE LEN } {
- return [expr ((($ADDRESS - $BASE) > 0) && (($ADDRESS - $BASE + $LEN) > 0))]
+ return [expr ((($ADDRESS - $BASE) > 0) && (($BASE + $LEN - $ADDRESS) > 0))]
}
proc address_info { ADDRESS } {