diff options
author | Roland McGrath <roland@redhat.com> | 2007-10-17 02:26:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:51 -0400 |
commit | ab799dede9b6d744a926dcb657ed5b30f401f151 (patch) | |
tree | ddc508476fcdd8b445a2df228cc4e2b135f659d1 | |
parent | 48ef09a16edcc98d1de60f66ed7f650c571907f4 (diff) |
Add linux/elfcore-compat.h
This adds the linux/elfcore-compat.h header file, which is the CONFIG_COMPAT
analog of the linux/elfcore.h header. Each arch that needs to fake out
fs/binfmt_elf.c for its compat code can use this header to replace the
hand-copied definitions of the compat variants of struct elf_prstatus et al.
Only the pr_reg field varies by arch, so asm/{compat,elf}.h must define
compat_elf_gregset_t before linux/elfcore-compat.h can be used.
It's a clean-up that every arch with compat core dumping code can benefit
from. I only touched the ones I have handy to test at home. Doing the same
for each other arch should be straightforward, and I'm happy to offer tips.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Andi Kleen <ak@suse.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/elfcore-compat.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/elfcore-compat.h b/include/linux/elfcore-compat.h new file mode 100644 index 000000000000..532d13adabc4 --- /dev/null +++ b/include/linux/elfcore-compat.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef _LINUX_ELFCORE_COMPAT_H | ||
2 | #define _LINUX_ELFCORE_COMPAT_H | ||
3 | |||
4 | #include <linux/elf.h> | ||
5 | #include <linux/elfcore.h> | ||
6 | #include <linux/compat.h> | ||
7 | |||
8 | /* | ||
9 | * Make sure these layouts match the linux/elfcore.h native definitions. | ||
10 | */ | ||
11 | |||
12 | struct compat_elf_siginfo | ||
13 | { | ||
14 | compat_int_t si_signo; | ||
15 | compat_int_t si_code; | ||
16 | compat_int_t si_errno; | ||
17 | }; | ||
18 | |||
19 | struct compat_elf_prstatus | ||
20 | { | ||
21 | struct compat_elf_siginfo pr_info; | ||
22 | short pr_cursig; | ||
23 | compat_ulong_t pr_sigpend; | ||
24 | compat_ulong_t pr_sighold; | ||
25 | compat_pid_t pr_pid; | ||
26 | compat_pid_t pr_ppid; | ||
27 | compat_pid_t pr_pgrp; | ||
28 | compat_pid_t pr_sid; | ||
29 | struct compat_timeval pr_utime; | ||
30 | struct compat_timeval pr_stime; | ||
31 | struct compat_timeval pr_cutime; | ||
32 | struct compat_timeval pr_cstime; | ||
33 | compat_elf_gregset_t pr_reg; | ||
34 | #ifdef CONFIG_BINFMT_ELF_FDPIC | ||
35 | compat_ulong_t pr_exec_fdpic_loadmap; | ||
36 | compat_ulong_t pr_interp_fdpic_loadmap; | ||
37 | #endif | ||
38 | compat_int_t pr_fpvalid; | ||
39 | }; | ||
40 | |||
41 | struct compat_elf_prpsinfo | ||
42 | { | ||
43 | char pr_state; | ||
44 | char pr_sname; | ||
45 | char pr_zomb; | ||
46 | char pr_nice; | ||
47 | compat_ulong_t pr_flag; | ||
48 | compat_uid_t pr_uid; | ||
49 | compat_gid_t pr_gid; | ||
50 | compat_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; | ||
51 | char pr_fname[16]; | ||
52 | char pr_psargs[ELF_PRARGSZ]; | ||
53 | }; | ||
54 | |||
55 | #endif /* _LINUX_ELFCORE_COMPAT_H */ | ||