On Sun, Mar 14, 2010 at 3:45 AM, Øyvind Harboe <[email protected]> wrote:
> On 3/14/10, Bradey Honsinger <[email protected]> wrote:
>> Patch with commit message is attached; comments and corrections
>> welcome. Patch is against 0.4.0, but I can rediff against head if it
>> doesn't apply cleanly.
>
> Forgot the attachment?
Hmm, I could have sworn it was there--here it is inline:
---
change image.base_address to long long
Fixes bug that prevented users from specifying a base address of
0x80000000 or higher in image commands (flash write_image, etm image,
xscale trace_image).
image.base_address is an offset from the start address contained in
the image file (if there is one), or from 0 (for binary files). As a
signed 32-bit int, it couldn't be greater than 0x7fffffff, which is a
problem when trying to write a binary file to flash above that
address. Changing it to a 64-bit long long keeps it as a signed
offset, but allows it to cover the entire 32-bit address space.
---
diff -ru openocd-0.4.0/src/flash/nor/tcl.c
openocd-0.4.0-bradeyh/src/flash/nor/tcl.c
--- openocd-0.4.0/src/flash/nor/tcl.c 2010-02-21 12:17:06.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/flash/nor/tcl.c 2010-03-13
16:27:20.000000000 -0800
@@ -434,7 +434,7 @@
if (CMD_ARGC >= 2)
{
image.base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], image.base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1], image.base_address);
}
else
{
diff -ru openocd-0.4.0/src/target/etm.c openocd-0.4.0-bradeyh/src/target/etm.c
--- openocd-0.4.0/src/target/etm.c 2010-02-21 12:17:07.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/etm.c 2010-03-13 03:13:56.000000000
-0800
@@ -1767,7 +1767,7 @@
if (CMD_ARGC >= 2)
{
etm_ctx->image->base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1],
etm_ctx->image->base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1],
etm_ctx->image->base_address);
}
else
{
diff -ru openocd-0.4.0/src/target/image.h
openocd-0.4.0-bradeyh/src/target/image.h
--- openocd-0.4.0/src/target/image.h 2010-03-13 02:25:45.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/image.h 2010-03-13 03:11:24.000000000
-0800
@@ -62,7 +62,7 @@
int num_sections; /* number of sections contained in the
image */
struct imageection *sections; /* array of sections */
int base_address_set; /* whether the image has a base address set
(for relocation purposes) */
- int base_address; /* base address, if one is set */
+ long long base_address; /* base address, if one is set */
int start_address_set; /* whether the image has a start address
(entry point) associated */
uint32_t start_address; /* start address, if one is set */
};
diff -ru openocd-0.4.0/src/target/xscale.c
openocd-0.4.0-bradeyh/src/target/xscale.c
--- openocd-0.4.0/src/target/xscale.c 2010-02-21 12:17:07.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/xscale.c 2010-03-13
03:14:12.000000000 -0800
@@ -3427,7 +3427,7 @@
if (CMD_ARGC >= 2)
{
xscale->trace.image->base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1],
xscale->trace.image->base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1],
xscale->trace.image->base_address);
}
else
{
change image.base_address to long long
Fixes bug that prevented users from specifying a base address of
0x80000000 or higher in image commands (flash write_image, etm image,
xscale trace_image).
image.base_address is an offset from the start address contained in
the image file (if there is one), or from 0 (for binary files). As a
signed 32-bit int, it couldn't be greater than 0x7fffffff, which is a
problem when trying to write a binary file to flash above that
address. Changing it to a 64-bit long long keeps it as a signed
offset, but allows it to cover the entire 32-bit address space.
---
diff -ru openocd-0.4.0/src/flash/nor/tcl.c
openocd-0.4.0-bradeyh/src/flash/nor/tcl.c
--- openocd-0.4.0/src/flash/nor/tcl.c 2010-02-21 12:17:06.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/flash/nor/tcl.c 2010-03-13 16:27:20.000000000
-0800
@@ -434,7 +434,7 @@
if (CMD_ARGC >= 2)
{
image.base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], image.base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1], image.base_address);
}
else
{
diff -ru openocd-0.4.0/src/target/etm.c openocd-0.4.0-bradeyh/src/target/etm.c
--- openocd-0.4.0/src/target/etm.c 2010-02-21 12:17:07.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/etm.c 2010-03-13 03:13:56.000000000
-0800
@@ -1767,7 +1767,7 @@
if (CMD_ARGC >= 2)
{
etm_ctx->image->base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1],
etm_ctx->image->base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1],
etm_ctx->image->base_address);
}
else
{
diff -ru openocd-0.4.0/src/target/image.h
openocd-0.4.0-bradeyh/src/target/image.h
--- openocd-0.4.0/src/target/image.h 2010-03-13 02:25:45.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/image.h 2010-03-13 03:11:24.000000000
-0800
@@ -62,7 +62,7 @@
int num_sections; /* number of sections contained in the
image */
struct imageection *sections; /* array of sections */
int base_address_set; /* whether the image has a base address set
(for relocation purposes) */
- int base_address; /* base address, if one is set */
+ long long base_address; /* base address, if one is set */
int start_address_set; /* whether the image has a start address (entry
point) associated */
uint32_t start_address; /* start address, if one is set */
};
diff -ru openocd-0.4.0/src/target/xscale.c
openocd-0.4.0-bradeyh/src/target/xscale.c
--- openocd-0.4.0/src/target/xscale.c 2010-02-21 12:17:07.000000000 -0800
+++ openocd-0.4.0-bradeyh/src/target/xscale.c 2010-03-13 03:14:12.000000000
-0800
@@ -3427,7 +3427,7 @@
if (CMD_ARGC >= 2)
{
xscale->trace.image->base_address_set = 1;
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1],
xscale->trace.image->base_address);
+ COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1],
xscale->trace.image->base_address);
}
else
{
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development