From: Jack Lange Date: Fri, 14 Aug 2009 20:53:36 +0000 (-0500) Subject: sprintf configuration fixes X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=051d39a706ccd24493cc3a0a1558a071f5673ab5 sprintf configuration fixes --- diff --git a/Kconfig b/Kconfig index dd5a154..00d3d9b 100644 --- a/Kconfig +++ b/Kconfig @@ -169,10 +169,19 @@ config BUILT_IN_STRPBRK This enables Palacios' internal implementation of strpbrk +config BUILT_IN_STDIO + bool "Enable Built in versions of stdio functions" + default n + help + Not all host OSes provide link targets for stdio functions + Palacios provides internal implementations of these functions, that you can select from this list + + + config BUILT_IN_SPRINTF bool "sprintf()" default n - depends on BUILT_IN_STDLIB + depends on BUILT_IN_STDIO help This enables Palacios' internal implementation of sprintf @@ -180,7 +189,7 @@ config BUILT_IN_SPRINTF config BUILT_IN_SNPRINTF bool "snprintf()" default n - depends on BUILT_IN_STDLIB + depends on BUILT_IN_STDIO help This enables Palacios' internal implementation of snprintf @@ -188,21 +197,21 @@ config BUILT_IN_SNPRINTF config BUILT_IN_VSPRINTF bool "vsprintf()" default n - depends on BUILT_IN_STDLIB + depends on BUILT_IN_STDIO help This enables Palacios' internal implementation of vsprintf config BUILT_IN_VSNPRINTF bool "vsnprintf()" default n - depends on BUILT_IN_STDLIB + depends on BUILT_IN_STDIO help This enables Palacios' internal implementation of vsnprintf config BUILT_IN_VSNRPRINTF bool "vsnrprintf()" default n - depends on BUILT_IN_STDLIB + depends on BUILT_IN_STDIO help This enables Palacios' internal implementation of vsnrprintf diff --git a/palacios/src/palacios/vmm_sprintf.c b/palacios/src/palacios/vmm_sprintf.c index cc8b79e..c1ca717 100644 --- a/palacios/src/palacios/vmm_sprintf.c +++ b/palacios/src/palacios/vmm_sprintf.c @@ -86,6 +86,14 @@ struct snprintf_arg { }; + +#if defined(CONFIG_BUILT_IN_STDIO) && \ + ( defined(CONFIG_BUILT_IN_SPRINTF) || \ + defined(CONFIG_BUILT_IN_SNPRINTF) || \ + defined(CONFIG_BUILT_IN_VSPRINTF) || \ + defined(CONFIG_BUILT_IN_VSNPRINTF) || \ + defined(CONFIG_BUILT_IN_VSNRPRINTF )) + static char * ksprintn(char * nbuf, uint64_t num, int base, int *len, int upper); static void snprintf_func(int ch, void * arg); static int kvprintf(char const * fmt, void (*func)(int, void *), void * arg, int radix, va_list ap); @@ -545,6 +553,8 @@ number: } +#endif // CONFIG_BUILT_IN_STDIO + void v3_hexdump(const void * ptr, int length, const char * hdr, int flags) {