tiny-printf: Support sprintf()
PATCH 1/2 tiny-printf: Support sprintf()
Add a simple version of this function for SPL. It does not check the buffer size as this would add to the code size.
--- lib/tiny-printf.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
lib/tiny-printf.c +14 -2
@@ -147,8 +147,7 @@ static void putc_outstr(char ch) *outstr++ = ch; } -/* Note that size is ignored */ -int snprintf (char *buf,size_t size,const char *fmt, ...) +int sprintf (char *buf,const char *fmt, ...) {va_list va;int ret;
@@ -161,3 +160,16 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)return ret; } + +/* Note that size is ignored */ +int snprintf (char *buf,size_t size,const char *fmt, ...) +{ +va_list va; +int ret; + +va_start (va, fmt); + ret =sprintf (buf, fmt, va); +va_end (va); + +return ret; +}
Signature · 1 line
2.7.0
PATCH 2/2 ARM: omap: Enable tiny printf on omap3_logic
Enable support for tiny printf on the omap3_logic board to trim down the SPL size. This makes the SPL actually build again and fit into the SRAM.
--- configs/omap3_logic_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/omap3_logic_defconfig +1 -0
@@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_OMAP34XX=y CONFIG_TARGET_OMAP3_LOGIC=y +CONFIG_USE_TINY_PRINTF=y CONFIG_SPL=y CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="NAND"
Signature · 1 line
2.7.0
PATCH 2/2 ARM: omap: Enable tiny printf on omap3_logic
Quoted 8 lines · Marek Vasut
Enable support for tiny printf on the
omap3_logicboard to trim down the SPL size. This makes the SPL actually build again and fit into the SRAM.Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Tom Rini <[email protected]>Cc lesne at alse-fr.com
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160531/7bbd0b25/attachment.sig>
PATCH 2/2 ARM: omap: Enable tiny printf on omap3_logic
In reply to Marek VasutQuoted 9 lines · Marek Vasut
Enable support for tiny printf on the
omap3_logicboard to trim down the SPL size. This makes the SPL actually build again and fit into the SRAM.Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Tom Rini <[email protected]>Cc lesne at alse-fr.comReviewed-by Tom Rini <[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: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/b7084dd8/attachment.sig>
PATCH 1/2 tiny-printf: Support sprintf()
In reply to Marek VasutQuoted 8 lines · Marek Vasut
Add a simple version of this function for SPL. It does not check the buffer size as this would add to the code size.
Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc lesne at alse-fr.com
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160531/42053a4e/attachment.sig>
PATCH 1/2 tiny-printf: Support sprintf()
In reply to Marek VasutHi,
Quoted 8 lines · Marek Vasut
Add a simple version of this function for SPL. It does not check the buffer size as this would add to the code size.
Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc lesne at alse-fr.com
This is how I would do it as well, and I can confirm that it builds and boots on a socfpga platform (sockit), when using part_dos.c (that includes sprintf() calls).
Signature · 1 line
Sylvain
PATCH 1/2 tiny-printf: Support sprintf()
In reply to Marek VasutQuoted 11 lines · Marek Vasut
Add a simple version of this function for SPL. It does not check the buffer size as this would add to the code size.
Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Stefan Roese <[email protected]>Cc Tom Rini <[email protected]>Cc lesne at alse-fr.comReviewed-by Tom Rini <[email protected]>Reviewed-by Sylvain Lesne <[email protected]>Tested-by Sylvain Lesne <[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: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/72f63bd1/attachment.sig>