Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-drm-fsl-dcu.git] / arch / x86_64 / ia32 / ia32_binfmt.c
index 543ef4f405e9b9589062e97d2ace859e27fbef83..071100ea12512fe409361542ad7a7cf8ae5a62ad 100644 (file)
@@ -64,55 +64,6 @@ typedef unsigned int elf_greg_t;
 #define ELF_NGREG (sizeof (struct user_regs_struct32) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the vsyscall DSO contents.  Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the vsyscall DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS   (find_vma(current->mm, VSYSCALL32_BASE) ?     \
-    (VSYSCALL32_EHDR->e_phnum) : 0)
-#define ELF_CORE_WRITE_EXTRA_PHDRS                                           \
-do {                                                                         \
-       if (find_vma(current->mm, VSYSCALL32_BASE)) {                         \
-               const struct elf32_phdr *const vsyscall_phdrs =               \
-                       (const struct elf32_phdr *) (VSYSCALL32_BASE          \
-                                                  + VSYSCALL32_EHDR->e_phoff);\
-               int i;                                                        \
-               Elf32_Off ofs = 0;                                            \
-               for (i = 0; i < VSYSCALL32_EHDR->e_phnum; ++i) {              \
-                       struct elf32_phdr phdr = vsyscall_phdrs[i];           \
-                       if (phdr.p_type == PT_LOAD) {                         \
-                               BUG_ON(ofs != 0);                             \
-                               ofs = phdr.p_offset = offset;                 \
-                               phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);      \
-                               phdr.p_filesz = phdr.p_memsz;                 \
-                               offset += phdr.p_filesz;                      \
-                       }                                                     \
-                       else                                                  \
-                               phdr.p_offset += ofs;                         \
-                       phdr.p_paddr = 0; /* match other core phdrs */        \
-                       DUMP_WRITE(&phdr, sizeof(phdr));                      \
-               }                                                             \
-       }                                                                     \
-} while (0)
-#define ELF_CORE_WRITE_EXTRA_DATA                                            \
-do {                                                                         \
-       if (find_vma(current->mm, VSYSCALL32_BASE)) {                         \
-               const struct elf32_phdr *const vsyscall_phdrs =               \
-                       (const struct elf32_phdr *) (VSYSCALL32_BASE          \
-                                                  + VSYSCALL32_EHDR->e_phoff);      \
-               int i;                                                        \
-               for (i = 0; i < VSYSCALL32_EHDR->e_phnum; ++i) {              \
-                       if (vsyscall_phdrs[i].p_type == PT_LOAD)              \
-                               DUMP_WRITE((void *) (u64) vsyscall_phdrs[i].p_vaddr,\
-                                   PAGE_ALIGN(vsyscall_phdrs[i].p_memsz));   \
-               }                                                             \
-       }                                                                     \
-} while (0)
-
 struct elf_siginfo
 {
        int     si_signo;                       /* signal number */
@@ -349,12 +300,10 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top,
                bprm->loader += stack_base;
        bprm->exec += stack_base;
 
-       mpnt = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
+       mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
        if (!mpnt) 
                return -ENOMEM; 
 
-       memset(mpnt, 0, sizeof(*mpnt));
-
        down_write(&mm->mmap_sem);
        {
                mpnt->vm_mm = mm;
@@ -395,20 +344,30 @@ EXPORT_SYMBOL(ia32_setup_arg_pages);
 #include <linux/sysctl.h>
 
 static ctl_table abi_table2[] = {
-       { 99, "vsyscall32", &sysctl_vsyscall32, sizeof(int), 0644, NULL,
-         proc_dointvec },
-       { 0, }
-}; 
+       {
+               .ctl_name       = 99,
+               .procname       = "vsyscall32",
+               .data           = &sysctl_vsyscall32,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec
+       },
+       {}
+};
 
-static ctl_table abi_root_table2[] = { 
-       { .ctl_name = CTL_ABI, .procname = "abi", .mode = 0555, 
-         .child = abi_table2 }, 
-       { 0 }, 
-}; 
+static ctl_table abi_root_table2[] = {
+       {
+               .ctl_name = CTL_ABI,
+               .procname = "abi",
+               .mode = 0555,
+               .child = abi_table2
+       },
+       {}
+};
 
 static __init int ia32_binfmt_init(void)
 { 
-       register_sysctl_table(abi_root_table2, 1);
+       register_sysctl_table(abi_root_table2);
        return 0;
 }
 __initcall(ia32_binfmt_init);