Displaying 4 results from an estimated 4 matches for "__auxval".
2014 Jan 25
0
[klibc:master] auxv: convert auxiliary vector into an array; define getauxval()
....h b/usr/include/sys/auxv.h
new file mode 100644
index 0000000..08fcfcf
--- /dev/null
+++ b/usr/include/sys/auxv.h
@@ -0,0 +1,16 @@
+#ifndef _SYS_AUXV_H
+#define _SYS_AUXV_H
+
+#include <klibc/compiler.h>
+#include <elf.h>
+
+#define _AUXVAL_MAX AT_SYSINFO_EHDR
+
+__extern unsigned long __auxval[_AUXVAL_MAX];
+
+__static_inline unsigned long getauxval(unsigned long __t)
+{
+ return (__t >= _AUXVAL_MAX) ? 0 : __auxval[__t];
+}
+
+#endif /* _SYS_AUXV_H */
diff --git a/usr/include/sys/elfcommon.h b/usr/include/sys/elfcommon.h
index 300ff4e..603b0ce 100644
--- a/usr/include/sys/elfcommon.h...
2014 Apr 09
0
[klibc:master] Move architecture-specific initialization to arch/
...-0,0 +1,18 @@
+/*
+ * arch/i386/archinit.c
+ *
+ * Architecture-specific libc initialization
+ */
+
+#include <stdint.h>
+#include <klibc/compiler.h>
+#include <elf.h>
+#include <sys/auxv.h>
+
+extern void (*__syscall_entry)(int, ...);
+
+void __libc_archinit(void)
+{
+ if (__auxval[AT_SYSINFO])
+ __syscall_entry = (void (*)(int, ...)) __auxval[AT_SYSINFO];
+}
diff --git a/usr/klibc/libc_init.c b/usr/klibc/libc_init.c
index 1c6180b..c54d022 100644
--- a/usr/klibc/libc_init.c
+++ b/usr/klibc/libc_init.c
@@ -25,6 +25,7 @@
#include <klibc/compiler.h>
#include <elf.h&g...
2014 Jan 25
0
[klibc:master] i386: use the vdso for system calls on i386
...ushl %edx
cmpl $-4095, %eax
jae 1f
diff --git a/usr/klibc/libc_init.c b/usr/klibc/libc_init.c
index 1087f95..1c6180b 100644
--- a/usr/klibc/libc_init.c
+++ b/usr/klibc/libc_init.c
@@ -90,6 +90,15 @@ __noreturn __libc_init(uintptr_t * elfdata, void (*onexit) (void))
__page_size = page_size = __auxval[AT_PAGESZ];
+#ifdef __i386__
+ {
+ extern void (*__syscall_entry)(int, ...);
+ if (__auxval[AT_SYSINFO])
+ __syscall_entry = (void (*)(int, ...))
+ __auxval[AT_SYSINFO];
+ }
+#endif
+
#if __GNUC__ >= 4
/* unsigned int is 32 bits on all our architectures */
page_shift = __builtin_cl...
2015 Nov 05
0
[klibc:master] Inline __arch_libcinit()
...klibc/archinit.h
@@ -1,5 +1,5 @@
/*
- * arch/i386/archinit.c
+ * arch/i386/include/klibc/archinit.h
*
* Architecture-specific libc initialization
*/
@@ -11,7 +11,7 @@
extern void (*__syscall_entry)(int, ...);
-void __libc_archinit(void)
+static inline void __libc_archinit(void)
{
if (__auxval[AT_SYSINFO])
__syscall_entry = (void (*)(int, ...)) __auxval[AT_SYSINFO];
diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h
index ab947c0..c91d5b8 100644
--- a/usr/include/klibc/sysconfig.h
+++ b/usr/include/klibc/sysconfig.h
@@ -219,7 +219,7 @@
/*
* _KLIBC_HAS_ARCHIN...