vtxprintf: Introduce vtxdprintf for the ease of closures

It was suggested to eliminate the lock for sprintf. One way to do it is
to make the fake tx_byte into a closure. This patch allows it.

It's a bit tricky since we need to preserve compatibility with romcc.

Change-Id: I877ef0cef54dcbb0589fe858c485f76f3dd27ece
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4287
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Vladimir Serbinenko
2013-11-26 21:43:05 +01:00
parent 7f68dfd6e8
commit f421b33edb
2 changed files with 56 additions and 23 deletions

View File

@@ -36,4 +36,8 @@ typedef __builtin_va_list va_list;
int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args);
#if !defined (__ROMCC__) && !defined (__SMM__)
int vtxdprintf(void (*tx_byte)(unsigned char byte, void *data), const char *fmt, va_list args, void *data);
#endif
#endif