From: Jack Lange Date: Fri, 5 Nov 2010 22:38:51 +0000 (-0500) Subject: added user space symbol inclusion to Kconfig X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=d711597b8c58d3d06b860462bf965e59dd4f3452 added user space symbol inclusion to Kconfig --- diff --git a/Kconfig.stdlibs b/Kconfig.stdlibs index 15648b6..09e082a 100644 --- a/Kconfig.stdlibs +++ b/Kconfig.stdlibs @@ -191,4 +191,63 @@ config BUILT_IN_VSNRPRINTF This enables Palacios' internal implementation of vsnrprintf +config BUILT_IN_USERSPACE_SYMS + bool "Enable build in versions of user space symbols needed" + default y + help + This enables a set of dummy symbols corresponding to user space. + This is needed to link user space libraries such as XED. + + +config BUILT_IN_STDIN + bool "FILE * stdin;" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes the stdin file pointer + +config BUILT_IN_STDOUT + bool "FILE * stdout;" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes the stdout file pointer + +config BUILT_IN_STDERR + bool "FILE * stderr;" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes the stderr file pointer + + +config BUILT_IN_FPRINTF + bool "fprintf();" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes fprintf() + +config BUILT_IN_PRINTF + bool "printf();" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes printf(); + +config BUILT_IN_FFLUSH + bool "fflush();" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes fflush() + +config BUILT_IN_ABORT + bool "abort();" + default y + depends on BUILT_IN_USERSPACE_SYMS + help + Includes abort(); + + endmenu diff --git a/palacios/lib/i386/v3-xed-compat.c b/palacios/lib/i386/v3-xed-compat.c index 2c66381..7a5f62c 100644 --- a/palacios/lib/i386/v3-xed-compat.c +++ b/palacios/lib/i386/v3-xed-compat.c @@ -4,33 +4,41 @@ /* Standard I/O predefined streams */ static FILE _streams = {0, 0, 0, 0, 0, NULL, NULL, 0, 0}; +#ifdef CONFIG_BUILT_IN_STDIN FILE *stdin = (&_streams); +#endif + +#ifdef CONFIG_BUILT_IN_STDOUT FILE *stdout = (&_streams); +#endif + +#ifdef CONFIG_BUILT_IN_STDERR FILE *stderr = (&_streams); +#endif -int fprintf(FILE *file, char *fmt, ...) -{ +#ifdef CONFIG_BUILT_IN_FPRINTF +int fprintf(FILE *file, char *fmt, ...) { // PrintDebug("In fprintf!!\n"); - return 0; } +#endif -int printf(char *fmt, ...) -{ +#ifdef CONFIG_BUILT_IN_PRINTF +int printf(char *fmt, ...) { // PrintDebug("In fprintf!!\n"); - return 0; - } +#endif -int fflush(FILE *stream) -{ +#ifdef CONFIG_BUILT_IN_FFLUSH +int fflush(FILE *stream) { //PrintDebug("In fflush!!\n"); - return 0; } +#endif +#ifdef CONFIG_BUILT_IN_ABORT void abort(void) { //PrintDebug("Abort!!\n"); @@ -38,7 +46,6 @@ void abort(void) //__asm__ __volatile__("trap"); //__builtin_unreached(); - - while(1); - + while(1); } +#endif