Openwrt/target/linux/coldfire/patches/059-mcfv4e_vdso_headers.patch

80 lines
1.9 KiB
Diff

From a05af27aec00eacf533ff111ba8eb3dec328d9af Mon Sep 17 00:00:00 2001
From: Kurt Mahan <kmahan@freescale.com>
Date: Thu, 22 May 2008 11:20:53 -0600
Subject: [PATCH] Initial vDSO header changes.
LTIBName: mcfv4e-vdso-headers
Signed-off-by: Kurt Mahan <kmahan@freescale.com>
---
include/asm-m68k/auxvec.h | 9 +++++++++
include/asm-m68k/elf.h | 31 +++++++++++++++++++++++++++++++
include/asm-m68k/page.h | 5 +++++
3 files changed, 45 insertions(+), 0 deletions(-)
--- a/include/asm-m68k/auxvec.h
+++ b/include/asm-m68k/auxvec.h
@@ -1,4 +1,13 @@
#ifndef __ASMm68k_AUXVEC_H
#define __ASMm68k_AUXVEC_H
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them.
+ */
+
+#ifdef CONFIG_VSYSCALL
+/* Entry point to the vsyscall page */
+#define AT_SYSINFO_EHDR 33
+#endif
#endif
--- a/include/asm-m68k/elf.h
+++ b/include/asm-m68k/elf.h
@@ -136,4 +136,35 @@ typedef struct user_m68kfp_struct elf_fp
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+/*
+ * VDSO
+ */
+#ifdef CONFIG_VSYSCALL
+extern unsigned int vdso_enabled;
+
+#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
+#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x))
+
+#define VSYSCALL_AUX_ENT \
+ if (vdso_enabled) \
+ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
+
+/* additional pages */
+#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
+
+struct linux_binprm;
+extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+ int executable_stack);
+
+#else
+/* no VSYSCALL_AUX_ENT */
+#define VSYSCALL_AUX_ENT
+#endif
+
+#define ARCH_DLINFO \
+do { \
+ /* vsyscall entry */ \
+ VSYSCALL_AUX_ENT; \
+} while (0);
+
#endif
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -252,4 +252,9 @@ static inline __attribute_const__ int __
#include <asm-generic/page.h>
+#ifdef CONFIG_VSYSCALL
+/* vDSO support */
+#define __HAVE_ARCH_GATE_AREA
+#endif
+
#endif /* _M68K_PAGE_H */