diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-02 20:03:11 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-07 04:40:18 -0500 |
commit | 01e31dbabc020bf82e7e5359c031a550daafb8ff (patch) | |
tree | 0767caaf88e46570c393c7a63e5f8552355da334 /arch/powerpc | |
parent | 819703872d5955b2e764c3fd9243ba9fa1a6875a (diff) |
[POWERPC] Switch to generic compat_binfmt_elf code
This switches the CONFIG_PPC64 support for 32-bit ELF to use the
generic fs/compat_binfmt_elf.c implementation instead of our own
binfmt_elf32.c. Since so much is the same between 32/64, there is
only one macro we have to define to make the generic support work out
of the box.
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/binfmt_elf32.c | 69 |
3 files changed, 2 insertions, 70 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index d21495f35727..8dcac0b22d68 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -97,6 +97,7 @@ config EARLY_PRINTK | |||
97 | config COMPAT | 97 | config COMPAT |
98 | bool | 98 | bool |
99 | default y if PPC64 | 99 | default y if PPC64 |
100 | select COMPAT_BINFMT_ELF | ||
100 | 101 | ||
101 | config SYSVIPC_COMPAT | 102 | config SYSVIPC_COMPAT |
102 | bool | 103 | bool |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index ac07112b65de..0662ae46f724 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -17,7 +17,7 @@ obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ | |||
17 | init_task.o process.o systbl.o idle.o \ | 17 | init_task.o process.o systbl.o idle.o \ |
18 | signal.o | 18 | signal.o |
19 | obj-y += vdso32/ | 19 | obj-y += vdso32/ |
20 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 20 | obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ |
21 | signal_64.o ptrace32.o \ | 21 | signal_64.o ptrace32.o \ |
22 | paca.o cpu_setup_ppc970.o \ | 22 | paca.o cpu_setup_ppc970.o \ |
23 | cpu_setup_pa6t.o \ | 23 | cpu_setup_pa6t.o \ |
diff --git a/arch/powerpc/kernel/binfmt_elf32.c b/arch/powerpc/kernel/binfmt_elf32.c deleted file mode 100644 index 1d45d7782d4e..000000000000 --- a/arch/powerpc/kernel/binfmt_elf32.c +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | /* | ||
2 | * binfmt_elf32.c: Support 32-bit PPC ELF binaries on Power3 and followons. | ||
3 | * based on the SPARC64 version. | ||
4 | * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@redhat.com) | ||
5 | * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) | ||
6 | * | ||
7 | * Copyright (C) 2000,2001 Ken Aaker (kdaaker@rchland.vnet.ibm.com), IBM Corp | ||
8 | * Copyright (C) 2001 Anton Blanchard (anton@au.ibm.com), IBM | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #include <asm/processor.h> | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/compat.h> | ||
19 | #include <linux/elfcore-compat.h> | ||
20 | |||
21 | #undef ELF_ARCH | ||
22 | #undef ELF_CLASS | ||
23 | #define ELF_CLASS ELFCLASS32 | ||
24 | #define ELF_ARCH EM_PPC | ||
25 | |||
26 | #undef elfhdr | ||
27 | #undef elf_phdr | ||
28 | #undef elf_note | ||
29 | #undef elf_addr_t | ||
30 | #define elfhdr elf32_hdr | ||
31 | #define elf_phdr elf32_phdr | ||
32 | #define elf_note elf32_note | ||
33 | #define elf_addr_t Elf32_Off | ||
34 | |||
35 | #define elf_prstatus compat_elf_prstatus | ||
36 | #define elf_prpsinfo compat_elf_prpsinfo | ||
37 | |||
38 | #define elf_core_copy_regs compat_elf_core_copy_regs | ||
39 | static inline void compat_elf_core_copy_regs(compat_elf_gregset_t *elf_regs, | ||
40 | struct pt_regs *regs) | ||
41 | { | ||
42 | PPC_ELF_CORE_COPY_REGS((*elf_regs), regs); | ||
43 | } | ||
44 | |||
45 | #define elf_core_copy_task_regs compat_elf_core_copy_task_regs | ||
46 | static int compat_elf_core_copy_task_regs(struct task_struct *tsk, | ||
47 | compat_elf_gregset_t *elf_regs) | ||
48 | { | ||
49 | struct pt_regs *regs = tsk->thread.regs; | ||
50 | if (regs) | ||
51 | compat_elf_core_copy_regs(elf_regs, regs); | ||
52 | return 1; | ||
53 | } | ||
54 | |||
55 | #include <linux/time.h> | ||
56 | |||
57 | #undef cputime_to_timeval | ||
58 | #define cputime_to_timeval cputime_to_compat_timeval | ||
59 | static __inline__ void | ||
60 | cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) | ||
61 | { | ||
62 | unsigned long jiffies = cputime_to_jiffies(cputime); | ||
63 | value->tv_usec = (jiffies % HZ) * (1000000L / HZ); | ||
64 | value->tv_sec = jiffies / HZ; | ||
65 | } | ||
66 | |||
67 | #define init_elf_binfmt init_elf32_binfmt | ||
68 | |||
69 | #include "../../../fs/binfmt_elf.c" | ||