help
This enables Palacios' internal implementation of atoi
+config BUILT_IN_ATOX
+ bool "atox()"
+ depends on BUILT_IN_STDLIB
+ help
+ This enables Palacios' internal implementation of atox
+
config BUILT_IN_STRCHR
bool "strchr()"
default n
help
This enables Palacios' internal implementation of strpbrk
+config BUILT_IN_STR_TOLOWER
+ bool "str_tolower()"
+ default n
+ depends on BUILT_IN_STDLIB
+ help
+ This enables Palacios' internal implementation of str_tolower
+
+config BUILT_IN_STR_TOUPPER
+ bool "str_toupper()"
+ default n
+ depends on BUILT_IN_STDLIB
+ help
+ This enables Palacios' internal implementation of str_toupper
+
+config BUILT_IN_STRTOI
+ bool "strtoi()"
+ default n
+ depends on BUILT_IN_STDLIB
+ help
+ This enables Palacios' internal implementation of strtoi
+
+config BUILT_IN_STRTOX
+ bool "strtox()"
+ default n
+ depends on BUILT_IN_STDLIB
+ help
+ This enables Palacios' internal implementation of strtox
+
config BUILT_IN_STDIO
bool "Enable Built in versions of stdio functions"
uint32_t * eax, uint32_t * ebx,
uint32_t * ecx, uint32_t * edx) {
#ifdef __V3_64BIT__
+ // avoid rbx on -FPIC - gcc likes to own rbx even on 64 bit PIC code
__asm__ __volatile__ (
+ "pushq %%rbx\n\t"
+ "movq %%rdi, %%rbx\n\t"
"cpuid\n\t"
- : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+ "movq %%rbx, %%rdi\n\t"
+ "popq %%rbx\n\t"
+ : "=a" (*eax), "=D" (*ebx), "=c" (*ecx), "=d" (*edx)
: "0" (target), "2" (*ecx)
);
#elif __V3_32BIT__
static inline int enable_vmx() {
#ifdef __V3_64BIT__
__asm__ __volatile__ (
- "movq %%cr4, %%rbx;"
- "orq $0x00002000, %%rbx;"
- "movq %%rbx, %%cr4;"
+ "movq %%cr4, %%rcx;"
+ "orq $0x00002000, %%rcx;"
+ "movq %%rcx, %%cr4;"
:
:
- : "%rbx"
+ : "%rcx"
);
__asm__ __volatile__ (
- "movq %%cr0, %%rbx; "
- "orq $0x00000020,%%rbx; "
- "movq %%rbx, %%cr0;"
+ "movq %%cr0, %%rcx; "
+ "orq $0x00000020,%%rcx; "
+ "movq %%rcx, %%cr0;"
:
:
- : "%rbx"
+ : "%rcx"
);
#elif __V3_32BIT__
__asm__ __volatile__ (
32715575, 65431158, 130862298, 261724573,
523449198, 1046898282 };
-const uint_t prime_table_length = sizeof(primes) / sizeof(primes[0]);
+static const uint_t prime_table_length = sizeof(primes) / sizeof(primes[0]);
#endif
+#ifdef V3_CONFIG_BUILT_IN_STRTOI
int strtoi(const char * nptr, char ** endptr) {
int ret = 0;
char * buf = (char *)nptr;
return ret;
}
+#endif
+#ifdef V3_CONFIG_BUILT_IN_ATOX
uint64_t atox(const char * buf) {
uint64_t ret = 0;
return ret;
}
+#endif
+#ifdef V3_CONFIG_BUILT_IN_STRTOX
uint64_t strtox(const char * nptr, char ** endptr) {
uint64_t ret = 0;
char * buf = (char *)nptr;
return ret;
}
-
+#endif
#ifdef V3_CONFIG_BUILT_IN_STRCHR
}
#endif
-
+#ifdef V3_CONFIG_BUILT_IN_STR_TOLOWER
void str_tolower(char * s) {
while (isalpha(*s)) {
if (!islower(*s)) {
s++;
}
}
+#endif
-
+#ifdef V3_CONFIG_BUILT_IN_STR_TOUPPER
void str_toupper(char * s) {
while (isalpha(*s)) {
if (!isupper(*s)) {
s++;
}
}
+#endif