]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/vdso/vma.c
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
[linux-2.6-omap-h63xx.git] / arch / x86 / vdso / vma.c
index ff9333e5fb083af76a77a5707b1a0661ae76e1ff..9c98cc6ba9783ce1c1caac812341924e43ae98aa 100644 (file)
 #include <asm/vsyscall.h>
 #include <asm/vgtod.h>
 #include <asm/proto.h>
-#include "voffset.h"
+#include <asm/vdso.h>
 
-int vdso_enabled = 1;
-
-#define VEXTERN(x) extern typeof(__ ## x) *vdso_ ## x;
-#include "vextern.h"
+#include "vextern.h"           /* Just for VMAGIC.  */
 #undef VEXTERN
 
-extern char vdso_kernel_start[], vdso_start[], vdso_end[];
+unsigned int __read_mostly vdso_enabled = 1;
+
+extern char vdso_start[], vdso_end[];
 extern unsigned short vdso_sync_cpuid;
 
-struct page **vdso_pages;
+static struct page **vdso_pages;
+static unsigned vdso_size;
 
-static inline void *var_ref(void *vbase, char *var, char *name)
+static inline void *var_ref(void *p, char *name)
 {
-       unsigned offset = var - &vdso_kernel_start[0] + VDSO_TEXT_OFFSET;
-       void *p = vbase + offset;
        if (*(void **)p != (void *)VMAGIC) {
                printk("VDSO: variable %s broken\n", name);
                vdso_enabled = 0;
@@ -41,6 +39,7 @@ static int __init init_vdso_vars(void)
        int i;
        char *vbase;
 
+       vdso_size = npages << PAGE_SHIFT;
        vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
        if (!vdso_pages)
                goto oom;
@@ -62,9 +61,8 @@ static int __init init_vdso_vars(void)
                vdso_enabled = 0;
        }
 
-#define V(x) *(typeof(x) *) var_ref(vbase, (char *)RELOC_HIDE(&x, 0), #x)
 #define VEXTERN(x) \
-       V(vdso_ ## x) = &__ ## x;
+       *(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
 #include "vextern.h"
 #undef VEXTERN
        return 0;
@@ -100,25 +98,24 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
 
 /* Setup a VMA at program startup for the vsyscall page.
    Not called for compat tasks */
-int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
+int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 {
        struct mm_struct *mm = current->mm;
        unsigned long addr;
        int ret;
-       unsigned len = round_up(vdso_end - vdso_start, PAGE_SIZE);
 
        if (!vdso_enabled)
                return 0;
 
        down_write(&mm->mmap_sem);
-       addr = vdso_addr(mm->start_stack, len);
-       addr = get_unmapped_area(NULL, addr, len, 0, 0);
+       addr = vdso_addr(mm->start_stack, vdso_size);
+       addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
        if (IS_ERR_VALUE(addr)) {
                ret = addr;
                goto up_fail;
        }
 
-       ret = install_special_mapping(mm, addr, len,
+       ret = install_special_mapping(mm, addr, vdso_size,
                                      VM_READ|VM_EXEC|
                                      VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
                                      VM_ALWAYSDUMP,