arm: semihosting: fix up compile bugs
PATCH v2 2/3 arm: semihosting: fix up compile bugs
There is currently a regression when using newer ARM64 compilers for semihosting: the way long types are inferred from context is no longer the same.
The semihosting runtime uses long and size_t, so use this explicitly in the semihosting code and interface, and voila:
the code now works again.
Tested with aarch64-linux-gnu-gcc: Linaro GCC 4.9-2014.09.
---
ChangeLog v1->v2:
- Fix fd leak in smh_len()
- Fix up return type on smh_len()
- Add Steve's ACK.
--- arch/arm/include/asm/semihosting.h | 2 +- arch/arm/lib/semihosting.c | 101 +++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 50 deletions(-)
arch/arm/include/asm/semihosting.h +1 -1
@@ -12,6 +12,6 @@* code for more information. */ int smh_load (const char *fname,void *memp,int avail,int verbose); -int smh_len (const char *fname); +long smh_len (const char *fname);#endif /* __SEMIHOSTING_H__ */
arch/arm/lib/semihosting.c +52 -49
232 lines not on this page · raw message
Signature · 1 line
1.9.3
PATCH v2 2/3 arm: semihosting: fix up compile bugs
Quoted 10 lines · Linus Walleij
There is currently a regression when using newer ARM64 compilers for semihosting: the way long types are inferred from context is no longer the same.
The semihosting runtime uses long and
size_t, so use this explicitly in the semihosting code and interface, and voila:
the code now works again.Tested with aarch64-linux-gnu-gcc: Linaro GCC 4.9-2014.09.
Quoted 7 lines
Cc Darwin Rambo <[email protected]>Cc AKASHI Takahiro <[email protected]>Cc Mark Hambleton <[email protected]>Cc Tom Rini <[email protected]>Acked-by Steve Rae <[email protected]>Suggested-by Mark Hambleton <[email protected]>Signed-off-by Linus Walleij <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141229/7222000d/attachment.pgp>