From: Jack Lange Date: Fri, 14 Aug 2009 17:15:49 +0000 (-0500) Subject: more configuration fixes X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=2201970a66ded078c9228c9e4053189a00f0a882;p=palacios.git more configuration fixes --- diff --git a/Kconfig b/Kconfig index 1ad2ad9..254c64f 100644 --- a/Kconfig +++ b/Kconfig @@ -46,6 +46,130 @@ config INSTRUMENT_VMM This is much heavier weight than profiling +config BUILT_IN_STDLIB + bool "Enable Built in versions of stdlib functions" + default n + help + Not all host OSes provide link targets for stdlib functions + Palacios provides internal implementations of these functions, that you can select from this list + +config BUILT_IN_MEMSET + bool "memset()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of memset + + +config BUILT_IN_MEMCPY + bool "memcpy()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of memcpy + +config BUILT_IN_MEMCMP + bool "memcmp()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of memcmp + +config BUILT_IN_STRLEN + bool "strlen()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strlen + +config BUILT_IN_STRNLEN + bool "strnlen()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strnlen + + + +config BUILT_IN_STRCMP + bool "strcmp()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strcmp + +config BUILT_IN_STRNCMP + bool "strncmp()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strncmp + +config BUILT_IN_STRCAT + bool "strcat()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strcat + +config BUILT_IN_STRNCAT + bool "strncat()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strncat + +config BUILT_IN_STRCPY + bool "strcpy()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strcpy + +config BUILT_IN_STRNCPY + bool "strncpy()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strncpy + +config BUILT_IN_STRDUP + bool "strdup()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strdup + + +config BUILT_IN_ATOI + bool "atoi()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of atoi + +config BUILT_IN_STRCHR + bool "strchr()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strchr + +config BUILT_IN_STRRCHR + bool "strrchr()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strrchr + +config BUILT_IN_STRPBRK + bool "strpbrk()" + default n + depends on BUILT_IN_STDLIB + help + This enables Palacios' internal implementation of strpbrk + + endmenu diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index 2d95008..6fdce71 100644 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@ -337,7 +337,7 @@ static int apic_do_eoi(struct apic_state * apic) { *svc_location &= ~flag; -#ifdef CRAY_XT +#ifdef CONFIG_CRAY_XT if ((isr_irq == 238) || (isr_irq == 239)) { @@ -875,7 +875,7 @@ static int apic_get_intr_number(void * private_data) { } static int apic_raise_intr(void * private_data, int irq) { -#ifdef CRAY_XT +#ifdef CONFIG_CRAY_XT // The Seastar is connected directly to the LAPIC via LINT0 on the ICC bus if (irq == 238) { @@ -904,7 +904,7 @@ static int apic_begin_irq(void * private_data, int irq) { *svc_location |= flag; *req_location &= ~flag; -#ifdef CRAY_XT +#ifdef CONFIG_CRAY_XT if ((irq == 238) || (irq == 239)) { PrintError("APIC: Begin IRQ %d (ISR=%x), (IRR=%x)\n", irq, *svc_location, *req_location); } diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 4c55dd6..c7376d9 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -59,16 +59,22 @@ void Init_V3(struct v3_os_hooks * hooks, struct v3_ctrl_ops * vmm_ops) { vmm_ops->allocate_guest = &allocate_guest; +#ifdef CONFIG_SVM if (v3_is_svm_capable()) { PrintDebug("Machine is SVM Capable\n"); v3_init_SVM(vmm_ops); + + } else +#endif #ifdef CONFIG_VMX - } else if (v3_is_vmx_capable()) { - PrintDebug("Machine is VMX Capable\n"); - v3_init_vmx(vmm_ops); + if (v3_is_vmx_capable()) { + PrintDebug("Machine is VMX Capable\n"); + v3_init_vmx(vmm_ops); + + } else #endif - } else { - PrintDebug("CPU has no virtualization Extensions\n"); + { + PrintDebug("CPU has no virtualization Extensions\n"); } } diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 7ec24c6..701449f 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -194,7 +194,7 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf memcpy(V3_VAddr((void *)rombios_dst), v3_rombios_start, v3_rombios_end - v3_rombios_start); } -#ifdef CRAY_XT +#ifdef CONFIG_CRAY_XT { #define SEASTAR_START 0xffe00000 #define SEASTAR_END 0xffffffff diff --git a/palacios/src/palacios/vmm_string.c b/palacios/src/palacios/vmm_string.c index 274f5be..c286a6d 100644 --- a/palacios/src/palacios/vmm_string.c +++ b/palacios/src/palacios/vmm_string.c @@ -36,31 +36,12 @@ */ -#define NEED_MEMSET 0 -#define NEED_MEMCPY 0 -#define NEED_MEMCMP 0 -#define NEED_STRLEN 0 -#define NEED_STRNLEN 0 -#define NEED_STRCMP 0 -#define NEED_STRNCMP 0 -#define NEED_STRCAT 0 -#define NEED_STRNCAT 0 -#define NEED_STRCPY 0 -#define NEED_STRNCPY 0 -#define NEED_STRDUP 0 -#define NEED_ATOI 0 -#define NEED_STRCHR 0 -#define NEED_STRRCHR 0 -#define NEED_STRPBRK 0 - - - #include #include #include -#if NEED_MEMSET +#ifdef CONFIG_BUILT_IN_MEMSET void * memset(void * s, int c, size_t n) { uchar_t * p = (uchar_t *) s; @@ -73,7 +54,7 @@ void * memset(void * s, int c, size_t n) { } #endif -#if NEED_MEMCPY +#ifdef CONFIG_BUILT_IN_MEMCPY void * memcpy(void * dst, const void * src, size_t n) { uchar_t * d = (uchar_t *) dst; const uchar_t * s = (const uchar_t *)src; @@ -88,7 +69,7 @@ void * memcpy(void * dst, const void * src, size_t n) { #endif -#if NEED_CMP +#ifdef CONFIG_BUILT_IN_MEMCMP int memcmp(const void * s1_, const void * s2_, size_t n) { const char * s1 = s1_; const char * s2 = s2_; @@ -109,7 +90,7 @@ int memcmp(const void * s1_, const void * s2_, size_t n) { #endif -#if NEED_STRLEN +#ifdef CONFIG_BUILT_IN_STRLEN size_t strlen(const char * s) { size_t len = 0; @@ -123,7 +104,7 @@ size_t strlen(const char * s) { -#if NEED_STRNLEN +#ifdef CONFIG_BUILT_IN_STRNLEN /* * This it a GNU extension. * It is like strlen(), but it will check at most maxlen @@ -144,7 +125,7 @@ size_t strnlen(const char * s, size_t maxlen) { #endif -#if NEED_STRCMP +#ifdef CONFIG_BUILT_IN_STRCMP int strcmp(const char * s1, const char * s2) { while (1) { int cmp = (*s1 - *s2); @@ -160,7 +141,7 @@ int strcmp(const char * s1, const char * s2) { #endif -#if NEED_STRNCMP +#ifdef CONFIG_BUILT_IN_STRNCMP int strncmp(const char * s1, const char * s2, size_t limit) { size_t i = 0; @@ -182,7 +163,7 @@ int strncmp(const char * s1, const char * s2, size_t limit) { #endif -#if NEED_STRCAT +#ifdef CONFIG_BUILT_IN_STRCAT char * strcat(char * s1, const char * s2) { char * t1 = s1; @@ -196,7 +177,7 @@ char * strcat(char * s1, const char * s2) { #endif -#if NEED_STRNCAT +#ifdef CONFIG_BUILT_IN_STRNCAT char * strncat(char * s1, const char * s2, size_t limit) { size_t i = 0; char * t1; @@ -218,7 +199,7 @@ char * strncat(char * s1, const char * s2, size_t limit) { -#if NEED_STRCPY +#ifdef CONFIG_BUILT_IN_STRCPY char * strcpy(char * dest, const char * src) { char *ret = dest; @@ -233,7 +214,7 @@ char * strcpy(char * dest, const char * src) #endif -#if NEED_STRNCPY +#ifdef CONFIG_BUILT_IN_STRNCPY char * strncpy(char * dest, const char * src, size_t limit) { char * ret = dest; @@ -251,7 +232,7 @@ char * strncpy(char * dest, const char * src, size_t limit) { -#if NEED_STRDUP +#ifdef CONFIG_BUILT_IN_STRDUP char * strdup(const char * s1) { char *ret; @@ -265,7 +246,7 @@ char * strdup(const char * s1) { -#if NEED_ATOI +#ifdef CONFIG_BUILT_IN_ATOI int atoi(const char * buf) { int ret = 0; @@ -280,7 +261,7 @@ int atoi(const char * buf) { #endif -#if NEED_STRCHR +#ifdef CONFIG_BUILT_IN_STRCHR char * strchr(const char * s, int c) { while (*s != '\0') { if (*s == c) @@ -292,7 +273,7 @@ char * strchr(const char * s, int c) { #endif -#if NEED_STRRCHR +#ifdef CONFIG_BUILT_IN_STRRCHR char * strrchr(const char * s, int c) { size_t len = strlen(s); const char * p = s + len; @@ -308,7 +289,7 @@ char * strrchr(const char * s, int c) { } #endif -#if NEED_STRPBRK +#ifdef CONFIG_BUILT_IN_STRPBRK char * strpbrk(const char * s, const char * accept) { size_t setLen = strlen(accept);