Skip to contentSkip to conversation

arm: semihosting: fix up compile bugs

PATCH New Linus Walleij 2 participants 2 messages Dec 15, 2014 – Dec 30, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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
index e59b44ed6068..835ca7e4b683 100644
@@ -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
#1 lore raw

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

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>