John Woods <johnrw@gmail.com> fix checks for addresses at upper end of the universe
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 19 Feb 2009 18:52:46 +0000 (18:52 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 19 Feb 2009 18:52:46 +0000 (18:52 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1377 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/flash.c

index ce2ce75daa6b2052720d92d991eb4df81ca87bfa..1572e5cd53b8239620e5d0882c4dc4042ed4b0c3 100644 (file)
@@ -950,7 +950,7 @@ int flash_erase_address_range(target_t *target, u32 addr, u32 length)
        }
 
        /* check whether it fits */
-       if (addr + length > c->base + c->size)
+       if (addr + length - 1 > c->base + c->size - 1)
                return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
 
        addr -= c->base;
@@ -1030,7 +1030,7 @@ int flash_write(target_t *target, image_t *image, u32 *written, int erase)
                section_first = section;
                section_last = section;
                padding[section] = 0;
-               while ((run_address + run_size < c->base + c->size)
+               while ((run_address + run_size - 1 < c->base + c->size - 1)
                                && (section_last + 1 < image->num_sections))
                {
                        if (image->sections[section_last + 1].base_address < (run_address + run_size))
@@ -1052,7 +1052,7 @@ int flash_write(target_t *target, image_t *image, u32 *written, int erase)
                }
 
                /* fit the run into bank constraints */
-               if (run_address + run_size > c->base + c->size)
+               if (run_address + run_size - 1 > c->base + c->size - 1)
                {
                        LOG_WARNING("writing %d bytes only - as image section is %d bytes and bank is only %d bytes", \
                                        c->base + c->size - run_address, run_size, c->size);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)