public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Gracefully handle 64-bit Load Address and Entry Point Address mkimage parameters
@ 2016-02-15  3:25 William Cohen
  2016-02-15 11:34 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: William Cohen @ 2016-02-15  3:25 UTC (permalink / raw)
  To: u-boot

From: no one <noone@example.com>

Recent MIPS Linux kernels are using a 64-bit value for the load
address (0xffffffff80010000) for the Creator CI20 board kernel.  When
this argument was passed to the mkimage program running on a 32-bit
machine such as the Creator CI20 board the load address was
incorrectly obtained from the first half of the argument, 0xffffffff
by the strtoul.  The mkimage should be able to tolerate the longer,
64-bit signed version of the arguments with the use of strtoull.
---
 tools/mkimage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 8f8b6df..b6c2958 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
 			case 'a':
 				if (--argc <= 0)
 					usage ();
-				params.addr = strtoul (*++argv, &ptr, 16);
+				params.addr = strtoull (*++argv, &ptr, 16);
 				if (*ptr) {
 					fprintf (stderr,
 						"%s: invalid load address %s\n",
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
 			case 'e':
 				if (--argc <= 0)
 					usage ();
-				params.ep = strtoul (*++argv, &ptr, 16);
+				params.ep = strtoull (*++argv, &ptr, 16);
 				if (*ptr) {
 					fprintf (stderr,
 						"%s: invalid entry point %s\n",
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-16 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15  3:25 [U-Boot] [PATCH] Gracefully handle 64-bit Load Address and Entry Point Address mkimage parameters William Cohen
2016-02-15 11:34 ` Wolfgang Denk
2016-02-16 13:56   ` William Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox